Merge "vpx_codec.h: namespace local defines"

This commit is contained in:
James Zern 2017-10-06 05:30:16 +00:00 committed by Gerrit Code Review
commit d2fb834ebd

View File

@ -46,34 +46,35 @@ extern "C" {
#include "./vpx_integer.h" #include "./vpx_integer.h"
/*!\brief Decorator indicating a function is deprecated */ /*!\brief Decorator indicating a function is deprecated */
#ifndef DEPRECATED #ifndef VPX_DEPRECATED
#if defined(__GNUC__) && __GNUC__ #if defined(__GNUC__) && __GNUC__
#define DEPRECATED __attribute__((deprecated)) #define VPX_DEPRECATED __attribute__((deprecated))
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
#define DEPRECATED #define VPX_DEPRECATED
#else #else
#define DEPRECATED #define VPX_DEPRECATED
#endif #endif
#endif /* DEPRECATED */ #endif /* VPX_DEPRECATED */
#ifndef DECLSPEC_DEPRECATED #ifndef VPX_DECLSPEC_DEPRECATED
#if defined(__GNUC__) && __GNUC__ #if defined(__GNUC__) && __GNUC__
#define DECLSPEC_DEPRECATED /**< \copydoc #DEPRECATED */ #define VPX_DECLSPEC_DEPRECATED /**< \copydoc #VPX_DEPRECATED */
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
/*!\brief \copydoc #DEPRECATED */ /*!\brief \copydoc #VPX_DEPRECATED */
#define DECLSPEC_DEPRECATED __declspec(deprecated) #define VPX_DECLSPEC_DEPRECATED __declspec(deprecated)
#else #else
#define DECLSPEC_DEPRECATED /**< \copydoc #DEPRECATED */ #define VPX_DECLSPEC_DEPRECATED /**< \copydoc #VPX_DEPRECATED */
#endif #endif
#endif /* DECLSPEC_DEPRECATED */ #endif /* VPX_DECLSPEC_DEPRECATED */
/*!\brief Decorator indicating a function is potentially unused */ /*!\brief Decorator indicating a function is potentially unused */
#ifdef UNUSED #ifndef VPX_UNUSED
#elif defined(__GNUC__) || defined(__clang__) #if defined(__GNUC__) || defined(__clang__)
#define UNUSED __attribute__((unused)) #define VPX_UNUSED __attribute__((unused))
#else #else
#define UNUSED #define VPX_UNUSED
#endif #endif
#endif /* VPX_UNUSED */
/*!\brief Current ABI version number /*!\brief Current ABI version number
* *
@ -413,7 +414,7 @@ vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx, int ctrl_id, ...);
*/ */
#define VPX_CTRL_USE_TYPE(id, typ) \ #define VPX_CTRL_USE_TYPE(id, typ) \
static vpx_codec_err_t vpx_codec_control_##id(vpx_codec_ctx_t *, int, typ) \ static vpx_codec_err_t vpx_codec_control_##id(vpx_codec_ctx_t *, int, typ) \
UNUSED; \ VPX_UNUSED; \
\ \
static vpx_codec_err_t vpx_codec_control_##id(vpx_codec_ctx_t *ctx, \ static vpx_codec_err_t vpx_codec_control_##id(vpx_codec_ctx_t *ctx, \
int ctrl_id, typ data) { \ int ctrl_id, typ data) { \
@ -431,10 +432,10 @@ vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx, int ctrl_id, ...);
* wrapper to the type-unsafe internal function. * wrapper to the type-unsafe internal function.
*/ */
#define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ) \ #define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ) \
DECLSPEC_DEPRECATED static vpx_codec_err_t vpx_codec_control_##id( \ VPX_DECLSPEC_DEPRECATED static vpx_codec_err_t vpx_codec_control_##id( \
vpx_codec_ctx_t *, int, typ) DEPRECATED UNUSED; \ vpx_codec_ctx_t *, int, typ) VPX_DEPRECATED VPX_UNUSED; \
\ \
DECLSPEC_DEPRECATED static vpx_codec_err_t vpx_codec_control_##id( \ VPX_DECLSPEC_DEPRECATED static vpx_codec_err_t vpx_codec_control_##id( \
vpx_codec_ctx_t *ctx, int ctrl_id, typ data) { \ vpx_codec_ctx_t *ctx, int ctrl_id, typ data) { \
return vpx_codec_control_(ctx, ctrl_id, data); \ return vpx_codec_control_(ctx, ctrl_id, data); \
} /**<\hideinitializer*/ } /**<\hideinitializer*/
@ -451,7 +452,7 @@ vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx, int ctrl_id, ...);
*/ */
#define VPX_CTRL_VOID(id) \ #define VPX_CTRL_VOID(id) \
static vpx_codec_err_t vpx_codec_control_##id(vpx_codec_ctx_t *, int) \ static vpx_codec_err_t vpx_codec_control_##id(vpx_codec_ctx_t *, int) \
UNUSED; \ VPX_UNUSED; \
\ \
static vpx_codec_err_t vpx_codec_control_##id(vpx_codec_ctx_t *ctx, \ static vpx_codec_err_t vpx_codec_control_##id(vpx_codec_ctx_t *ctx, \
int ctrl_id) { \ int ctrl_id) { \