Tk Source Code

View Ticket
Login
Ticket UUID: 3541305
Title: Xfree/Xsync... shoulc not be macros
Type: Bug Version: obsolete: 8.5.11
Submitter: jan.nijtmans Created on: 2012-07-08 04:26:31
Subsystem: 85. Win Build Assigned To: jan.nijtmans
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2014-03-13 09:19:14
Resolution: Fixed Closed By: nijtmans
    Closed on: 2012-07-08 04:34:44
Description:
In order to allow win32 extensions that use
Xfree/Xsync ... to run under Cygwin as well
(See presentation Eurotcl 2012), they
should not be macro's but functions.

In Tk 8.6 that's already done, but in 8.4/8.5
it's possible to do the same thing, only the
macro should detect whether the related
stub functions are available or not.
(Tk8.5.12+ has it, but not earlier versions)

The stub entry tkIntStubsPtr->tkBindDeadWindow
can be used for that. If it's NULL, then
the stub functions are available (This
stub entry is purposely removed on Cygwin
8.4/8.5, and completely in 8.6, just because
it serves no purpose)

Solution:
#ifdef USE_TK_STUBS
#define XFree(data) (tkIntStubsPtr->tkBindDeadWindow? ((data)? (ckfree((char *) (data)), 0): 0): tkIntXlibStubsPtr->xFree(data))
#else
.... original definition
#elseif
User Comments: nijtmans added on 2012-07-08 11:34:44:

allow_comments - 1

nijtmans added on 2012-07-08 11:34:43:
Fixed in core-8-4-branch and core-8-5-branch. On trunk, those
where functions already, so nothing to be done there.