diff --git a/spirv_common.hpp b/spirv_common.hpp index 76f25640..488ae9a2 100644 --- a/spirv_common.hpp +++ b/spirv_common.hpp @@ -55,6 +55,16 @@ public: #define SPIRV_CROSS_THROW(x) throw CompilerError(x) #endif +#if __cplusplus >= 201402l +#define SPIRV_CROSS_DEPRECATED(reason) [[deprecated(reason)]] +#elif defined(__GNUC__) +#define SPIRV_CROSS_DEPRECATED(reason) __attribute__((deprecated)) +#elif defined(_MSC_VER) +#define SPIRV_CROSS_DEPRECATED(reason) __declspec(deprecated(reason)) +#else +#define SPIRV_CROSS_DEPRECATED(reason) +#endif + namespace inner { template diff --git a/spirv_cross.hpp b/spirv_cross.hpp index 567b8d59..9dd10aa4 100644 --- a/spirv_cross.hpp +++ b/spirv_cross.hpp @@ -204,7 +204,7 @@ public: virtual size_t get_declared_struct_member_size(const SPIRType &struct_type, uint32_t index) const; // Legacy GLSL compatibility method. Deprecated in favor of CompilerGLSL::flatten_buffer_block - void flatten_interface_block(uint32_t id); + SPIRV_CROSS_DEPRECATED("Please use flatten_buffer_block instead.") void flatten_interface_block(uint32_t id); // Returns a set of all global variables which are statically accessed // by the control flow graph from the current entry point.