Skip to content

Commit

Permalink
Fix for conflicting symbols in X.h and Windows.h
Browse files Browse the repository at this point in the history
Backported from Tcl/Tk 8.6.10:
see https://core.tcl-lang.org/tk/info/9e31fd944934

Fixes eserte#87
  • Loading branch information
jan.nijtmans authored and chrstphrchvz committed Oct 25, 2022
1 parent eda50cc commit 0cc1fd7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pTk/mTk/xlib/X11/X.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ typedef unsigned long KeyCode; /* In order to use IME, the Macintosh needs
* RESERVED RESOURCE AND CONSTANT DEFINITIONS
*****************************************************************/

#define None 0L /* universal null resource or null atom */
#ifndef _WIN32
# define None 0L /* See bug [9e31fd9449] and below */
#endif

#define ParentRelative 1L /* background pixmap in CreateWindow
and ChangeWindowAttributes */
Expand Down Expand Up @@ -179,13 +181,20 @@ are reserved in the protocol for errors and replies. */

#define ShiftMask (1<<0)
#define LockMask (1<<1)
#define ControlMask (1<<2)
#ifndef _WIN32
# define ControlMask (1<<2) /* See bug [9e31fd9449] and below */
#endif
#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 */
#ifdef _WIN32
enum _Bug9e31fd9449 { None = 0, ControlMask = (1<<2) };
#endif

/* modifier names. Used to build a SetModifierMapping request or
to read a GetModifierMapping request. These correspond to the
masks defined above. */
Expand Down

2 comments on commit 0cc1fd7

@GeVanCo
Copy link

@GeVanCo GeVanCo commented on 0cc1fd7 Dec 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea as to why your changes are not in the official Tk package yet? When I install the package in Perl (cpan install Tk) I'm getting version Tk-804.036 and I'm still getting this error. Applying your changes makes it at least compile.

@chrstphrchvz
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see eserte#89 for updates.

Please sign in to comment.