blob: 3c55676c0f0ba53eac30399f8d27a560b423d073 [file] [log] [blame]
Guilherme Polo3a409e92009-02-10 02:20:49 +00001#ifndef TKINTER_H
2#define TKINTER_H
3
4/* This header is used to share some macros between _tkinter.c and
Guilherme Polo2d87e422009-04-10 22:19:09 +00005 * tkappinit.c.
6 * Be sure to include tk.h before including this header so
Serhiy Storchaka3af7a382015-04-22 10:53:08 +03007 * TK_HEX_VERSION is properly defined. */
Guilherme Polo3a409e92009-02-10 02:20:49 +00008
9/* TK_RELEASE_LEVEL is always one of the following:
Serhiy Storchaka3af7a382015-04-22 10:53:08 +030010 * TCL_ALPHA_RELEASE 0
Guilherme Polo3a409e92009-02-10 02:20:49 +000011 * TCL_BETA_RELEASE 1
12 * TCL_FINAL_RELEASE 2
13 */
Serhiy Storchaka3af7a382015-04-22 10:53:08 +030014#define TK_HEX_VERSION ((TK_MAJOR_VERSION << 24) | \
15 (TK_MINOR_VERSION << 16) | \
16 (TK_RELEASE_LEVEL << 8) | \
17 (TK_RELEASE_SERIAL << 0))
18
19/* TK_VERSION_HEX packs fields in wrong order, not suitable for comparing of
20 * non-final releases. Left for backward compatibility.
21 */
Guilherme Polo3a409e92009-02-10 02:20:49 +000022#define TK_VERSION_HEX ((TK_MAJOR_VERSION << 24) | \
Serhiy Storchaka3af7a382015-04-22 10:53:08 +030023 (TK_MINOR_VERSION << 16) | \
24 (TK_RELEASE_SERIAL << 8) | \
25 (TK_RELEASE_LEVEL << 0))
Guilherme Polo3a409e92009-02-10 02:20:49 +000026
27/* Protect Tk 8.4.13 and older from a deadlock that happens when trying
28 * to load tk after a failed attempt. */
Serhiy Storchaka3af7a382015-04-22 10:53:08 +030029#if TK_HEX_VERSION < 0x0804020e
Guilherme Polo3a409e92009-02-10 02:20:49 +000030#define TKINTER_PROTECT_LOADTK
31#define TKINTER_LOADTK_ERRMSG \
Serhiy Storchaka3af7a382015-04-22 10:53:08 +030032 "Calling Tk_Init again after a previous call failed might deadlock"
Guilherme Polo3a409e92009-02-10 02:20:49 +000033#endif
34
35#endif /* !TKINTER_H */