mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-02-04 14:30:55 +08:00
avutil/attributes: add AV_HAS_ATTRIBUTE
Maybe useful and to fix MSVC preprocessor warnings.
Fixes: afad332d77
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
This commit is contained in:
@@ -40,6 +40,12 @@
|
||||
# define AV_HAS_BUILTIN(x) 0
|
||||
#endif
|
||||
|
||||
#ifdef __has_attribute
|
||||
# define AV_HAS_ATTRIBUTE(x) __has_attribute(x)
|
||||
#else
|
||||
# define AV_HAS_ATTRIBUTE(x) 0
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) && defined(__has_cpp_attribute)
|
||||
# define AV_HAS_STD_ATTRIBUTE(x) __has_cpp_attribute(x)
|
||||
#elif !defined(__cplusplus) && defined(__has_c_attribute)
|
||||
@@ -183,13 +189,13 @@
|
||||
|
||||
#ifdef __MINGW_PRINTF_FORMAT
|
||||
# define AV_PRINTF_FMT __MINGW_PRINTF_FORMAT
|
||||
#elif defined(__has_attribute) && __has_attribute(format)
|
||||
#elif AV_HAS_ATTRIBUTE(format)
|
||||
# define AV_PRINTF_FMT __printf__
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW_SCANF_FORMAT
|
||||
# define AV_SCANF_FMT __MINGW_SCANF_FORMAT
|
||||
#elif defined(__has_attribute) && __has_attribute(format)
|
||||
#elif AV_HAS_ATTRIBUTE(format)
|
||||
# define AV_SCANF_FMT __scanf__
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user