Created
February 28, 2011 04:02
-
-
Save ELLIOTTCABLE/846919 to your computer and use it in GitHub Desktop.
Using LLVM/clang’s __has_attribute() macro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if !defined(__has_attribute) | |
# define has_no_has_attribute | |
# define __has_attribute(x) 0 | |
# endif //!defined(__has_attribute) | |
# if __has_attribute(constructor) | |
# define __constructor __attribute__((constructor)) | |
# endif //__has_attribute(constructor) | |
# if __has_attribute(packed) | |
# define __packed __attribute__((packed)) | |
# endif //__has_attribute(packed) | |
# if defined(has_no_has_attribute) | |
# undef has_no_has_attribute | |
# undef __has_attribute | |
# endif //!defined(__has_attribute) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment