From: Mattia Barbon Date: Fri, 17 Jan 2003 20:01:20 +0000 (+0000) Subject: Under Cygwin, in platform.h default to wxMSW unless otherwise specified. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d66dcb6022662c03aa32f1c7ad306552f1edfdc0 Under Cygwin, in platform.h default to wxMSW unless otherwise specified. Do not #define __WIN95__, __WINDOWS__, __WXMSW__ on the command line for Cygwin/MinGW (when build with makefiles), since platform.h already does that for us. Always check for __WIN32__, not for WIN32 or _WIN32 (just for consistency). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18793 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/defs.h b/include/wx/defs.h index 4d6f2106b5..6696c00e97 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -156,7 +156,7 @@ #elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100) // Watcom 11+ supports bool #define HAVE_BOOL - #elif defined(__GNUWIN32__) + #elif defined(__GNUWIN32__) || defined(__MINGW32__) || defined(__CYGWIN__) // Cygwin supports bool #define HAVE_BOOL #elif defined(__VISAGECPP__) diff --git a/include/wx/msw/dibutils.h b/include/wx/msw/dibutils.h index bb9845f2c6..060e748973 100644 --- a/include/wx/msw/dibutils.h +++ b/include/wx/msw/dibutils.h @@ -88,7 +88,7 @@ PDIB wxDibReadBitmapInfo(HFILE fh); #define wxDibFlipY(lpbi, y) ((int)(lpbi)->biHeight-1-(y)) //HACK for NT BI_BITFIELDS DIBs -#ifdef WIN32 +#ifdef __WIN32__ #define wxDibPtr(lpbi) ((lpbi)->biCompression == BI_BITFIELDS \ ? (LPVOID)(wxDibColors(lpbi) + 3) \ : (LPVOID)(wxDibColors(lpbi) + (UINT)(lpbi)->biClrUsed)) diff --git a/include/wx/platform.h b/include/wx/platform.h index c49935f8c4..68fe507d82 100644 --- a/include/wx/platform.h +++ b/include/wx/platform.h @@ -18,6 +18,22 @@ first define Windows symbols if they're not defined on the command line: we can autodetect everything we need if _WIN32 is defined */ +#if defined(__CYGWIN32__) && !defined(__WXMOTIF__) && !defined(__WXGTK__) \ + && !defined(__WXX11__) + /* for Cygwin, default to wxMSW unless otherwise specified */ + #ifndef __WXMSW__ + #define __WXMSW__ + #endif + + #ifndef _WIN32 + #define _WIN32 + #endif + + #ifndef WIN32 + #define WIN32 + #endif +#endif + #if defined(_WIN32) || defined(WIN32) || defined(__NT__) || defined(__WXWINCE__) #ifndef __WXMSW__ #define __WXMSW__ diff --git a/src/makeg95.env b/src/makeg95.env index 5323dea56f..763cf395a1 100644 --- a/src/makeg95.env +++ b/src/makeg95.env @@ -218,10 +218,11 @@ OPTIONS = -DSTRICT $(_USE_W32API_HEADER_IF_SUPPORTED) # Add "-mthreads" if you want to have threads under mingw32 # Add "-mno-cygwin" if you want to link with msvcrt.dll in Cywin and Wine -# Otherwise, you link against the native runtime (cygwin.dll or libc) -# Having the flag in mingw32 does not hurt as you always link against msvcrt.dll -# By default it should be on, to minimize dependencies on Cygwin, and -# have more correct filename behaviour in Wine. +# Otherwise, you link against the native runtime (cygwin.dll +# or libc). Having the flag in mingw32 does not hurt as you +# always link against msvcrt.dll By default it should be on, +# to minimize dependencies on Cygwin, and have more correct +# filename behaviour in Wine. COMMON_FLAGS = -mno-cygwin # -mthreads # Debugging information @@ -240,7 +241,7 @@ WINVERSION=-DWINVER=0x0350 -D__GNUWIN32__ # Generic WIN32 else APPVER=4.0 # 3.50 # This means 'enable Windows 95 features' (in wxWindows and in the compiler). -WINVERSION=-DWINVER=0x0400 -D__WIN95__ -D__GNUWIN32__ +WINVERSION=-DWINVER=0x0400 -D__GNUWIN32__ endif # This is never used and should be expunged. @@ -261,10 +262,10 @@ WARN = -Wall # build wxbase/wxMSW ifeq ($(wxUSE_GUI),1) TOOLKIT=msw - GUI = -D__WXMSW__ -D__WINDOWS__ + GUI = else TOOLKIT=base - GUI = -D__WXMSW__ -D__WINDOWS__ -DwxUSE_GUI=0 + GUI = -DwxUSE_GUI=0 endif ifeq ($(FINAL),1) @@ -290,15 +291,15 @@ OLELIBS=-lole32 -loleaut32 -luuid BASELIBS=-lstdc++ -lgcc -lodbc32 -lwsock32 ifeq ($(wxUSE_GUI),1) WINLIBS= $(BASELIBS) \ - -lwinspool -lwinmm -lshell32 \ - -lcomctl32 -lctl3d32 -lodbc32 -ladvapi32 \ - -lodbc32 -lwsock32 -lopengl32 -lglu32 $(OLELIBS) # -loldnames + -lwinspool -lwinmm -lshell32 \ + -lcomctl32 -lctl3d32 -lodbc32 -ladvapi32 \ + -lodbc32 -lwsock32 -lopengl32 -lglu32 $(OLELIBS) # -loldnames else WINLIBS=$(BASELIBS) endif #WINLIBS=-lstdc++ -lgcc \ -# -lwinspool -lwinmm -lshell32 \ +# -lwinspool -lwinmm -lshell32 \ # -lcomctl32 -lctl3d32 -lodbc32 -ladvapi32 -lwsock32 # -loldnames # Shouldn't need to change these... diff --git a/src/msw/dibutils.cpp b/src/msw/dibutils.cpp index 9f3051b408..0e10e7b029 100644 --- a/src/msw/dibutils.cpp +++ b/src/msw/dibutils.cpp @@ -183,7 +183,7 @@ PDIB wxDibOpenFile(LPTSTR szFile) LPVOID p; OFSTRUCT of; -#if defined(WIN32) || defined(_WIN32) +#if defined(__WIN32__) #define GetCurrentInstance() GetModuleHandle(NULL) #else #define GetCurrentInstance() (HINSTANCE)SELECTOROF((LPVOID)&of) diff --git a/src/msw/printwin.cpp b/src/msw/printwin.cpp index ea9b16ab5a..0acf3ddba4 100644 --- a/src/msw/printwin.cpp +++ b/src/msw/printwin.cpp @@ -89,7 +89,7 @@ wxWindowsPrinter::~wxWindowsPrinter() { // avoids warning about statement with no effect (FreeProcInstance // doesn't do anything under Win32) -#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32__) && !defined(__NT__) && !defined(__GNUWIN32__) +#if !defined(__WIN32__) && !defined(__NT__) FreeProcInstance((FARPROC) m_lpAbortProc); #endif } diff --git a/src/msw/window.cpp b/src/msw/window.cpp index a0398ffae2..0ff6db44ee 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -5025,7 +5025,7 @@ void wxSetKeyboardHook(bool doIt) // avoids warning about statement with no effect (FreeProcInstance // doesn't do anything under Win32) -#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32__) && !defined(__NT__) && !defined(__GNUWIN32__) +#if !defined(__WIN32__) && !defined(__NT__) FreeProcInstance(wxTheKeyboardHookProc); #endif }