diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-02-10 11:06:19 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-02-10 11:06:19 (GMT) |
commit | ca3d39ff5db486b96f9b003ff4548278629f8c61 (patch) | |
tree | 75ae24370f3056d16427e5a17c5a9aaf6e1351e6 /generic/tkWindow.c | |
parent | 9de9697d3f35ba5859817ae84710decadeda45d6 (diff) | |
download | tk-ca3d39ff5db486b96f9b003ff4548278629f8c61.zip tk-ca3d39ff5db486b96f9b003ff4548278629f8c61.tar.gz tk-ca3d39ff5db486b96f9b003ff4548278629f8c61.tar.bz2 |
Eliminate all usage of __WIN32__ macro: Some compilers (e.g. Clang/LLVM) don't define it, and _WIN32 is much more portable anyway.
See: [http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system#WindowsCygwinnonPOSIXandMinGW]
Diffstat (limited to 'generic/tkWindow.c')
-rw-r--r-- | generic/tkWindow.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 6f5ee95..4a65db7 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -14,7 +14,7 @@ #include "tkInt.h" -#ifdef __WIN32__ +#ifdef _WIN32 #include "tkWinInt.h" #elif !defined(MAC_OSX_TK) #include "tkUnixInt.h" @@ -189,7 +189,7 @@ static const TkCmd commands[] = { * these commands differently (via the script library). */ -#if defined(__WIN32__) || defined(MAC_OSX_TK) +#if defined(_WIN32) || defined(MAC_OSX_TK) {"tk_chooseColor", Tk_ChooseColorObjCmd, PASSMAINWINDOW}, {"tk_chooseDirectory", Tk_ChooseDirectoryObjCmd,WINMACONLY|PASSMAINWINDOW}, {"tk_getOpenFile", Tk_GetOpenFileObjCmd, WINMACONLY|PASSMAINWINDOW}, @@ -959,7 +959,7 @@ TkCreateMainWindow( Tcl_Panic("TkCreateMainWindow: builtin command with NULL string and object procs"); } -#if defined(__WIN32__) && !defined(STATIC_BUILD) +#if defined(_WIN32) && !defined(STATIC_BUILD) if ((cmdPtr->flags & WINMACONLY) && tclStubsPtr->reserved9) { /* * We are running on Cygwin, so don't use the win32 dialogs. @@ -967,7 +967,7 @@ TkCreateMainWindow( continue; } -#endif /* __WIN32__ && !STATIC_BUILD */ +#endif /* _WIN32 && !STATIC_BUILD */ if (cmdPtr->flags & PASSMAINWINDOW) { clientData = tkwin; @@ -1466,7 +1466,7 @@ Tk_DestroyWindow( TkWmRemoveFromColormapWindows(winPtr); } if (winPtr->window != None) { -#if defined(MAC_OSX_TK) || defined(__WIN32__) +#if defined(MAC_OSX_TK) || defined(_WIN32) XDestroyWindow(winPtr->display, winPtr->window); #else if ((winPtr->flags & TK_TOP_HIERARCHY) @@ -2851,7 +2851,7 @@ DeleteWindowsExitProc( tsdPtr->initialized = 0; } -#if defined(__WIN32__) +#if defined(_WIN32) static HMODULE tkcygwindll = NULL; @@ -2897,7 +2897,7 @@ TkCygwinMainEx( tkmainex(argc, argv, appInitProc, interp); return 1; } -#endif /* __WIN32__ */ +#endif /* _WIN32 */ /* *---------------------------------------------------------------------- @@ -2926,7 +2926,7 @@ int Tk_Init( Tcl_Interp *interp) /* Interpreter to initialize. */ { -#if defined(__WIN32__) +#if defined(_WIN32) if (tkcygwindll) { int (*tkinit)(Tcl_Interp *); @@ -2935,7 +2935,7 @@ Tk_Init( return tkinit(interp); } } -#endif /* __WIN32__ */ +#endif /* _WIN32 */ return Initialize(interp); } @@ -2999,7 +2999,7 @@ Tk_SafeInit( * checked at several places to differentiate the two initialisations. */ -#if defined(__WIN32__) +#if defined(_WIN32) if (tkcygwindll) { int (*tksafeinit)(Tcl_Interp *); @@ -3009,7 +3009,7 @@ Tk_SafeInit( return tksafeinit(interp); } } -#endif /* __WIN32__ */ +#endif /* _WIN32 */ return Initialize(interp); } |