Skip to content

Commit

Permalink
Guard __has_attribute for compilers that don't support it (#1129)
Browse files Browse the repository at this point in the history
* Guard `__has_attribute` for compilers that don't support it

Signed-off-by: Larry Gritz <lg@larrygritz.com>

* Revision

Signed-off-by: Larry Gritz <lg@larrygritz.com>
  • Loading branch information
lgritz authored Aug 18, 2021
1 parent 0cafc43 commit 957e7c6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmake/OpenEXRConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@
(uint32_t(OPENEXR_VERSION_MINOR) << 16) | \
(uint32_t(OPENEXR_VERSION_PATCH) << 8))


// On modern versions of gcc & clang, __has_attribute can test support for
// __attribute__((attr)). Make sure it's safe for other compilers.
#ifndef __has_attribute
# define __has_attribute(x) 0
#endif


// Whether the user configured the library to have symbol visibility
// tagged
#cmakedefine OPENEXR_ENABLE_API_VISIBILITY
Expand Down

0 comments on commit 957e7c6

Please sign in to comment.