diff options
| author | dkf <donal.k.fellows@manchester.ac.uk> | 2021-03-21 13:07:15 (GMT) |
|---|---|---|
| committer | dkf <donal.k.fellows@manchester.ac.uk> | 2021-03-21 13:07:15 (GMT) |
| commit | c49b98fa6b7afdb6f63c4abca16d73c56990b715 (patch) | |
| tree | 9574b65541cfeafbb15d115348443777af5de242 /generic/tclInt.h | |
| parent | 4e90ccc6db032c546939cdcdfa33fcecd7122dce (diff) | |
| download | tcl-c49b98fa6b7afdb6f63c4abca16d73c56990b715.zip tcl-c49b98fa6b7afdb6f63c4abca16d73c56990b715.tar.gz tcl-c49b98fa6b7afdb6f63c4abca16d73c56990b715.tar.bz2 | |
Start of doing a clean up of the notifier code.
This originated as trying to stop macOS builds from doing silly warnings during
a static build, but I noticed that there were common patterns that belong in
generic code instead of being repeated in each of the platform-specific pieces.
Diffstat (limited to 'generic/tclInt.h')
| -rw-r--r-- | generic/tclInt.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index 1d192ff..4c3977a 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -5145,11 +5145,33 @@ typedef struct NRE_callback { #endif /* + * Special hack for macOS, where the static linker (technically the 'ar' + * command) hates empty object files, and accepts no flags to make it shut up. + * + * These symbols are otherwise completely useless. + * + * They can't be written to or written through. They can't be seen by any + * other code. They use a separate attribute (supported by all macOS + * compilers, which are derivatives of clang or gcc) to stop the compilation + * from moaning. They will be excluded during the final linking stage. + * + * Other platforms get nothing at all. That's good. + */ + +#ifdef MAC_OSX_TCL +#define TCL_MAC_EMPTY_FILE(name) \ + static __attribute__((used)) const void *const TclUnusedFile_ ## name; \ + static const void *const TclUnusedFile_ ## name = NULL; +#else +#define TCL_MAC_EMPTY_FILE(name) +#endif /* MAC_OSX_TCL */ + +/* * Other externals. */ -MODULE_SCOPE size_t TclEnvEpoch; /* Epoch of the tcl environment - * (if changed with tcl-env). */ +MODULE_SCOPE size_t TclEnvEpoch; /* Epoch of the tcl environment + * (if changed with tcl-env). */ #endif /* _TCLINT */ |
