summaryrefslogtreecommitdiff
authorzecke <zecke>2004-10-15 19:23:42 (UTC)
committer zecke <zecke>2004-10-15 19:23:42 (UTC)
commitac36bfe2794741188da1d6d4b471f96fd15d47ee (patch) (unidiff)
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 @@
20#include "calendar.h" 20#include "calendar.h"
21#include "qpeglobal.h"
21 22
@@ -24,2 +25,3 @@
24 25
26
25/*! \class Calendar calendar.html 27/*! \class Calendar calendar.html
@@ -32,10 +34,3 @@
32 34
33#ifdef Q_OS_MACX 35static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() QPE_SYMBOL_UNUSED;
34 #define ATTRIBUTE_UNUSED
35#else
36 #define ATTRIBUTE_UNUSED __attribute__((unused))
37#endif
38
39
40static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() ATTRIBUTE_UNUSED;
41static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() { 36static 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 \
61 imagecodecinterface.h \ 61 imagecodecinterface.h \
62 qt_override_p.h 62 qt_override_p.h \
63 qpeglobal.h
63 64
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 @@
90#include "imagecodecinterface.h" 90#include "imagecodecinterface.h"
91#include <qtopia/qpeglobal.h>
91 92
@@ -1296,8 +1297,3 @@ bool qt_left_hand_scrollbars = false;
1296#else 1297#else
1297#ifdef Q_OS_MACX 1298extern bool qt_left_hand_scrollbars QPE_WEAK_SYMBOL;
1298#define WEAK_SYMBOL __attribute__((weak_import))
1299#else
1300#define WEAK_SYMBOL __attribute__((weak))
1301#endif
1302extern bool qt_left_hand_scrollbars WEAK_SYMBOL;
1303#endif 1299#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 @@
1/*
2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002,2003,2004 Holger Hans Peter Freyther <freyther@handhelds.org>
4           .>+-=
5 _;:,     .>    :=|. This library is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This library is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details.
19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = Library General Public License along with
22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#ifndef QPE_GLOBAL_H
30#define QPE_GLOBAL_H
31
32/**
33 * Defines for used compiler attributes
34 *
35 */
36#if defined(Q_OS_MACX)
37#define QPE_WEAK_SYMBOL __attribute__((weak_import))
38#define QPE_SYMBOL_USED
39#define QPE_SYMBOL_UNUSED
40
41#elif defined(_OS_UNIX_)
42#define QPE_WEAK_SYMBOL __attribute__((weak))
43#define QPE_SYMBOL_USED __attribute__((used))
44#define QPE_SYMBOL_UNUSED __attribute__((unused))
45
46
47#else // defined(Q_OS_WIN32)
48#define QPE_WEAK_SYMBOL
49#define QPE_SYMBOL_USED
50#define QPE_SYMBOL_UNUSED
51#endif
52
53
54
55#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 @@
21#include "qpemessagebox.h" 21#include "qpemessagebox.h"
22#include "qpeglobal.h"
22#include <qtopia/stringutil.h> 23#include <qtopia/stringutil.h>
@@ -25,9 +26,3 @@
25 26
26#ifdef Q_OS_MACX 27static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() QPE_SYMBOL_UNUSED;
27 #define ATTRIBUTE_UNUSED
28#else
29 #define ATTRIBUTE_UNUSED __attribute__((unused))
30#endif
31
32static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() ATTRIBUTE_UNUSED;
33static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() { 28static 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 @@
10 10
11#include <qtopia/qpeglobal.h>
11#include "qt_override_p.h" 12#include "qt_override_p.h"
@@ -87,4 +88,3 @@ extern "C" {
87 88
88extern void __gmon_start__ ( ) __attribute__(( weak )); 89extern void __gmon_start__ ( ) QPE_WEAK_SYMBOL;
89
90extern void __gmon_start__ ( ) 90extern void __gmon_start__ ( )
@@ -104,4 +104,2 @@ void QPEApplication::polish ( QWidget *w )
104#ifndef OPIE_NO_OVERRIDE_QT 104#ifndef OPIE_NO_OVERRIDE_QT
105 //qDebug ( "QPEApplication::polish()" );
106
107 for ( const color_fix_t *ptr = apps_that_need_special_colors; ptr-> m_app; ptr++ ) { 105 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
127{ 125{
128 //qDebug ( "QFontDatabase::pointSizes()" );
129
130 QValueList <int> sl = pointSizes_NonWeak ( family, style, charset ); 126 QValueList <int> sl = pointSizes_NonWeak ( family, style, charset );
@@ -146,4 +142,2 @@ void QApplication::setStyle ( QStyle *style )
146{ 142{
147 //qDebug ( "QApplication::setStyle()" );
148
149 if ( Opie::force_appearance & Opie::Force_Style ) 143 if ( Opie::force_appearance & Opie::Force_Style )
@@ -156,4 +150,2 @@ void QApplication::setPalette ( const QPalette &pal, bool informWidgets, const c
156{ 150{
157 //qDebug ( "QApplication::setPalette()" );
158
159 if (!( Opie::force_appearance & Opie::Force_Style )) 151 if (!( Opie::force_appearance & Opie::Force_Style ))
@@ -164,4 +156,2 @@ void QApplication::setFont ( const QFont &fnt, bool informWidgets, const char *c
164{ 156{
165 //qDebug ( "QApplication::setFont()" );
166
167 if (!( Opie::force_appearance & Opie::Force_Font )) 157 if (!( Opie::force_appearance & Opie::Force_Font ))
@@ -173,4 +163,2 @@ void QApplication::qwsSetDecoration ( QWSDecoration *deco )
173{ 163{
174 //qDebug ( "QApplication::qwsSetDecoration()" );
175
176 if ( Opie::force_appearance & Opie::Force_Decoration ) 164 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 @@
74#include <qtopia/applicationinterface.h> 74#include <qtopia/applicationinterface.h>
75 75#include <qtopia/qpeglobal.h>
76 76