From 2d2ed20f7bbc531689ae3c22f02a8633bf1a9ebd Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Fri, 28 Mar 2003 19:18:51 +0000 Subject: [PATCH] mach-o addition git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19854 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/app.h | 2 +- include/wx/filefn.h | 4 ++-- include/wx/wx_cw_cm.h | 19 +++++++++++++------ include/wx/wx_cwc.h | 16 ++++++++++++---- include/wx/wx_cwc_d.h | 8 ++++++-- include/wx_cwc.pch | 15 +++++++++++++-- include/wx_cwc.pch++ | 15 +++++++++++++-- include/wx_cwc_d.pch | 11 ++++++++++- include/wx_cwc_d.pch++ | 12 ++++++++++-- 9 files changed, 80 insertions(+), 22 deletions(-) diff --git a/include/wx/app.h b/include/wx/app.h index 605fbc2ecb..ac59394d3a 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -534,7 +534,7 @@ public: #define IMPLEMENT_WXWIN_MAIN \ extern int wxEntry( int argc, char **argv ); \ int main(int argc, char **argv) { return wxEntry(argc, argv); } -#elif defined(__WXMAC__) && defined(__UNIX__) +#elif defined(__WXMAC__) // wxMac seems to have a specific wxEntry prototype #define IMPLEMENT_WXWIN_MAIN \ extern int wxEntry( int argc, char **argv, bool enterLoop = TRUE ); \ diff --git a/include/wx/filefn.h b/include/wx/filefn.h index c34371d988..75313630d8 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -31,7 +31,7 @@ #else // define off_t -#if !defined(__WXMAC__) || defined(__UNIX__) +#if !defined(__WXMAC__) || defined(__UNIX__) || defined(__MACH__) #include #else typedef long off_t; @@ -43,7 +43,7 @@ typedef long off_t; #elif defined(__SC__) typedef long off_t; -#elif defined(__MWERKS__) && !defined(__INTEL__) +#elif defined(__MWERKS__) && !defined(__INTEL__) && !defined(__MACH__) typedef long off_t; #endif diff --git a/include/wx/wx_cw_cm.h b/include/wx/wx_cw_cm.h index c5dd9aef7a..21aa30cbab 100644 --- a/include/wx/wx_cw_cm.h +++ b/include/wx/wx_cw_cm.h @@ -10,7 +10,7 @@ #pragma old_argmatch on #endif -#if (__MWERKS__ < 0x0900) || macintosh +#if (__MWERKS__ < 0x0900) || macintosh || __MACH__ #define __MAC__ #define __WXMAC__ #elif (__MWERKS__ >= 0x0900) && __INTEL__ @@ -42,14 +42,21 @@ #elif defined( __WXMAC__) #define USE_PRECOMPILED_MAC_HEADERS 0 /*Set to 0 if you don't want to use precompiled MacHeaders*/ #define ACCESSOR_CALLS_ARE_FUNCTIONS 1 - #ifdef __WXDEBUG__ + #if defined( __WXDEBUG__ ) && !defined(__MACH__) // otherwise the debugger looses all symbol information #define OPAQUE_TOOLBOX_STRUCTS 0 - // #else - // enabling opaque toolbox structs under Classic will break access to contrlDefProc (control.cpp) - // #define OPAQUE_TOOLBOX_STRUCTS 1 + #else + #define OPAQUE_TOOLBOX_STRUCTS 1 + #endif + #ifdef __MACH__ + #include + #include + #include + #undef WCHAR_MAX + #include + #else + #include #endif - #include /* #include #if UNIVERSAL_INTERFACES_VERSION < 0x0340 diff --git a/include/wx/wx_cwc.h b/include/wx/wx_cwc.h index ea8911edf0..8fa963af54 100644 --- a/include/wx/wx_cwc.h +++ b/include/wx/wx_cwc.h @@ -18,21 +18,29 @@ #if __option(profile) #ifdef __cplusplus - #if __POWERPC__ + #ifdef __MACH__ + #include + #elif __POWERPC__ #include #endif #else - #if __POWERPC__ + #ifdef __MACH__ + #include + #elif __POWERPC__ #include #endif #endif #else #ifdef __cplusplus - #if __POWERPC__ + #ifdef __MACH__ + #include + #elif __POWERPC__ #include #endif #else - #if __POWERPC__ + #ifdef __MACH__ + #include + #elif __POWERPC__ #include #endif #endif diff --git a/include/wx/wx_cwc_d.h b/include/wx/wx_cwc_d.h index 46a17bc2dc..6db33689c0 100644 --- a/include/wx/wx_cwc_d.h +++ b/include/wx/wx_cwc_d.h @@ -20,11 +20,15 @@ #error "profiling is not supported in debug versions" #else #ifdef __cplusplus - #if __POWERPC__ + #ifdef __MACH__ + #include + #elif __POWERPC__ #include #endif #else - #if __POWERPC__ + #ifdef __MACH__ + #include + #elif __POWERPC__ #include #endif #endif diff --git a/include/wx_cwc.pch b/include/wx_cwc.pch index e2416bb385..c6e0d96ca9 100644 --- a/include/wx_cwc.pch +++ b/include/wx_cwc.pch @@ -1,11 +1,15 @@ #if __option (profile) -#if __POWERPC__ +#ifdef __MACH__ + #pragma precompile_target "wx_Mach_prof.mch" +#elif __POWERPC__ #pragma precompile_target "wx_Carbon_prof.mch" #else #error "illegal processor for carbon" #endif #else -#if __POWERPC__ +#ifdef __MACH__ + #pragma precompile_target "wx_Mach.mch" +#elif __POWERPC__ #pragma precompile_target "wx_Carbon.mch" #else #error "illegal processor for carbon" @@ -17,5 +21,12 @@ #define wxUSE_GUI 1 #define TARGET_CARBON 1 #define OLDP2C 1 +#ifdef __MACH__ + #define __DARWIN__ + #define __CF_USE_FRAMEWORK_INCLUDES__ + #define __NOEXTENSIONS__ + #define __UNIX__ + #define __UNIX_LIKE__ +#endif #include "wx/wx_cw_cm.h" diff --git a/include/wx_cwc.pch++ b/include/wx_cwc.pch++ index c461aa354d..e39a34cefb 100644 --- a/include/wx_cwc.pch++ +++ b/include/wx_cwc.pch++ @@ -1,11 +1,15 @@ #if __option (profile) -#if __POWERPC__ +#ifdef __MACH__ + #pragma precompile_target "wx_Mach++_prof.mch" +#elif __POWERPC__ #pragma precompile_target "wx_Carbon++_prof.mch" #else #error "illegal processor for carbon" #endif #else -#if __POWERPC__ +#ifdef __MACH__ + #pragma precompile_target "wx_Mach++.mch" +#elif __POWERPC__ #pragma precompile_target "wx_Carbon++.mch" #else #error "illegal processor for carbon" @@ -17,6 +21,13 @@ #define wxUSE_GUI 1 #define TARGET_CARBON 1 #define OLDP2C 1 +#ifdef __MACH__ + #define __DARWIN__ + #define __CF_USE_FRAMEWORK_INCLUDES__ + #define __NOEXTENSIONS__ + #define __UNIX__ + #define __UNIX_LIKE__ +#endif #include "wx/wx_cw_cm.h" #include "wx/wxprec.h" \ No newline at end of file diff --git a/include/wx_cwc_d.pch b/include/wx_cwc_d.pch index d067e378f7..631d3c4c13 100644 --- a/include/wx_cwc_d.pch +++ b/include/wx_cwc_d.pch @@ -1,7 +1,9 @@ #if __option (profile) #error "profiling is not supported for debug targets" #else -#if __POWERPC__ +#ifdef __MACH__ + #pragma precompile_target "wx_Mach_d.mch" +#elif __POWERPC__ #pragma precompile_target "wx_Carbon_d.mch" #else #error "illegal processor for carbon" @@ -13,6 +15,13 @@ #define wxUSE_GUI 1 #define TARGET_CARBON 1 #define OLDP2C 1 +#ifdef __MACH__ + #define __DARWIN__ + #define __CF_USE_FRAMEWORK_INCLUDES__ + #define __NOEXTENSIONS__ + #define __UNIX__ + #define __UNIX_LIKE__ +#endif #include "wx/wx_cw_cm.h" #ifdef __WXMSW__ diff --git a/include/wx_cwc_d.pch++ b/include/wx_cwc_d.pch++ index fce9c9b1b6..9ab065ece8 100644 --- a/include/wx_cwc_d.pch++ +++ b/include/wx_cwc_d.pch++ @@ -1,7 +1,9 @@ #if __option (profile) #error "profiling is not supported for debug targets" #else -#if __POWERPC__ +#ifdef __MACH__ + #pragma precompile_target "wx_Mach++_d.mch" +#elif __POWERPC__ #pragma precompile_target "wx_Carbon++_d.mch" #else #error "illegal processor for carbon" @@ -15,7 +17,13 @@ #define wxUSE_GUI 1 #define TARGET_CARBON 1 #define OLDP2C 1 - +#ifdef __MACH__ + #define __DARWIN__ + #define __CF_USE_FRAMEWORK_INCLUDES__ + #define __NOEXTENSIONS__ + #define __UNIX__ + #define __UNIX_LIKE__ +#endif #include "wx/wx_cw_cm.h" #ifdef WX_PRECOMP #include "wx/wxprec.h" -- 2.45.2