From bf21fccffd50775217fbe3f417eb0216377f1942 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 28 Jul 2014 22:17:27 +0000 Subject: Fixes for clang. --- lv2/lv2plug.in/ns/ext/atom/forge.h | 52 ++++++++++++-------------------------- 1 file changed, 16 insertions(+), 36 deletions(-) (limited to 'lv2/lv2plug.in/ns') 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 + Copyright 2008-2014 David Robillard 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 #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 -- cgit v1.2.1