Add deprecation macro.

This commit is contained in:
Hans-Kristian Arntzen 2017-03-15 10:31:19 +01:00
parent 6381b2ff9c
commit 8411470ab9
2 changed files with 11 additions and 1 deletions

View File

@ -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 <typename T>

View File

@ -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.