summaryrefslogtreecommitdiff
authorzecke <zecke>2004-10-15 19:23:42 (UTC)
committer zecke <zecke>2004-10-15 19:23:42 (UTC)
commitac36bfe2794741188da1d6d4b471f96fd15d47ee (patch) (side-by-side diff)
tree5c1bc264fd554142993be8963aed159f32877d6a
parenta979ea08e8f9dbade70a9bf4fdc93dcbebb5f3fa (diff)
downloadopie-ac36bfe2794741188da1d6d4b471f96fd15d47ee.zip
opie-ac36bfe2794741188da1d6d4b471f96fd15d47ee.tar.gz
opie-ac36bfe2794741188da1d6d4b471f96fd15d47ee.tar.bz2
-Add a QPEGLOBAL that adds define for 'weak', 'used' and unused symbols
Make use of the newly added qpeglobal.h to kill custom versions of similiar macros
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/calendar.cpp11
-rw-r--r--library/library.pro3
-rw-r--r--library/qpeapplication.cpp8
-rw-r--r--library/qpeglobal.h55
-rw-r--r--library/qpemessagebox.cpp9
-rw-r--r--library/qt_override.cpp16
-rw-r--r--library/stable.h2
7 files changed, 67 insertions, 37 deletions
diff --git a/library/calendar.cpp b/library/calendar.cpp
index 70e764c..d281a14 100644
--- a/library/calendar.cpp
+++ b/library/calendar.cpp
@@ -19,8 +19,10 @@
**********************************************************************/
#include "calendar.h"
+#include "qpeglobal.h"
#include <qdatetime.h>
#include <qobject.h>
+
/*! \class Calendar calendar.html
@@ -31,12 +33,5 @@
*/
-#ifdef Q_OS_MACX
- #define ATTRIBUTE_UNUSED
-#else
- #define ATTRIBUTE_UNUSED __attribute__((unused))
-#endif
-
-
-static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() ATTRIBUTE_UNUSED;
+static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() QPE_SYMBOL_UNUSED;
static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() {
(void)QObject::tr("Jan");
diff --git a/library/library.pro b/library/library.pro
index ffd20fd..cdc1dab 100644
--- a/library/library.pro
+++ b/library/library.pro
@@ -60,5 +60,6 @@ HEADERS = calendar.h \
textcodecinterface.h \
imagecodecinterface.h \
- qt_override_p.h
+ qt_override_p.h \
+ qpeglobal.h
SOURCES = calendar.cpp \
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index df313ce..3efba20 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -89,4 +89,5 @@
#include "textcodecinterface.h"
#include "imagecodecinterface.h"
+#include <qtopia/qpeglobal.h>
#include <unistd.h>
@@ -1295,10 +1296,5 @@ void QPEApplication::reset() {
bool qt_left_hand_scrollbars = false;
#else
-#ifdef Q_OS_MACX
-#define WEAK_SYMBOL __attribute__((weak_import))
-#else
-#define WEAK_SYMBOL __attribute__((weak))
-#endif
-extern bool qt_left_hand_scrollbars WEAK_SYMBOL;
+extern bool qt_left_hand_scrollbars QPE_WEAK_SYMBOL;
#endif
diff --git a/library/qpeglobal.h b/library/qpeglobal.h
new file mode 100644
index 0000000..96ce3a6
--- a/dev/null
+++ b/library/qpeglobal.h
@@ -0,0 +1,55 @@
+/*
+               =. This file is part of the OPIE Project
+             .=l. Copyright (c) 2002,2003,2004 Holger Hans Peter Freyther <freyther@handhelds.org>
+           .>+-=
+ _;:,     .>    :=|. This library is free software; you can
+.> <`_,   >  .   <= redistribute it and/or modify it under
+:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
+.="- .-=="i,     .._ License as published by the Free Software
+ - .   .-<_>     .<> Foundation; either version 2 of the License,
+     ._= =}       : or (at your option) any later version.
+    .%`+i>       _;_.
+    .i_,=:_.      -<s. This library is distributed in the hope that
+     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
+    : ..    .:,     . . . without even the implied warranty of
+    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
+  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.=       =       ; Library General Public License for more
+++=   -.     .`     .: details.
+ :     =  ...= . :.=-
+ -.   .:....=;==+<; You should have received a copy of the GNU
+  -_. . .   )=.  = Library General Public License along with
+    --        :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+
+#ifndef QPE_GLOBAL_H
+#define QPE_GLOBAL_H
+
+/**
+ * Defines for used compiler attributes
+ *
+ */
+#if defined(Q_OS_MACX)
+#define QPE_WEAK_SYMBOL __attribute__((weak_import))
+#define QPE_SYMBOL_USED
+#define QPE_SYMBOL_UNUSED
+
+#elif defined(_OS_UNIX_)
+#define QPE_WEAK_SYMBOL __attribute__((weak))
+#define QPE_SYMBOL_USED __attribute__((used))
+#define QPE_SYMBOL_UNUSED __attribute__((unused))
+
+
+#else // defined(Q_OS_WIN32)
+#define QPE_WEAK_SYMBOL
+#define QPE_SYMBOL_USED
+#define QPE_SYMBOL_UNUSED
+#endif
+
+
+
+#endif
diff --git a/library/qpemessagebox.cpp b/library/qpemessagebox.cpp
index c38828a..1df108a 100644
--- a/library/qpemessagebox.cpp
+++ b/library/qpemessagebox.cpp
@@ -20,15 +20,10 @@
#include "qpemessagebox.h"
+#include "qpeglobal.h"
#include <qtopia/stringutil.h>
#include <qmessagebox.h>
-#ifdef Q_OS_MACX
- #define ATTRIBUTE_UNUSED
-#else
- #define ATTRIBUTE_UNUSED __attribute__((unused))
-#endif
-
-static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() ATTRIBUTE_UNUSED;
+static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() QPE_SYMBOL_UNUSED;
static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() {
(void)QMessageBox::tr("Yes");
diff --git a/library/qt_override.cpp b/library/qt_override.cpp
index 56f82d7..a0d753b 100644
--- a/library/qt_override.cpp
+++ b/library/qt_override.cpp
@@ -9,4 +9,5 @@
#include <sys/param.h> // for toolchains with old libc headers
+#include <qtopia/qpeglobal.h>
#include "qt_override_p.h"
@@ -86,6 +87,5 @@ int Opie::force_appearance = 0;
extern "C" {
-extern void __gmon_start__ ( ) __attribute__(( weak ));
-
+extern void __gmon_start__ ( ) QPE_WEAK_SYMBOL;
extern void __gmon_start__ ( )
{
@@ -103,6 +103,4 @@ void QPEApplication::polish ( QWidget *w )
{
#ifndef OPIE_NO_OVERRIDE_QT
-// qDebug ( "QPEApplication::polish()" );
-
for ( const color_fix_t *ptr = apps_that_need_special_colors; ptr-> m_app; ptr++ ) {
if (( ::strcmp ( Opie::binaryName ( ), ptr-> m_app ) == 0 ) &&
@@ -126,6 +124,4 @@ void QPEApplication::polish ( QWidget *w )
QValueList <int> QFontDatabase::pointSizes ( QString const &family, QString const &style, QString const &charset )
{
-// qDebug ( "QFontDatabase::pointSizes()" );
-
QValueList <int> sl = pointSizes_NonWeak ( family, style, charset );
@@ -145,6 +141,4 @@ QValueList <int> QFontDatabase::pointSizes ( QString const &family, QString cons
void QApplication::setStyle ( QStyle *style )
{
-// qDebug ( "QApplication::setStyle()" );
-
if ( Opie::force_appearance & Opie::Force_Style )
delete style;
@@ -155,6 +149,4 @@ void QApplication::setStyle ( QStyle *style )
void QApplication::setPalette ( const QPalette &pal, bool informWidgets, const char *className )
{
-// qDebug ( "QApplication::setPalette()" );
-
if (!( Opie::force_appearance & Opie::Force_Style ))
QApplication::setPalette_NonWeak ( pal, informWidgets, className );
@@ -163,6 +155,4 @@ void QApplication::setPalette ( const QPalette &pal, bool informWidgets, const c
void QApplication::setFont ( const QFont &fnt, bool informWidgets, const char *className )
{
-// qDebug ( "QApplication::setFont()" );
-
if (!( Opie::force_appearance & Opie::Force_Font ))
QApplication::setFont_NonWeak ( fnt, informWidgets, className );
@@ -172,6 +162,4 @@ void QApplication::setFont ( const QFont &fnt, bool informWidgets, const char *c
void QApplication::qwsSetDecoration ( QWSDecoration *deco )
{
-// qDebug ( "QApplication::qwsSetDecoration()" );
-
if ( Opie::force_appearance & Opie::Force_Decoration )
delete deco;
diff --git a/library/stable.h b/library/stable.h
index 10f13a6..ea4526c 100644
--- a/library/stable.h
+++ b/library/stable.h
@@ -73,5 +73,5 @@
#include <qtopia/applicationinterface.h>
-
+#include <qtopia/qpeglobal.h>
#endif