aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/kmi/types.h8
-rw-r--r--include/kmi/utils.h4
2 files changed, 4 insertions, 8 deletions
diff --git a/include/kmi/types.h b/include/kmi/types.h
index 709ca02..fc7cd8c 100644
--- a/include/kmi/types.h
+++ b/include/kmi/types.h
@@ -127,14 +127,6 @@ typedef uint32_t size_t;
typedef int32_t ssize_t;
#endif
-/** Maximum alignment. Works for most platforms, I think. */
-typedef union {
- /** Either the system has an integer as its maximum width */
- intmax_t ll;
- /** Or it has a long double. */
- long double ld;
-} max_align_t;
-
/** Expands to integer constant of type \ref int8_t. */
#define INT8_C __INT8_C
diff --git a/include/kmi/utils.h b/include/kmi/utils.h
index 30b08be..a5bdc02 100644
--- a/include/kmi/utils.h
+++ b/include/kmi/utils.h
@@ -153,9 +153,13 @@
#if __has_builtin(__builtin_offsetof)
#define offsetof(type, member) __builtin_offsetof(type, member)
#else
+
+#if !defined(offsetof)
#define offsetof(type, member) ((uintptr_t) &((type *)0)->member)
#endif
+#endif /* __has_builtin(__builtin_offsetof) */
+
/**
* Signal to the compiler that some expression is likely to be true.
* Might aid in optimisation and branch prediction manipulation.