Browse Source

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
pre-master-46
Holger Vogt 3 years ago
parent
commit
26cf1a7a57
  1. 5
      src/osdi/osdidefs.h

5
src/osdi/osdidefs.h

@ -25,6 +25,9 @@
#include <stddef.h>
#include <stdint.h>
#ifndef _MSC_VER
#include <stdalign.h>
#endif
#ifdef _MSC_VER
typedef struct {
@ -44,7 +47,7 @@ typedef struct {
#ifdef _MSC_VER
#define MAX_ALIGN 8
#else
#define MAX_ALIGN sizeof(max_align_t)
#define MAX_ALIGN alignof(max_align_t)
#endif

Loading…
Cancel
Save