Tk Source Code

View Ticket
Login
2023-11-10
13:23
Add comment: /* Pert-Tk expects None and ControlMask to be a macro see ticket [593eb0227c] */ check-in: f3ed46c0 user: oehhar tags: core-8-6-branch
13:11 Ticket [593eb022] X.h: define ControlMask and None as macros, even on Win32 status still Closed with 4 other changes artifact: 04caa4ba user: jan.nijtmans
13:08 Closed ticket [593eb022]. artifact: 9bef610d user: jan.nijtmans
12:37 Ticket [593eb022]: 4 changes artifact: 1ac0bf63 user: oehhar
12:20
Fix [593eb0227c]: X.h: define ControlMask and None as macros, even on Win32 check-in: bc8c792f user: jan.nijtmans tags: core-8-6-branch
2023-11-06
01:53 Ticket [9e31fd94] X11/X.h and Windows.h have conflicting symbols status still Closed with 4 other changes artifact: dffd5cf8 user: chrstphrchvz
01:47 New ticket [593eb022] X.h: define ControlMask and None as macros, even on Win32. artifact: cc843981 user: chrstphrchvz

Ticket UUID: 593eb0227cfa97adb9c7485dcc59a6e0bab93ded
Title: X.h: define ControlMask and None as macros, even on Win32
Type: Patch Version: 8.6.10
Submitter: chrstphrchvz Created on: 2023-11-06 01:47:56
Subsystem: 85. Win Build Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2023-11-10 13:11:35
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2023-11-10 13:11:35
Description:

I proposed backporting the fix for [9e31fd9449] to Perl/Tk: https://github.com/eserte/perl-tk/pull/89

But Perl/Tk still contains some code which expects ControlMask and None to be defined as macros, so others have proposed this additional change:

--- xlib/X11/X.h.orig
+++ xlib/X11/X.h
@@ -75,6 +75,8 @@ typedef unsigned long KeyCode;	/* In order to use IME, the Macintosh needs
 
 #ifndef _WIN32
 #   define None              0L      /* See bug [9e31fd9449] and below */
+#else
+#   define None              None    /* uses the enum below */
 #endif
 
 #define ParentRelative       1L	/* background pixmap in CreateWindow
@@ -183,6 +185,8 @@ are reserved in the protocol for errors and replies. */
 #define LockMask		(1<<1)
 #ifndef _WIN32
 #   define ControlMask		(1<<2) /* See bug [9e31fd9449] and below */
+#else
+#   define ControlMask          ControlMask /* uses the enum below */
 #endif
 #define Mod1Mask		(1<<3)
 #define Mod2Mask		(1<<4)

Does Tcl/Tk also find this approach preferable?

User Comments: jan.nijtmans added on 2023-11-10 13:11:35:

> Should I add this comment ?

Sure, go ahead! (I only saw your comment after merging it up to Tk 8.7)


jan.nijtmans added on 2023-11-10 13:08:55:

Fixed [bc8c792fe4d50902|here], as suggested.

Thanks!


oehhar added on 2023-11-10 12:37:35:

Jan, I think it would be great to have a big comment above the introduced lines by [bc8c792f] why this obvious non-functioning is there.

Maybe something like:

/* Pert-Tk expects None and ControlMask to be a macro see ticket [593eb0227c] */

Should I add this comment ?

Thank you, Harald