diff --git a/include/wx/chartype.h b/include/wx/chartype.h index ad8e4bffda..f75fc2805f 100644 --- a/include/wx/chartype.h +++ b/include/wx/chartype.h @@ -241,17 +241,28 @@ /* a helper macro allowing to make another macro Unicode-friendly, see below */ #define wxAPPLY_T(x) wxT(x) -/* Unicode-friendly __FILE__, __DATE__ and __TIME__ analogs */ +/* + Unicode-friendly analogs of the standard __FILE__, DATE and TIME macros. + + These macros exist only for backwards compatibility, there should be no + reason to use them in the new code, just use the standard macros instead. + + Also note that we must not use the actual macro names for the two latter + ones, as doing this would prevent ccache from caching the results of + compiling any file including this header by default, rendering ccache + ineffective for wxWidgets programs. Hence the use of "##" below and avoiding + naming these macros in this comment. + */ #ifndef __TFILE__ #define __TFILE__ wxAPPLY_T(__FILE__) #endif #ifndef __TDATE__ - #define __TDATE__ wxAPPLY_T(__DATE__) + #define __TDATE__ wxAPPLY_T(__ ## DATE__) #endif #ifndef __TTIME__ - #define __TTIME__ wxAPPLY_T(__TIME__) + #define __TTIME__ wxAPPLY_T(__ ## TIME__) #endif #endif /* _WX_WXCHARTYPE_H_ */ diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 5c950471b1..4294dbb115 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -1405,6 +1405,12 @@ wxVersionInfo wxGetLibraryVersionInfo() #endif wxDEBUG_LEVEL, #if !wxUSE_REPRODUCIBLE_BUILD + // As explained in the comment near these macros definitions, + // ccache has special logic for detecting the use of __DATE__ + // and __TIME__ macros, which doesn't apply to our own versions + // of them, hence this comment is needed just to mention the + // standard macro names and to ensure that ccache does _not_ + // cache the results of compiling this file. __TDATE__, __TTIME__, #endif