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/ttk | |
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/ttk')
-rw-r--r-- | generic/ttk/ttkGenStubs.tcl | 9 | ||||
-rw-r--r-- | generic/ttk/ttkWidget.h | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/generic/ttk/ttkGenStubs.tcl b/generic/ttk/ttkGenStubs.tcl index 5e56951..034f405 100644 --- a/generic/ttk/ttkGenStubs.tcl +++ b/generic/ttk/ttkGenStubs.tcl @@ -290,14 +290,14 @@ proc genStubs::addPlatformGuard {plat iftxt {eltxt {}}} { set text "" switch $plat { win { - append text "#ifdef __WIN32__ /* WIN */\n${iftxt}" + append text "#ifdef _WIN32 /* WIN */\n${iftxt}" if {$eltxt ne ""} { append text "#else /* WIN */\n${eltxt}" } append text "#endif /* WIN */\n" } unix { - append text "#if !defined(__WIN32__) && !defined(MAC_OSX_TCL)\ + append text "#if !defined(_WIN32) && !defined(MAC_OSX_TCL)\ /* UNIX */\n${iftxt}" if {$eltxt ne ""} { append text "#else /* UNIX */\n${eltxt}" @@ -319,7 +319,7 @@ proc genStubs::addPlatformGuard {plat iftxt {eltxt {}}} { append text "#endif /* AQUA */\n" } x11 { - append text "#if !(defined(__WIN32__) || defined(MAC_OSX_TK))\ + append text "#if !(defined(_WIN32) || defined(MAC_OSX_TK))\ /* X11 */\n${iftxt}" if {$eltxt ne ""} { append text "#else /* X11 */\n${eltxt}" @@ -822,10 +822,9 @@ proc genStubs::emitInit {name textVar} { variable hooks variable interfaces variable epoch - variable revision upvar $textVar text - set root 1 + set capName [string toupper [string index $name 0]] append capName [string range $name 1 end] diff --git a/generic/ttk/ttkWidget.h b/generic/ttk/ttkWidget.h index 9e9ab69..e4dd712 100644 --- a/generic/ttk/ttkWidget.h +++ b/generic/ttk/ttkWidget.h @@ -260,7 +260,7 @@ MODULE_SCOPE int TtkGetLabelAnchorFromObj( * Platform-specific initialization. */ -#if defined(__WIN32__) +#ifdef _WIN32 #define Ttk_PlatformInit Ttk_WinPlatformInit MODULE_SCOPE int Ttk_PlatformInit(Tcl_Interp *); #elif defined(MAC_OSX_TK) |