Define SG_DEPRECATED, remove unused DEPRECATED.

Use this to mark two Package APIs as deprecated.
This commit is contained in:
James Turner 2017-04-05 22:09:52 +09:00
parent f3e83cf020
commit fe87e7f60d
2 changed files with 22 additions and 20 deletions

View File

@ -109,10 +109,13 @@
# define SG_UNIX # define SG_UNIX
#endif #endif
#if defined( __GNUC__ ) #ifdef __GNUC__
# define DEPRECATED __attribute__ ((deprecated)) #define SG_DEPRECATED(func) func __attribute__ ((deprecated))
#elif defined(_MSC_VER)
#define SG_DEPRECATED(func) __declspec(deprecated) func
#else #else
# define DEPRECATED #pragma message("WARNING: You need to implement SG_DEPRECATED for this compiler")
#define SG_DEPRECATED(func) func
#endif #endif
#if defined(__clang__) #if defined(__clang__)

View File

@ -102,7 +102,7 @@ public:
* *
* Deprecated - please use nameForVariant * Deprecated - please use nameForVariant
*/ */
std::string name() const; SG_DEPRECATED(std::string name() const);
/** /**
* Human readable name of a variant * Human readable name of a variant
@ -117,7 +117,7 @@ public:
* Deprecated - please use getLocalisedProp to get the variant-specific * Deprecated - please use getLocalisedProp to get the variant-specific
* description. * description.
*/ */
std::string description() const; SG_DEPRECATED(std::string description() const);
/** /**
* access the raw property data in the package * access the raw property data in the package
@ -241,4 +241,3 @@ private:
} // of namespace simgear } // of namespace simgear
#endif // of SG_PACKAGE_PACKAGE_HXX #endif // of SG_PACKAGE_PACKAGE_HXX