From b68e469c6fcec04a86935ae2e8853197213f40db Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 26 Dec 2018 14:55:18 +0000 Subject: Change None/ControlMask on win32 (and MacOSX - which is harmless) to being an enum. This fixes (hopefully) the ***POTENTIAL INCOMPATABILITY*** in previous commit --- generic/tkBind.c | 2 +- generic/tkRectOval.c | 2 +- win/tkWinInt.h | 5 ----- xlib/X11/X.h | 11 +++++------ 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/generic/tkBind.c b/generic/tkBind.c index 476aed0..df82323 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -631,7 +631,7 @@ static const TkStateMap visNotify[] = { }; static const TkStateMap configureRequestDetail[] = { - {0, "None"}, + {0, "None"}, {Above, "Above"}, {Below, "Below"}, {BottomIf, "BottomIf"}, diff --git a/generic/tkRectOval.c b/generic/tkRectOval.c index 6ed4488..af94c6f 100644 --- a/generic/tkRectOval.c +++ b/generic/tkRectOval.c @@ -522,7 +522,7 @@ ConfigureRectOval( * Mac OS X CG drawing needs access to the outline linewidth * even for fills (as linewidth controls antialiasing). */ - gcValues.line_width = rectOvalPtr->outline.gc != None ? + gcValues.line_width = rectOvalPtr->outline.gc ? rectOvalPtr->outline.gc->line_width : 0; mask |= GCLineWidth; #endif diff --git a/win/tkWinInt.h b/win/tkWinInt.h index b6f7a98..abac7b0 100644 --- a/win/tkWinInt.h +++ b/win/tkWinInt.h @@ -41,11 +41,6 @@ #define SPI_SETKEYBOARDCUES 0x100B #endif -#if defined(_WIN32) && !defined(ControlMask) /* prevent conflicting define against windows.h, bug [9e31fd9449] */ -# define ControlMask (1<<2) -#endif - - /* * The TkWinDCState is used to save the state of a device context so that it * can be restored later. diff --git a/xlib/X11/X.h b/xlib/X11/X.h index ad8f630..316683b 100644 --- a/xlib/X11/X.h +++ b/xlib/X11/X.h @@ -73,9 +73,7 @@ typedef unsigned long KeyCode; /* In order to use IME, the Macintosh needs * RESERVED RESOURCE AND CONSTANT DEFINITIONS *****************************************************************/ -#ifndef _WIN32 /* prevent conflicting define against windows.h, bug [9e31fd9449] */ -# define None 0L /* universal null resource or null atom */ -#endif +/* define None 0L See bug [9e31fd9449] and below */ #define ParentRelative 1L /* background pixmap in CreateWindow and ChangeWindowAttributes */ @@ -181,15 +179,16 @@ are reserved in the protocol for errors and replies. */ #define ShiftMask (1<<0) #define LockMask (1<<1) -#ifndef _WIN32 /* prevent conflicting define against windows.h, bug [9e31fd9449] */ -# define ControlMask (1<<2) -#endif +/* define ControlMask (1<<2) See bug [9e31fd9449] and below */ #define Mod1Mask (1<<3) #define Mod2Mask (1<<4) #define Mod3Mask (1<<5) #define Mod4Mask (1<<6) #define Mod5Mask (1<<7) +/* See bug [9e31fd9449], this way prevents conflicts with Win32 headers */ +enum _Bug9e31fd9449 { None = 0, ControlMask = (1<<2) }; + /* modifier names. Used to build a SetModifierMapping request or to read a GetModifierMapping request. These correspond to the masks defined above. */ -- cgit v0.12