libSplash
splashMacros.hpp
1 
23 #ifndef SPLASH_MACROS_HPP
24 #define SPLASH_MACROS_HPP
25 
27 
28 // Mark a function as deprecated: `SPLASH_DEPRECATED("Use bar instead") void foo();`
29 #ifdef __clang__
30 # define SPLASH_DEPRECATED(msg) __attribute__((deprecated(msg)))
31 #elif defined(__GNUC__)
32 # define SPLASH_DEPRECATED(msg) __attribute__((deprecated))
33 #elif defined(_MSC_VER)
34 # define SPLASH_DEPRECATED(msg) __declspec(deprecated)
35 #else
36 # define SPLASH_DEPRECATED(msg)
37 #endif
38 
39 // Suppress a "unused variable" warning: `SPLASH_UNUSED static int i = 42;`
40 #ifdef __clang__
41 # define SPLASH_UNUSED __attribute__((unused))
42 #elif defined(__GNUC__)
43 # define SPLASH_UNUSED __attribute__((unused))
44 #elif defined(_MSC_VER)
45 # define SPLASH_UNUSED
46 #elif defined(__xlc__)
47 # define SPLASH_UNUSED __attribute__((unused))
48 #elif defined(__INTEL_COMPILER)
49 # define SPLASH_UNUSED
50 #elif defined(__PGI)
51 # define SPLASH_UNUSED
52 #else
53 # define SPLASH_UNUSED
54 #endif
55 
56 #endif /* SPLASH_MACROS_HPP */