Commits

Sebastian Freundt committed c27750f Merge

Merge branch 'next'

* next:
fix, bld, conditionalise on anon structs in make_scidx()
chore, check for c11 anon struct initialisers

Comments (0)

Files changed (3)

 SXE_CHECK_CFLAGS
 ## libtool goddess^Wgoodness
 SXE_CHECK_LIBTOOL
+## we need C11 anon structs
+SXE_CHECK_ANON_STRUCTS
 
 AM_MISSING_PROG([HELP2MAN], [help2man], ["${missing_dir}"])
 

m4/sxe-compiler.m4

 
 	if test "${sxe_cv_have_anon_structs}" = "yes"; then
 		AC_DEFINE([HAVE_ANON_STRUCTS], [1], [
-			Whether c1x anon structs work])
+			Whether c11 anon structs work])
 		$1
 		:
 	else
 static inline scidx_t
 make_scidx(scom_t t, sidx_t idx)
 {
+#if defined HAVE_ANON_STRUCTS
 	scidx_t res = {
 		.sec = scom_thdr_sec(t),
 		.msec = scom_thdr_msec(t),
 		.idx = idx,
 	};
+#else  /* !HAVE_ANON_STRUCTS */
+	scidx_t res;
+	res.sec = scom_thdr_sec(t);
+	res.msec = scom_thdr_msec(t);
+	res.idx = idx;
+#endif	/* HAVE_ANON_STRUCTS */
 	return res;
 }