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 | d015e4d8b48ad76acce178827f3ab114c330308c (patch) | |
tree | 75ae24370f3056d16427e5a17c5a9aaf6e1351e6 /generic/tkTest.c | |
parent | 3655db8b8d9c31f3253d97a9ea250b07641c24d9 (diff) | |
download | tk-d015e4d8b48ad76acce178827f3ab114c330308c.zip tk-d015e4d8b48ad76acce178827f3ab114c330308c.tar.gz tk-d015e4d8b48ad76acce178827f3ab114c330308c.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/tkTest.c')
-rw-r--r-- | generic/tkTest.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/generic/tkTest.c b/generic/tkTest.c index 8146c69..562b2c8 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.c @@ -24,7 +24,7 @@ #include "tkInt.h" #include "tkText.h" -#ifdef __WIN32__ +#ifdef _WIN32 #include "tkWinInt.h" #endif @@ -160,11 +160,11 @@ static int TestfontObjCmd(ClientData dummy, Tcl_Obj *const objv[]); static int TestmakeexistCmd(ClientData dummy, Tcl_Interp *interp, int argc, const char **argv); -#if !(defined(__WIN32__) || defined(MAC_OSX_TK) || defined(__CYGWIN__)) +#if !(defined(_WIN32) || defined(MAC_OSX_TK) || defined(__CYGWIN__)) static int TestmenubarCmd(ClientData dummy, Tcl_Interp *interp, int argc, const char **argv); #endif -#if defined(__WIN32__) || defined(MAC_OSX_TK) +#if defined(_WIN32) || defined(MAC_OSX_TK) static int TestmetricsCmd(ClientData dummy, Tcl_Interp *interp, int argc, const char **argv); #endif @@ -186,7 +186,7 @@ static void CustomOptionFree(ClientData clientData, Tk_Window tkwin, char *internalPtr); static int TestpropCmd(ClientData dummy, Tcl_Interp *interp, int argc, const char **argv); -#if !(defined(__WIN32__) || defined(MAC_OSX_TK) || defined(__CYGWIN__)) +#if !(defined(_WIN32) || defined(MAC_OSX_TK) || defined(__CYGWIN__)) static int TestwrapperCmd(ClientData dummy, Tcl_Interp *interp, int argc, const char **argv); #endif @@ -259,7 +259,7 @@ Tktest_Init( Tcl_CreateCommand(interp, "testtext", TkpTesttextCmd, (ClientData) Tk_MainWindow(interp), NULL); -#if defined(__WIN32__) || defined(MAC_OSX_TK) +#if defined(_WIN32) || defined(MAC_OSX_TK) Tcl_CreateCommand(interp, "testmetrics", TestmetricsCmd, (ClientData) Tk_MainWindow(interp), NULL); #elif !defined(__CYGWIN__) @@ -269,7 +269,7 @@ Tktest_Init( (ClientData) Tk_MainWindow(interp), NULL); Tcl_CreateCommand(interp, "testwrapper", TestwrapperCmd, (ClientData) Tk_MainWindow(interp), NULL); -#endif /* __WIN32__ || MAC_OSX_TK */ +#endif /* _WIN32 || MAC_OSX_TK */ /* * Create test image type. @@ -1693,7 +1693,7 @@ TestmakeexistCmd( */ /* ARGSUSED */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK) || defined(__CYGWIN__)) +#if !(defined(_WIN32) || defined(MAC_OSX_TK) || defined(__CYGWIN__)) static int TestmenubarCmd( ClientData clientData, /* Main window for application. */ @@ -1761,7 +1761,7 @@ TestmenubarCmd( *---------------------------------------------------------------------- */ -#if defined(__WIN32__) || defined(MAC_OSX_TK) +#if defined(_WIN32) || defined(MAC_OSX_TK) static int TestmetricsCmd( ClientData clientData, /* Main window for application. */ @@ -1772,7 +1772,7 @@ TestmetricsCmd( char buf[TCL_INTEGER_SPACE]; int val; -#ifdef __WIN32__ +#ifdef _WIN32 if (argc < 2) { Tcl_AppendResult(interp, "wrong # args; must be \"", argv[0], " option ?arg ...?\"", NULL); @@ -1795,13 +1795,13 @@ TestmetricsCmd( #endif if (strcmp(argv[1], "cyvscroll") == 0) { -#ifdef __WIN32__ +#ifdef _WIN32 val = GetSystemMetrics(SM_CYVSCROLL); #else val = ((TkScrollbar *) winPtr->instanceData)->width; #endif } else if (strcmp(argv[1], "cxhscroll") == 0) { -#ifdef __WIN32__ +#ifdef _WIN32 val = GetSystemMetrics(SM_CXHSCROLL); #else val = ((TkScrollbar *) winPtr->instanceData)->width; @@ -1895,7 +1895,7 @@ TestpropCmd( return TCL_OK; } -#if !(defined(__WIN32__) || defined(MAC_OSX_TK) || defined(__CYGWIN__)) +#if !(defined(_WIN32) || defined(MAC_OSX_TK) || defined(__CYGWIN__)) /* *---------------------------------------------------------------------- * |