This is needed for diffutils, which doesn’t define HAVE_CONFIG_H.
There needs to be some way for a test shared with glibc to discover
whether it should use the Gnulib or the glibc testing framework,
and I guess this is it.
* modules/stdbit-tests (GNULIB_TEST_STDBIT): Define.
* tests/tst-stdbit.h: Use GNULIB_TEST_STDBIT, not HAVE_CONFIG_H.
+2024-05-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ stdbit: don’t assume -DHAVE_CONFIG_H
+ This is needed for diffutils, which doesn’t define HAVE_CONFIG_H.
+ There needs to be some way for a test shared with glibc to discover
+ whether it should use the Gnulib or the glibc testing framework,
+ and I guess this is it.
+ * modules/stdbit-tests (GNULIB_TEST_STDBIT): Define.
+ * tests/tst-stdbit.h: Use GNULIB_TEST_STDBIT, not HAVE_CONFIG_H.
+
2024-05-11 Collin Funk <collin.funk1@gmail.com>
gnulib-tool.py: Filter out dependencies that cannot be found.
stdint
configure.ac:
+AC_DEFINE([GNULIB_TEST_STDBIT], [1],
+ [Define to 1 so that stdbit tests use the Gnulib framework, not glibc's.])
Makefile.am:
TESTS += \
#ifndef _TST_STDBIT_H
#define _TST_STDBIT_H
-#if HAVE_CONFIG_H
+#if GNULIB_TEST_STDBIT
# include <libc-config.h>
#endif
#include <stdbit.h>
#include <stdbool.h>
-#if !HAVE_CONFIG_H
+#if !GNULIB_TEST_STDBIT
# include <array_length.h>
# include <support/check.h>
#else
uint64_t res_8, res_16, res_32, res_64;
};
-#if !HAVE_CONFIG_H
+#if !GNULIB_TEST_STDBIT
# define TEST_TYPE(EXPR, TYPE) \
_Static_assert (_Generic ((EXPR), TYPE: 1, default: 0), "bad type")
#elif ((defined __GNUC__ && 2 <= __GNUC__) \