> The thread_local macro is available in These compilers may or may not implement thread_local as macros, but technically, it is a C++ keyword, and we should not use ifdef(thread_local). I think #if __cplusplus >= 201103L would be a more robust option.
> Another option is adding a fallback for very old compilers that uses mutexes. Do we agree this would implement different functionality, with the potential of hard to debug sporadic effects depending on how the threads actually run? I think something like the following is more promising: #if __cplusplus >= 201103L || defined(thread_local) # define PODOFO_THREAD_LOCAL thread_local #else # ifdef _MSC_VER # define PODOFO_THREAD_LOCAL __declspec(thread) # elif defined(__GNUC__) # define PODOFO_THREAD_LOCAL __thread # else # error "Unknown old compiler, please add thread local support" # endif #endif Cheers, Christopher The MathWorks GmbH | Friedlandstr.18 | 52064 Aachen | District Court Aachen | HRB 8082 | Managing Directors: Bertrand Dissler, Steven D. Barbo, Jeanne O’Keefe
_______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users