• Ben Hamilton's avatar
    Fix test/SynchronizedTest.cpp build break on Clang on OS X · 70497e41
    Ben Hamilton authored
    Summary:
    The Folly `make check` build is broken with Clang on OS X.
    
    This diff fixes the following break in `test/SynchronizedTest.cpp`:
    
      SynchronizedTest.cpp:150:10: error: thread-local storage is not supported for the current target
        static thread_local int lockCount_;
    
    The problem is clang on OS X doesn't support the `thread_local` extension:
    
    http://stackoverflow.com/a/29929949
    
    so we now use the `FOLLY_TLS` compatibility macro.
    
    When I fixed this, I found the test also failed to compile if `FOLLY_SYNCHRONIZED_HAVE_TIMED_MUTEXES` was `#define`d to `0` (as it is on OS X), so I fixed that.
    
    Reviewed By: mzlee
    
    Differential Revision: D3361215
    
    fbshipit-source-id: e93be6872bcab03090448b9421e502e472f149ff
    70497e41
SynchronizedTest.cpp 6.85 KB