summaryrefslogtreecommitdiffstats
path: root/generic/ttk
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2014-02-10 11:06:19 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2014-02-10 11:06:19 (GMT)
commitd015e4d8b48ad76acce178827f3ab114c330308c (patch)
tree75ae24370f3056d16427e5a17c5a9aaf6e1351e6 /generic/ttk
parent3655db8b8d9c31f3253d97a9ea250b07641c24d9 (diff)
downloadtk-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/ttk')
-rw-r--r--generic/ttk/ttkGenStubs.tcl9
-rw-r--r--generic/ttk/ttkWidget.h2
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)