Tk Source Code

Check-in [64dace1d]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Define offsetof() macro for (very rare) platforms which don't have it. Don't punish developers for using offsetof() in extensions, forgetting that ...
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-6-branch
Files: files | file ages | folders
SHA3-256: 64dace1d9f7dbf9289aa9eb41f04f6eed21599fcb727b9901029bcc09aeca4c4
User & Date: jan.nijtmans 2019-06-15 20:42:53
Context
2019-06-16
02:28
Fix merge conflict in tk.tcl from services branch merge check-in: f656afba user: kevin_walzer tags: core-8-6-branch
2019-06-15
20:44
merge-mark check-in: b0020c33 user: jan.nijtmans tags: trunk
20:42
Define offsetof() macro for (very rare) platforms which don't have it. Don't punish developers for using offsetof() in extensions, forgetting that ... check-in: 64dace1d user: jan.nijtmans tags: core-8-6-branch
20:41
Define offsetof() macro for (very rare) platforms which don't have it. Don't punish developers for using offsetof() in extensions, forgetting that ... check-in: ea8b4d11 user: jan.nijtmans tags: core-8-5-branch
20:02
TIP 536: Improvements to Mac-specific IPC check-in: ded88b70 user: dkf tags: core-8-6-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tk.h.

262
263
264
265
266
267
268
269
270

271
272
273
274
275
276
277
278
279
} Tk_ObjCustomOption;

/*
 * Macro to use to fill in "offset" fields of the Tk_OptionSpec structure.
 * Computes number of bytes from beginning of structure to a given field.
 */

#ifdef offsetof
#define Tk_Offset(type, field) ((int) offsetof(type, field))

#else
#define Tk_Offset(type, field) ((int) ((char *) &((type *) 0)->field))
#endif

/*
 * The following two structures are used for error handling. When config
 * options are being modified, the old values are saved in a Tk_SavedOptions
 * structure. If an error occurs, then the contents of the structure can be
 * used to restore all of the old values. The contents of this structure are






<

>
|
|







262
263
264
265
266
267
268

269
270
271
272
273
274
275
276
277
278
279
} Tk_ObjCustomOption;

/*
 * Macro to use to fill in "offset" fields of the Tk_OptionSpec structure.
 * Computes number of bytes from beginning of structure to a given field.
 */


#define Tk_Offset(type, field) ((int) offsetof(type, field))
/* Workaround for platforms missing offsetof(), e.g. VC++ 6.0 */
#ifndef offsetof
#   define offsetof(type, field) ((size_t) ((char *) &((type *) 0)->field))
#endif

/*
 * The following two structures are used for error handling. When config
 * options are being modified, the old values are saved in a Tk_SavedOptions
 * structure. If an error occurs, then the contents of the structure can be
 * used to restore all of the old values. The contents of this structure are