diff options
Diffstat (limited to 'include/plist')
| -rw-r--r-- | include/plist/Dictionary.h | 2 | ||||
| -rw-r--r-- | include/plist/plist.h | 40 |
2 files changed, 32 insertions, 10 deletions
diff --git a/include/plist/Dictionary.h b/include/plist/Dictionary.h index eee14af..6ad505d 100644 --- a/include/plist/Dictionary.h +++ b/include/plist/Dictionary.h | |||
| @@ -47,7 +47,7 @@ public : | |||
| 47 | iterator End(); | 47 | iterator End(); |
| 48 | iterator Find(const std::string& key); | 48 | iterator Find(const std::string& key); |
| 49 | iterator Set(const std::string& key, Node* node); | 49 | iterator Set(const std::string& key, Node* node); |
| 50 | DEPRECATED("use Set() instead") iterator Insert(const std::string& key, Node* node); | 50 | PLIST_WARN_DEPRECATED("use Set() instead") iterator Insert(const std::string& key, Node* node); |
| 51 | void Remove(Node* node); | 51 | void Remove(Node* node); |
| 52 | void Remove(const std::string& key); | 52 | void Remove(const std::string& key); |
| 53 | std::string GetNodeKey(Node* key); | 53 | std::string GetNodeKey(Node* key); |
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. |
