* modules/stack-trace (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/stdlib.in.h (print_stack_trace): Don't define if module
'stack-trace' is not present.
* tests/macros.h (print_stack_trace): Define as a fallback if module
'stack-trace' is not present.
+2024-07-18 Bruno Haible <bruno@clisp.org>
+
+ stdlib: Don't define print_stack_trace unconditionally.
+ * modules/stack-trace (configure.ac): Invoke gl_MODULE_INDICATOR.
+ * lib/stdlib.in.h (print_stack_trace): Don't define if module
+ 'stack-trace' is not present.
+ * tests/macros.h (print_stack_trace): Define as a fallback if module
+ 'stack-trace' is not present.
+
2024-07-18 Bruno Haible <bruno@clisp.org>
stack-trace: Don't use NetBSD's broken libasan.
# endif
#endif
-#if @GNULIB_STACK_TRACE@ && @CAN_PRINT_STACK_TRACE@
+#if @GNULIB_STACK_TRACE@
+/* Prints a stack trace of the current thread to standard error,
+ if possible. */
+# if @CAN_PRINT_STACK_TRACE@
_GL_EXTERN_C void print_stack_trace (void);
-#else
-# if !GNULIB_defined_print_stack_trace
-# define print_stack_trace() /* nothing */
-# define GNULIB_defined_print_stack_trace 1
+# else
+# if !GNULIB_defined_print_stack_trace
+# define print_stack_trace() /* nothing */
+# define GNULIB_defined_print_stack_trace 1
+# endif
# endif
#endif
gl_STACK_TRACE
gl_CONDITIONAL([GL_COND_OBJ_STACK_TRACE], [test $CAN_PRINT_STACK_TRACE = 1])
gl_STDLIB_MODULE_INDICATOR([stack-trace])
+gl_MODULE_INDICATOR([stack-trace])
Makefile.am:
if GL_COND_OBJ_STACK_TRACE
# define ASSERT_STREAM stderr
#endif
+/* Define print_stack_trace() to a no-op, if the module 'stack-trace' is not
+ in use. */
+#if !GNULIB_STACK_TRACE
+# define print_stack_trace() /* nothing */
+#endif
+
/* Exit status of the test.
Initialized to EXIT_SUCCESS.
Set to EXIT_FAILURE when an ASSERT or ASSERT_NO_STDIO fails. */