max_align_t is used to examine the largest alignment requirement,
and it is expected to check the alignment value via alignof, not sizeof. Otherwise, __attribute__((aligned)) can complain as required alignment being invalid, e.g. on s390x. Patch provided by Mamoru Tasaka, Fedora
This commit is contained in:
parent
0ce2e2467a
commit
26cf1a7a57
|
|
@ -25,6 +25,9 @@
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#ifndef _MSC_VER
|
||||||
|
#include <stdalign.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -44,7 +47,7 @@ typedef struct {
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#define MAX_ALIGN 8
|
#define MAX_ALIGN 8
|
||||||
#else
|
#else
|
||||||
#define MAX_ALIGN sizeof(max_align_t)
|
#define MAX_ALIGN alignof(max_align_t)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue