diff options
author | David Robillard <d@drobilla.net> | 2014-07-28 22:17:27 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-07-28 22:17:27 +0000 |
commit | bf21fccffd50775217fbe3f417eb0216377f1942 (patch) | |
tree | ad5ec1c24c3c1c668f0aa77d968153a9d00c7390 /lv2 | |
parent | 91bd0c769fef6c62aa065f3ef22c3cb7d890c597 (diff) | |
download | lv2-bf21fccffd50775217fbe3f417eb0216377f1942.tar.xz |
Fixes for clang.
Diffstat (limited to 'lv2')
-rw-r--r-- | lv2/lv2plug.in/ns/ext/atom/forge.h | 52 |
1 files changed, 16 insertions, 36 deletions
diff --git a/lv2/lv2plug.in/ns/ext/atom/forge.h b/lv2/lv2plug.in/ns/ext/atom/forge.h index 8dfd9f2..ec54ef3 100644 --- a/lv2/lv2plug.in/ns/ext/atom/forge.h +++ b/lv2/lv2plug.in/ns/ext/atom/forge.h @@ -1,5 +1,5 @@ /* - Copyright 2008-2013 David Robillard <http://drobilla.net> + Copyright 2008-2014 David Robillard <http://drobilla.net> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -60,6 +60,15 @@ extern "C" { # include <stdbool.h> #endif +// Disable deprecation warnings for Blank and Resource +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wdeprecated-declarations" +#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + /** Handle for LV2_Atom_Forge_Sink. */ typedef void* LV2_Atom_Forge_Sink_Handle; @@ -127,10 +136,6 @@ lv2_atom_forge_set_buffer(LV2_Atom_Forge* forge, uint8_t* buf, size_t size); static inline void lv2_atom_forge_init(LV2_Atom_Forge* forge, LV2_URID_Map* map) { -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif lv2_atom_forge_set_buffer(forge, NULL, 0); forge->Blank = map->map(map->handle, LV2_ATOM__Blank); forge->Bool = map->map(map->handle, LV2_ATOM__Bool); @@ -150,9 +155,6 @@ lv2_atom_forge_init(LV2_Atom_Forge* forge, LV2_URID_Map* map) forge->URI = map->map(map->handle, LV2_ATOM__URI); forge->URID = map->map(map->handle, LV2_ATOM__URID); forge->Vector = map->map(map->handle, LV2_ATOM__Vector); -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) -# pragma GCC diagnostic pop -#endif } static inline LV2_Atom* @@ -207,16 +209,9 @@ lv2_atom_forge_top_is(LV2_Atom_Forge* forge, uint32_t type) static inline bool lv2_atom_forge_is_object_type(const LV2_Atom_Forge* forge, uint32_t type) { -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif return (type == forge->Object || type == forge->Blank || type == forge->Resource); -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) -# pragma GCC diagnostic pop -#endif } /** Return true iff @p type is an atom:Object with a blank ID. */ @@ -225,15 +220,8 @@ lv2_atom_forge_is_blank(const LV2_Atom_Forge* forge, uint32_t type, const LV2_Atom_Object_Body* body) { -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif return (type == forge->Blank || (type == forge->Object && body->id == 0)); -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) -# pragma GCC diagnostic pop -#endif } /** @@ -602,19 +590,12 @@ lv2_atom_forge_resource(LV2_Atom_Forge* forge, LV2_URID id, LV2_URID otype) { -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif const LV2_Atom_Object a = { { (uint32_t)sizeof(LV2_Atom_Object_Body), forge->Resource }, { id, otype } }; return lv2_atom_forge_push( forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a))); -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) -# pragma GCC diagnostic pop -#endif } /** @@ -630,19 +611,12 @@ lv2_atom_forge_blank(LV2_Atom_Forge* forge, uint32_t id, LV2_URID otype) { -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif const LV2_Atom_Object a = { { (uint32_t)sizeof(LV2_Atom_Object_Body), forge->Blank }, { id, otype } }; return lv2_atom_forge_push( forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a))); -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) -# pragma GCC diagnostic pop -#endif } /** @@ -715,6 +689,12 @@ lv2_atom_forge_beat_time(LV2_Atom_Forge* forge, double beats) @} */ +#if defined(__clang__) +# pragma clang diagnostic pop +#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +# pragma GCC diagnostic pop +#endif + #ifdef __cplusplus } /* extern "C" */ #endif |