1 /*
2   Copyright 2018 David Robillard <http://drobilla.net>
3 
4   Permission to use, copy, modify, and/or distribute this software for any
5   purpose with or without fee is hereby granted, provided that the above
6   copyright notice and this permission notice appear in all copies.
7 
8   THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9   WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10   MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11   ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16 
17 #ifndef LV2_CORE_ATTRIBUTES_H
18 #define LV2_CORE_ATTRIBUTES_H
19 
20 /**
21    @defgroup attributes Attributes
22 
23    Macros for source code attributes.
24 
25    @{
26 */
27 
28 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
29 #define LV2_DEPRECATED __attribute__((__deprecated__))
30 #else
31 #define LV2_DEPRECATED
32 #endif
33 
34 #if defined(__clang__)
35 #define LV2_DISABLE_DEPRECATION_WARNINGS \
36 	_Pragma("clang diagnostic push") \
37 	_Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
38 #elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
39 #define LV2_DISABLE_DEPRECATION_WARNINGS \
40 	_Pragma("GCC diagnostic push") \
41 	_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
42 #else
43 #define LV2_DISABLE_DEPRECATION_WARNINGS
44 #endif
45 
46 #if defined(__clang__)
47 #define LV2_RESTORE_WARNINGS _Pragma("clang diagnostic pop")
48 #elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
49 #define LV2_RESTORE_WARNINGS _Pragma("GCC diagnostic pop")
50 #else
51 #define LV2_RESTORE_WARNINGS
52 #endif
53 
54 /**
55    @}
56 */
57 
58 #endif /* LV2_CORE_ATTRIBUTES_H */
59