summaryrefslogtreecommitdiff
path: root/lib/alignof.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-12-19 18:00:28 +0100
committerAndy Wingo <wingo@pobox.com>2011-12-19 18:00:28 +0100
commit296004b3ba34139292eb1d8bf54739ee1a082712 (patch)
tree149e2c87f169583ade59bbb876530fc03af9b2ea /lib/alignof.h
parentbfe35b90ff0c7f78335e70bdb26ea3466f6e98d9 (diff)
parent52b680f85e84689778f10ed8f9e72adf8316fbe7 (diff)
downloadguile-296004b3ba34139292eb1d8bf54739ee1a082712.tar.gz
Merge remote-tracking branch 'origin/stable-2.0'
Conflicts: libguile/feature.c m4/gnulib-cache.m4 module/ice-9/deprecated.scm module/language/tree-il/peval.scm
Diffstat (limited to 'lib/alignof.h')
-rw-r--r--lib/alignof.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/alignof.h b/lib/alignof.h
index 4d03e35c9..2049142c6 100644
--- a/lib/alignof.h
+++ b/lib/alignof.h
@@ -20,8 +20,11 @@
#include <stddef.h>
-/* Determine the alignment of a structure slot (field) of a given type,
+/* alignof_slot (TYPE)
+ Determine the alignment of a structure slot (field) of a given type,
at compile time. Note that the result depends on the ABI.
+ This is the same as alignof (TYPE) and _Alignof (TYPE), defined in
+ <stdalign.h> if __alignof_is_defined is 1.
Note: The result cannot be used as a value for an 'enum' constant,
due to bugs in HP-UX 10.20 cc and AIX 3.2.5 xlc. */
#if defined __cplusplus
@@ -31,7 +34,8 @@
# define alignof_slot(type) offsetof (struct { char __slot1; type __slot2; }, __slot2)
#endif
-/* Determine the good alignment of an object of the given type at compile time.
+/* alignof_type (TYPE)
+ Determine the good alignment of an object of the given type at compile time.
Note that this is not necessarily the same as alignof_slot(type).
For example, with GNU C on x86 platforms: alignof_type(double) = 8, but
- when -malign-double is not specified: alignof_slot(double) = 4,
@@ -44,10 +48,4 @@
# define alignof_type alignof_slot
#endif
-/* alignof is an alias for alignof_slot semantics, since that's what most
- callers need.
- Note: The result cannot be used as a value for an 'enum' constant,
- due to bugs in HP-UX 10.20 cc and AIX 3.2.5 xlc. */
-#define alignof alignof_slot
-
#endif /* _ALIGNOF_H */