- 主题:gcc可以通过 cl无法通过 什么问题
#ifdef __ICL
#define DECLARE_ALIGNED( var, n ) __declspec(align(n)) var
#else
#define DECLARE_ALIGNED( var, n ) var __attribute__((aligned(n)))
#endif
#define ALIGNED_16( var ) DECLARE_ALIGNED( var, 16 )
#define ALIGNED_8( var ) DECLARE_ALIGNED( var, 8 )
#define ALIGNED_4( var ) DECLARE_ALIGNED( var, 4 )
#include <stdint.h>
typedef uint16_t pixel;
struct x264_weight_t;
typedef struct x264_weight_t
{
/* aligning the first member is a gcc hack to force the struct to be
* 16 byte aligned, as well as force sizeof(struct) to be a multiple of 16 */
ALIGNED_16(int16_t cachea[8]);
int16_t cacheb[8];
int32_t i_denom;
int32_t i_scale;
int32_t i_offset;
}x264_weight;
--
FROM 101.88.140.*
只要把宏ALIGNED_16注释掉,cl也是可以通过的。
什么问题啊?
【 在 javame (javame) 的大作中提到: 】
#ifdef __ICL
#define DECLARE_ALIGNED( var, n ) __declspec(align(n)) var
#else
#define DECLARE_ALIGNED( var, n ) var __attribute__((aligned(n)))
#endif
#define ALIGNED_16( var ) DECLARE_ALIGNED( var, 16 )
#define ALIGNED_8( var ) DECLARE_ALIGNED( var, 8 )
#define ALIGNED_4( var ) DECLARE_ALIGNED( var, 4 )
#include <stdint.h>
typedef uint16_t pixel;
struct x264_weight_t;
typedef struct x264_weight_t
{
/* aligning the first member is a gcc hack to force the struct to be
* 16 byte aligned, as well as force sizeof(struct) to be a multiple of 16 */
ALIGNED_16(int16_t cachea[8]);
int16_t cacheb[8];
int32_t i_denom;
int32_t i_scale;
int32_t i_offset;
}x264_weight;
--
FROM 101.88.140.*
你怎么整天搞这种史前代码啊。
C++11的alignas不香吗?
【 在 javame (javame) 的大作中提到: 】
: 标 题: gcc可以通过 cl无法通过 什么问题
: 发信站: 水木社区 (Tue Jun 16 15:17:45 2020), 站内
:
: #ifdef __ICL
: #define DECLARE_ALIGNED( var, n ) __declspec(align(n)) var
: #else
: #define DECLARE_ALIGNED( var, n ) var __attribute__((aligned(n)))
: #endif
: #define ALIGNED_16( var ) DECLARE_ALIGNED( var, 16 )
: #define ALIGNED_8( var ) DECLARE_ALIGNED( var, 8 )
: #define ALIGNED_4( var ) DECLARE_ALIGNED( var, 4 )
:
: #include <stdint.h>
:
: typedef uint16_t pixel;
:
: struct x264_weight_t;
:
: typedef struct x264_weight_t
: {
: /* aligning the first member is a gcc hack to force the struct to be
: * 16 byte aligned, as well as force sizeof(struct) to be a multiple of 16 */
: ALIGNED_16(int16_t cachea[8]);
: int16_t cacheb[8];
: int32_t i_denom;
: int32_t i_scale;
: int32_t i_offset;
: }x264_weight;
:
:
: --
:
: ※ 来源:·水木社区 newsmth.net·[FROM: 101.88.140.*]
--
FROM 76.126.252.*