diff options
author | Jack Lloyd <[email protected]> | 2020-11-28 06:44:41 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2020-11-28 07:13:30 -0500 |
commit | b00cd7cea9233b782697f645a5aa54fd59ecacd9 (patch) | |
tree | 69f9bcd00ab22a85c78f06efed7766d32bd265b1 | |
parent | a7310e2452e034e443b56a104678c3b04e162dad (diff) |
Avoid using C++ attribute for ffi.h
-rw-r--r-- | src/lib/utils/compiler.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/utils/compiler.h b/src/lib/utils/compiler.h index 88ab00603..f3b2cb51c 100644 --- a/src/lib/utils/compiler.h +++ b/src/lib/utils/compiler.h @@ -78,16 +78,20 @@ */ #if !defined(BOTAN_NO_DEPRECATED_WARNINGS) && !defined(BOTAN_IS_BEING_BUILT) && !defined(BOTAN_AMALGAMATION_H_) - #define BOTAN_DEPRECATED(msg) [[deprecated(msg)]] + #if defined(__cplusplus) + #define BOTAN_DEPRECATED(msg) [[deprecated(msg)]] + #elif defined(__clang__) || defined(__GNUC__) + #define BOTAN_DEPRECATED(msg) __attribute__ ((deprecated(msg))) + #elif defined(_MSC_VER) + #define BOTAN_DEPRECATED(msg) __declspec(deprecated(msg)) + #endif #if defined(__clang__) #define BOTAN_DEPRECATED_HEADER(hdr) _Pragma("message \"this header is deprecated\"") #define BOTAN_FUTURE_INTERNAL_HEADER(hdr) _Pragma("message \"this header will be made internal in the future\"") - #elif defined(_MSC_VER) #define BOTAN_DEPRECATED_HEADER(hdr) __pragma(message("this header is deprecated")) #define BOTAN_FUTURE_INTERNAL_HEADER(hdr) __pragma(message("this header will be made internal in the future")) - #elif defined(__GNUC__) #define BOTAN_DEPRECATED_HEADER(hdr) _Pragma("GCC warning \"this header is deprecated\"") #define BOTAN_FUTURE_INTERNAL_HEADER(hdr) _Pragma("GCC warning \"this header will be made internal in the future\"") |