Skip to content

Commit

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

* 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 and cary-ilm committed Sep 2, 2021
1 parent 0e32af6 commit 855415f
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 855415f

Please sign in to comment.