You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avutil/mem_internal: define DECLARE_ALIGNED as C11's alignas
alignas is portable than compiler's specific __attribute__. It do have a limitation, that alignas don't support specify aligment on the declarations of struct (it works for specify alignment on struct fields), which only used by avcodec/cavs, and is removed now. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
This commit is contained in:
@ -24,6 +24,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <stdalign.h>
|
||||||
|
|
||||||
#include "attributes.h"
|
#include "attributes.h"
|
||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
@ -73,26 +74,14 @@
|
|||||||
* @param v Name of the variable
|
* @param v Name of the variable
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || defined(__SUNPRO_C)
|
#if defined(__DJGPP__)
|
||||||
#define DECLARE_ALIGNED_T(n,t,v) t __attribute__ ((aligned (n))) v
|
#define DECLARE_ALIGNED_T(n,t,v) alignas(FFMIN(n, 16)) t v
|
||||||
#define DECLARE_ASM_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
|
#define DECLARE_ASM_ALIGNED(n,t,v) alignas(FFMIN(n, 16)) t av_used v
|
||||||
#define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
|
#define DECLARE_ASM_CONST(n,t,v) alignas(FFMIN(n, 16)) static const t av_used v
|
||||||
#elif defined(__DJGPP__)
|
|
||||||
#define DECLARE_ALIGNED_T(n,t,v) t __attribute__ ((aligned (FFMIN(n, 16)))) v
|
|
||||||
#define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v
|
|
||||||
#define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v
|
|
||||||
#elif defined(__GNUC__) || defined(__clang__)
|
|
||||||
#define DECLARE_ALIGNED_T(n,t,v) t __attribute__ ((aligned (n))) v
|
|
||||||
#define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (n))) v
|
|
||||||
#define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
#define DECLARE_ALIGNED_T(n,t,v) __declspec(align(n)) t v
|
|
||||||
#define DECLARE_ASM_ALIGNED(n,t,v) __declspec(align(n)) t v
|
|
||||||
#define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
|
|
||||||
#else
|
#else
|
||||||
#define DECLARE_ALIGNED_T(n,t,v) t v
|
#define DECLARE_ALIGNED_T(n,t,v) alignas(n) t v
|
||||||
#define DECLARE_ASM_ALIGNED(n,t,v) t v
|
#define DECLARE_ASM_ALIGNED(n,t,v) alignas(n) t av_used v
|
||||||
#define DECLARE_ASM_CONST(n,t,v) static const t v
|
#define DECLARE_ASM_CONST(n,t,v) alignas(n) static const t av_used v
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_SIMD_ALIGN_64
|
#if HAVE_SIMD_ALIGN_64
|
||||||
|
Reference in New Issue
Block a user