summaryrefslogtreecommitdiff
path: root/config.h.in
diff options
context:
space:
mode:
authorpeter <peter@pmikkelsen.com>2026-09-22 18:26:55 +0000
committerpeter <peter@pmikkelsen.com>2026-09-22 18:26:55 +0000
commitea381bac43f3ce78be5fa3ea10810810670dfb89 (patch)
tree2f3e7b92e6bf94b96d1c1dcfb82b5aac896a504c /config.h.in
parent714687cbd560759ee27227c05bd016fae2bcb743 (diff)
Check for flexible array member support via autoconf
FossilOrigin-Name: 4d8f080ee14f63ea5cb2c0aa87be1519e7b74e3c42de2370e90ae1e1f9268cd0
Diffstat (limited to 'config.h.in')
-rw-r--r--config.h.in9
1 files changed, 9 insertions, 0 deletions
diff --git a/config.h.in b/config.h.in
index fbdc27b..cd458a5 100644
--- a/config.h.in
+++ b/config.h.in
@@ -9,6 +9,15 @@
/* Defined if the build mode is "release" */
#undef APLWC_BUILD_TYPE_RELEASE
+/* Define to nothing if C supports flexible array members, and to 1 if it does
+ not. That way, with a declaration like 'struct s { int n; double
+ d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99
+ compilers. When computing the size of such an object, don't use 'sizeof
+ (struct s)' as it overestimates the size. Use 'offsetof (struct s, d)'
+ instead. Don't use 'offsetof (struct s, d[0])', as this doesn't work with
+ MSVC and with C++ compilers. */
+#undef FLEXIBLE_ARRAY_MEMBER
+
/* Name of package */
#undef PACKAGE