mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-12 09:28:24 +00:00
55a6cca64f
nt/inc/stdalign.h (_Alignas, alignas): Define. src/makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h. Fixes: debbugs:9772
26 lines
677 B
C++
26 lines
677 B
C++
#ifndef _NT_STDALIGN_H_
|
|
#define _NT_STDALIGN_H_
|
|
|
|
/* This header has the necessary stuff from lib/stdalign.in.h, but
|
|
avoids the need to have Sed at build time. */
|
|
|
|
#include <stddef.h>
|
|
#if defined __cplusplus
|
|
template <class __t> struct __alignof_helper { char __a; __t __b; };
|
|
# define _Alignof(type) offsetof (__alignof_helper<type>, __b)
|
|
#else
|
|
# define _Alignof(type) offsetof (struct { char __a; type __b; }, __b)
|
|
#endif
|
|
#define alignof _Alignof
|
|
|
|
#if __GNUC__
|
|
# define _Alignas(a) __attribute__ ((__aligned__ (a)))
|
|
#elif 1300 <= _MSC_VER
|
|
# define _Alignas(a) __declspec (align (a))
|
|
#endif
|
|
#ifdef _Alignas
|
|
# define alignas _Alignas
|
|
#endif
|
|
|
|
#endif /* _NT_STDALIGN_H_ */
|