summaryrefslogtreecommitdiffstats
path: root/include/plist/plist.h
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2014-05-20 17:47:13 +0200
committerGravatar Martin Szulecki2014-05-20 17:47:13 +0200
commitc51d1a77b04872020234af49384a4ebd22ddd5f0 (patch)
tree3af09391acc730f630c5df8705c4eafca7cd70df /include/plist/plist.h
parent993f65b3bda53e2b22ee9e94efd11cbddd7b73cb (diff)
downloadlibplist-c51d1a77b04872020234af49384a4ebd22ddd5f0.tar.gz
libplist-c51d1a77b04872020234af49384a4ebd22ddd5f0.tar.bz2
Redo PLIST_WARN_DEPRECATED macro to work with older llvm/clang
Diffstat (limited to 'include/plist/plist.h')
-rw-r--r--include/plist/plist.h40
1 files changed, 31 insertions, 9 deletions
diff --git a/include/plist/plist.h b/include/plist/plist.h
index b855043..f7df832 100644
--- a/include/plist/plist.h
+++ b/include/plist/plist.h
@@ -40,21 +40,43 @@ extern "C"
40 typedef unsigned __int64 uint64_t; 40 typedef unsigned __int64 uint64_t;
41 41
42#ifdef plist_EXPORTS 42#ifdef plist_EXPORTS
43#define PLIST_API __declspec( dllexport ) 43 #define PLIST_API __declspec( dllexport )
44#else 44#else
45#define PLIST_API __declspec( dllimport ) 45 #define PLIST_API __declspec( dllimport )
46#endif 46#endif
47#define DEPRECATED(x) __declspec(deprecated(x)) 47
48#else 48#else
49#include <stdint.h> 49#include <stdint.h>
50#define PLIST_API 50#define PLIST_API
51#ifdef __GNUC__ 51#endif
52#define DEPRECATED(x) __attribute__((deprecated(x))) 52
53#ifdef __llvm__
54 #if defined(__has_extension)
55 #if (__has_extension(attribute_deprecated_with_message))
56 #ifndef PLIST_WARN_DEPRECATED
57 #define PLIST_WARN_DEPRECATED(x) __attribute__((deprecated(x)))
58 #endif
59 #else
60 #ifndef PLIST_WARN_DEPRECATED
61 #define PLIST_WARN_DEPRECATED(x) __attribute__((deprecated))
62 #endif
63 #endif
64 #else
65 #ifndef PLIST_WARN_DEPRECATED
66 #define PLIST_WARN_DEPRECATED(x) __attribute__((deprecated))
67 #endif
68 #endif
69#elif (__GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 5)))
70 #ifndef PLIST_WARN_DEPRECATED
71 #define PLIST_WARN_DEPRECATED(x) __attribute__((deprecated(x)))
72 #endif
53#elif defined(_MSC_VER) 73#elif defined(_MSC_VER)
74 #ifndef PLIST_WARN_DEPRECATED
75 #define PLIST_WARN_DEPRECATED(x) __declspec(deprecated(x))
76 #endif
54#else 77#else
55#define DEPRECATED(x) 78 #define PLIST_WARN_DEPRECATED(x)
56#pragma message("WARNING: You need to implement DEPRECATED for this compiler") 79 #pragma message("WARNING: You need to implement DEPRECATED for this compiler")
57#endif
58#endif 80#endif
59 81
60#include <sys/types.h> 82#include <sys/types.h>
@@ -339,7 +361,7 @@ extern "C"
339 * @param item the new item to insert 361 * @param item the new item to insert
340 * @param key The identifier of the item to insert. 362 * @param key The identifier of the item to insert.
341 */ 363 */
342 DEPRECATED("use plist_dict_set_item instead") PLIST_API void plist_dict_insert_item(plist_t node, const char* key, plist_t item); 364 PLIST_WARN_DEPRECATED("use plist_dict_set_item instead") PLIST_API void plist_dict_insert_item(plist_t node, const char* key, plist_t item);
343 365
344 /** 366 /**
345 * Remove an existing position in a #PLIST_DICT node. 367 * Remove an existing position in a #PLIST_DICT node.