diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-11-26 11:59:09 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-11-26 11:59:09 (GMT) |
commit | b3e1ffc1797fa7eec61848d7a3f9d120afd0b0fe (patch) | |
tree | a98d04c818db0d7f5cc969973eebdf59c928961b /generic/tclEvent.c | |
parent | c65fe541cc2c408ec080a298a3eed3c752a5975c (diff) | |
parent | 21b68e66bfedb1b5ef1c935435804178dee4acc4 (diff) | |
download | tcl-b3e1ffc1797fa7eec61848d7a3f9d120afd0b0fe.zip tcl-b3e1ffc1797fa7eec61848d7a3f9d120afd0b0fe.tar.gz tcl-b3e1ffc1797fa7eec61848d7a3f9d120afd0b0fe.tar.bz2 |
TIP #599 implementation: Extended build information
Diffstat (limited to 'generic/tclEvent.c')
-rw-r--r-- | generic/tclEvent.c | 88 |
1 files changed, 86 insertions, 2 deletions
diff --git a/generic/tclEvent.c b/generic/tclEvent.c index cb2e529..22b6a77 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -14,6 +14,7 @@ */ #include "tclInt.h" +#include "tclUuid.h" /* * The data structure below is used to report background errors. One such @@ -1016,7 +1017,7 @@ Tcl_Exit( * down another. * * Results: - * None. + * The full Tcl version with build information. * * Side effects: * Varied, see the respective initialization routines. @@ -1024,7 +1025,89 @@ Tcl_Exit( *------------------------------------------------------------------------- */ -void +MODULE_SCOPE const TclStubs tclStubs; + +#ifndef STRINGIFY +# define STRINGIFY(x) STRINGIFY1(x) +# define STRINGIFY1(x) #x +#endif + +static const struct { + const TclStubs *stubs; + const char version[256]; +} stubInfo = { + &tclStubs, {TCL_PATCH_LEVEL "+" STRINGIFY(TCL_VERSION_UUID) +#if defined(__clang__) && defined(__clang_major__) + ".clang-" STRINGIFY(__clang_major__) +#if __clang_minor__ < 10 + "0" +#endif + STRINGIFY(__clang_minor__) +#endif +#ifdef TCL_COMPILE_DEBUG + ".compiledebug" +#endif +#ifdef TCL_COMPILE_STATS + ".compilestats" +#endif +#if defined(__cplusplus) && !defined(__OBJC__) + ".cplusplus" +#endif +#ifndef NDEBUG + ".debug" +#endif +#if !defined(__clang__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) + ".gcc-" STRINGIFY(__GNUC__) +#if __GNUC_MINOR__ < 10 + "0" +#endif + STRINGIFY(__GNUC_MINOR__) +#endif +#ifdef __INTEL_COMPILER + ".icc-" STRINGIFY(__INTEL_COMPILER) +#endif +#if (defined(_WIN32) && !defined(_WIN64)) || (ULONG_MAX == 0xffffffffUL) + ".ilp32" +#endif +#ifdef TCL_MEM_DEBUG + ".memdebug" +#endif +#if defined(_MSC_VER) + ".msvc-" STRINGIFY(_MSC_VER) +#endif +#ifdef USE_NMAKE + ".nmake" +#endif +#ifdef TCL_NO_DEPRECATED + ".no-deprecate" +#endif +#if !TCL_THREADS + ".no-thread" +#endif +#ifndef TCL_CFG_OPTIMIZED + ".no-optimize" +#endif +#ifdef __OBJC__ + ".objective-c" +#if defined(__cplusplus) + "plusplus" +#endif +#endif +#ifdef TCL_CFG_PROFILED + ".profile" +#endif +#ifdef PURIFY + ".purify" +#endif +#ifdef STATIC_BUILD + ".static" +#endif +#if TCL_UTF_MAX < 4 + ".utf-16" +#endif +}}; + +const char * Tcl_InitSubsystems(void) { if (inExit != 0) { @@ -1071,6 +1154,7 @@ Tcl_InitSubsystems(void) TclpInitUnlock(); } TclInitNotifier(); + return stubInfo.version; } /* |