PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 51 - Q_WS_X11 should only be defined for Linux
: Q_WS_X11 should only be defined for Linux
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: PySide
: HEAD
: All All
: P2 major
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2009-09-10 14:05 EEST by Brendan Duncan
Modified: 2009-10-14 10:58 EEST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brendan Duncan 2009-09-10 14:05:58 EEST
data/global.h

Change:
//Export X11 related functions
#define Q_WS_X11

To:
//Export system specific functions
#ifdef __APPLE__
#define Q_WS_MAC
#elif __WIN32__
#define Q_WS_WIN
#else
#define Q_WS_X11
#endif
Comment 1 Brendan Duncan 2009-09-10 16:24:07 EEST
Also, the appropriate architecture flag needs to be added to global.h for the
correct qatomic_* header to be used.

I am compiling for 64-bit, so I needed to add 
#define __x86_64__
along with Q_WS_MAC

and similarly if I wanted to compile for 32-bit, I would need to add
#define __i386__


If either of those aren't defined for the apiextractor preprocess, then
qatomic_macosx.h is defaulting to the powerpc architecture and calling
#include <QtCore/qatomic_powerpc.h>
which is the incorrect architecture.

There needs to be a way for the apiextractor to define the correct architecture
macro when parsing the headers, for the intended output.  A good candidate
place might be through a command line argument.
Comment 2 Brendan Duncan 2009-09-10 17:20:21 EEST
One other problem:
__APPLE__ (and I assume _WIN32 as well) is not defined by the apiextractor
preprocessor, so it doesn't get into the correct #ifdef section below.

apiextractor preprocess should define the appropriate system macro for the OS
it was compiled for, so that the preprocessor can correctly handle
system-specific sections.
Comment 3 Hugo Parente Lima 2009-09-23 15:59:45 EEST
Fixed on commit a8f64bab749f5f072e29e301f24d582a4cff58c2