1 #ifndef RBIMPL_STDALIGN_H
2 #define RBIMPL_STDALIGN_H
23 #include "ruby/internal/config.h"
53 #if defined(__cplusplus) && RBIMPL_HAS_FEATURE(cxx_alignas)
54 # define RBIMPL_ALIGNAS alignas
56 #elif defined(__cplusplus) && (__cplusplus >= 201103L)
57 # define RBIMPL_ALIGNAS alignas
59 #elif defined(__INTEL_CXX11_MODE__)
60 # define RBIMPL_ALIGNAS alignas
62 #elif defined(__GXX_EXPERIMENTAL_CXX0X__)
63 # define RBIMPL_ALIGNAS alignas
65 #elif RBIMPL_HAS_DECLSPEC_ATTRIBUTE(align)
66 # define RBIMPL_ALIGNAS(_) __declspec(align(_))
68 #elif RBIMPL_HAS_ATTRIBUTE(aligned)
69 # define RBIMPL_ALIGNAS(_) __attribute__((__aligned__(_)))
72 # define RBIMPL_ALIGNAS(_)
86 #if defined(__DOXYGEN__)
87 # define RBIMPL_ALIGNOF alignof
88 #elif defined(__cplusplus)
92 # define RBIMPL_ALIGNOF(T) (static_cast<size_t>(ruby::rbimpl_alignof<T>::value))
96 struct rbimpl_alignof {
103 value = offsetof(
type, t)
108 #elif RBIMPL_COMPILER_IS(MSVC)
110 # define RBIMPL_ALIGNOF __alignof
112 #elif defined(HAVE__ALIGNOF)
114 # define RBIMPL_ALIGNOF(T) RB_GNUC_EXTENSION(_Alignof(T))
131 # define RBIMPL_ALIGNOF(T) offsetof(struct { char _; T t; }, t)
Defines RBIMPL_HAS_ATTRIBUTE.
Defines RBIMPL_COMPILER_IS.
Defines RBIMPL_HAS_DECLSPEC_ATTRIBUTE.
Defines RBIMPL_HAS_FEATURE.
VALUE type(ANYARGS)
ANYARGS-ed function type.
#define _(args)
This was a transition path from K&R to ANSI.