rjhogan / Adept-2

Combined array and automatic differentiation library in C++
http://www.met.reading.ac.uk/clouds/adept/
Apache License 2.0
163 stars 29 forks source link

Fix warning about ADEPT_THREAD_LOCAL being redefined in Xcode 13.2.1 #21

Closed yairchu closed 2 years ago

yairchu commented 2 years ago

I get the following warning when building in Xcode 13.2.1:

Screen Shot 2022-02-15 at 15 10 01

The change avoids redefining and undefining macros with an #else clause.

rjhogan commented 2 years ago

Thanks! However, this won't compile if __has_feature is not available because the preprocessor evaluates both sides of the && regardless of the result of the first test (unlike in the C language). Could you please use a nested #if/#ifdef like in my original code?

yairchu commented 2 years ago

Oh, good to know! So that explains why it was this way. So I'll do an #ifndef ADEPT_THREAD_LOCAL after the nested condition to avoid the two else clauses.

yairchu commented 2 years ago

Fixed

rjhogan commented 2 years ago

Thanks!