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
@@ -20,2 +20,3 @@
#include "calendar.h"
+#include "qpeglobal.h"
@@ -24,2 +25,3 @@
+
/*! \class Calendar calendar.html
@@ -32,10 +34,3 @@
-#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() {
diff --git a/library/library.pro b/library/library.pro
index ffd20fd..cdc1dab 100644
--- a/library/library.pro
+++ b/library/library.pro
@@ -61,3 +61,4 @@ HEADERS = calendar.h \
imagecodecinterface.h \
- qt_override_p.h
+ qt_override_p.h \
+ qpeglobal.h
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index df313ce..3efba20 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -90,2 +90,3 @@
#include "imagecodecinterface.h"
+#include <qtopia/qpeglobal.h>
@@ -1296,8 +1297,3 @@ 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
@@ -21,2 +21,3 @@
#include "qpemessagebox.h"
+#include "qpeglobal.h"
#include <qtopia/stringutil.h>
@@ -25,9 +26,3 @@
-#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() {
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
@@ -10,2 +10,3 @@
+#include <qtopia/qpeglobal.h>
#include "qt_override_p.h"
@@ -87,4 +88,3 @@ extern "C" {
-extern void __gmon_start__ ( ) __attribute__(( weak ));
-
+extern void __gmon_start__ ( ) QPE_WEAK_SYMBOL;
extern void __gmon_start__ ( )
@@ -104,4 +104,2 @@ 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++ ) {
@@ -127,4 +125,2 @@ QValueList <int> QFontDatabase::pointSizes ( QString const &family, QString cons
{
-// qDebug ( "QFontDatabase::pointSizes()" );
-
QValueList <int> sl = pointSizes_NonWeak ( family, style, charset );
@@ -146,4 +142,2 @@ void QApplication::setStyle ( QStyle *style )
{
-// qDebug ( "QApplication::setStyle()" );
-
if ( Opie::force_appearance & Opie::Force_Style )
@@ -156,4 +150,2 @@ void QApplication::setPalette ( const QPalette &pal, bool informWidgets, const c
{
-// qDebug ( "QApplication::setPalette()" );
-
if (!( Opie::force_appearance & Opie::Force_Style ))
@@ -164,4 +156,2 @@ void QApplication::setFont ( const QFont &fnt, bool informWidgets, const char *c
{
-// qDebug ( "QApplication::setFont()" );
-
if (!( Opie::force_appearance & Opie::Force_Font ))
@@ -173,4 +163,2 @@ void QApplication::qwsSetDecoration ( QWSDecoration *deco )
{
-// qDebug ( "QApplication::qwsSetDecoration()" );
-
if ( Opie::force_appearance & Opie::Force_Decoration )
diff --git a/library/stable.h b/library/stable.h
index 10f13a6..ea4526c 100644
--- a/library/stable.h
+++ b/library/stable.h
@@ -74,3 +74,3 @@
#include <qtopia/applicationinterface.h>
-
+#include <qtopia/qpeglobal.h>