Print this page
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/sys/stdalign.h
+++ new/usr/src/uts/common/sys/stdalign.h
1 1 /*
2 2 * This file and its contents are supplied under the terms of the
3 3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 4 * You may only use this file in accordance with the terms of version
5 5 * 1.0 of the CDDL.
6 6 *
7 7 * A full copy of the text of the CDDL should have accompanied this
8 8 * source. A copy of the CDDL is also available via the Internet at
9 9 * http://www.illumos.org/license/CDDL.
10 10 */
11 11
12 12 /*
13 13 * Copyright 2016 Joyent, Inc.
14 14 * Copyright 2023 Oxide Computer Company
15 15 */
16 16
17 17 #ifndef _SYS_STDALIGN_H
18 18 #define _SYS_STDALIGN_H
19 19
20 20 /*
21 21 * ISO/IEC C11 stdalign.h. This header is meant to provide definitions for the
22 22 * alignas and alignof 'keywords' into the underlying compiler-understood value.
23 23 * In addition, there are two macros that are meant to define that this process
24 24 * has happened. C++11 added alignas/alignof as keywords and including this
25 25 * header is meant to cause us to still have the _is_defined macros, but not
26 26 * define this overall.
27 27 *
28 28 * Unlike other cases we don't use any symbol guards here (other than C++) and
29 29 * just allow the implementation to either have _Alignas and _Alignof or not
30 30 * have it and lead to a compiler error for the user. The main justification of
31 31 * this is that this header is only defined in C11 (and newer). It's not defined
32 32 * in other standards and just as if you include a non-standard header, in this
33 33 * case we don't try to stop that (same as if you included something like
34 34 * libdevinfo.h).
35 35 */
36 36
37 37 #ifdef __cplusplus
38 38 extern "C" {
39 39 #endif
40 40
41 41 #ifndef __cplusplus
42 42
43 43 #define alignas _Alignas
44 44 /*CSTYLED*/
45 45 #define alignof _Alignof
46 46
47 47 #endif /* !__cplusplus */
48 48
49 49 #define __alignas_is_defined 1
50 50 #define __alignof_is_defined 1
51 51
52 52 #ifdef __cplusplus
53 53 }
54 54 #endif
55 55
56 56 #endif /* _SYS_STDALIGN_H */
|
↓ open down ↓ |
56 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX