Patch to use Q_OS_MAC instead of Q_OS_MACOS
I built KeePassX 2 current source as of 2012-07-14 using the following
macports qt4-mac @4.7.4_1+quartz+universal
macports qt4-mac @4.8.2_0+quartz+universal
nokia release qt-mac-opensource-4.8.2.dmg
My build machine is Mac OS X 10.6.8 with Xcode 3.2.6
With each Qt version, linking failed. src/gui/Clipboard.cpp was
attempting to include QtDBus, which is not present.
A bit of testing shows the QtDBus inclusion is attempted because
Q_OS_MACOS is not defined. Q_OS_MACOS is also used in three additional
files to attempt to switch on or off Mac-specific behavior.
Tracing back to see why it's not defined, we find a possible typo in 4
KeePassX source files.
QGLOBAL_H is defined during build, so <QtCore/qglobal.h> is being
referenced successfully upstream. In qglobal.h, Q_OS_DARWIN is defined
successfully based on presence of APPLE and one of 3 compiler name
defines. Finally, in qglobal.h, Q_OS_DARWIN is used to, among other things,
define Q_OS_MAC, not Q_OS_MACOS.
The patch below changes the six recently created Q_OS_MACOS references
in KeePassX current source to Q_OS_MAC. The resulting binary builds and
runs properly as far as I can tell in my limited testing.
======= ><8 =======