Use __DARWIN__ instead of __WXOSX__ in non-GUI code.

This fixes compilation of non-wxOSX ports (e.g. wxGTK) under OS X.

Also make the difference between the two symbols more clear in the
documentation.

Closes #14503.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72180 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-07-23 15:03:42 +00:00
parent 6a3f00bd66
commit da0ee16ef9
10 changed files with 23 additions and 20 deletions

View File

@@ -2779,6 +2779,11 @@ typedef int (* LINKAGEMODE wxListIterateFunction)(void *current);
/* platform specific (implementation) parts of the headers */
/* --------------------------------------------------------------------------- */
#ifdef __DARWIN__
#define DECLARE_WXOSX_OPAQUE_CFREF( name ) typedef struct __##name* name##Ref;
#define DECLARE_WXOSX_OPAQUE_CONST_CFREF( name ) typedef const struct __##name* name##Ref;
#endif
#ifdef __WXMAC__
#define WX_OPAQUE_TYPE( name ) struct wxOpaque##name
@@ -2815,9 +2820,6 @@ typedef const void * CFTypeRef;
/* typedef const struct __CFString * CFStringRef; */
#define DECLARE_WXOSX_OPAQUE_CFREF( name ) typedef struct __##name* name##Ref;
#define DECLARE_WXOSX_OPAQUE_CONST_CFREF( name ) typedef const struct __##name* name##Ref;
DECLARE_WXOSX_OPAQUE_CONST_CFREF( CFString )
typedef struct __CFString * CFMutableStringRef;

View File

@@ -233,7 +233,7 @@ private:
// integration with MFC) but currently this is not done for all ports yet (e.g.
// wxX11) so fall back to the old wxGUIEventLoop definition below for them
#if defined(__WXOSX__)
#if defined(__DARWIN__)
// CoreFoundation-based event loop is currently in wxBase so include it in
// any case too (although maybe it actually shouldn't be there at all)
#include "wx/osx/evtloop.h"

View File

@@ -89,9 +89,11 @@ inline wxEventLoopSource::~wxEventLoopSource() { }
#if defined(__WXGTK20__)
#include "wx/gtk/evtloopsrc.h"
#elif defined(__WXOSX__)
#endif
#if defined(__DARWIN__)
#include "wx/osx/evtloopsrc.h"
#endif // platform
#endif
#endif // wxUSE_EVENTLOOP_SOURCE

View File

@@ -609,8 +609,7 @@
checking for any OS X port (Carbon and Cocoa) and __WXMAC__ is an old name
for it.
*/
#if defined(__WXOSX_CARBON__) || defined(__WXOSX_COCOA__) || defined(__WXOSX_IPHONE__) \
|| (defined(__DARWIN__) && !wxUSE_GUI)
#if defined(__WXOSX_CARBON__) || defined(__WXOSX_COCOA__) || defined(__WXOSX_IPHONE__)
# ifndef __WXOSX__
# define __WXOSX__ 1
# endif

View File

@@ -840,7 +840,7 @@ public:
#if wxUSE_THREADS
#if defined(__WINDOWS__) || defined(__OS2__) || defined(__EMX__) || defined(__WXOSX__)
#if defined(__WINDOWS__) || defined(__OS2__) || defined(__EMX__) || defined(__DARWIN__)
// unlock GUI if there are threads waiting for and lock it back when
// there are no more of them - should be called periodically by the main
// thread
@@ -852,7 +852,7 @@ public:
// wakes up the main thread if it's sleeping inside ::GetMessage()
extern void WXDLLIMPEXP_BASE wxWakeUpMainThread();
#ifndef __WXOSX__
#ifndef __DARWIN__
// return true if the main thread is waiting for some other to terminate:
// wxApp then should block all "dangerous" messages
extern bool WXDLLIMPEXP_BASE wxIsWaitingForThread();