Skip to content

Commit

Permalink
[Fix] Compiler detection in test script
Browse files Browse the repository at this point in the history
Clang also defines __GNUC__, so it would be incorrectly identified as GNU
before reaching the check for __clang__.
  • Loading branch information
SFrijters committed Apr 9, 2020
1 parent 2297d14 commit 4bd5aeb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions include/occa/scripts/tests/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ int main(int argc, char **argv) {
#elif defined(__ICC) || defined(__INTEL_COMPILER)
return OCCA_INTEL_VENDOR;

#elif defined(__GNUC__) || defined(__GNUG__)
return OCCA_GNU_VENDOR;

#elif defined(__HP_cc) || defined(__HP_aCC)
return OCCA_HP_VENDOR;

Expand All @@ -40,6 +37,10 @@ int main(int argc, char **argv) {
#elif defined(__clang__)
return OCCA_LLVM_VENDOR;

// Clang also defines __GNUC__, so check for it after __clang__
#elif defined(__GNUC__) || defined(__GNUG__)
return OCCA_GNU_VENDOR;

#else
return OCCA_NOT_FOUND
#endif
Expand Down

0 comments on commit 4bd5aeb

Please sign in to comment.