+2024-04-19 Bruno Haible <bruno@clisp.org>
+
+ memset_explicit: Fix compilation error on some OpenSolaris derivatives.
+ * m4/extensions.m4 (gl_USE_SYSTEM_EXTENSIONS): Arrange to define
+ __STDC_WANT_LIB_EXT1__ to 1.
+ * modules/memset_explicit (Depends-on): Add extensions.
+ * m4/memset_explicit.m4 (gl_FUNC_MEMSET_EXPLICIT): Require
+ gl_USE_SYSTEM_EXTENSIONS.
+ * lib/memset_explicit.c (__STDC_WANT_LIB_EXT1__): Remove definition.
+
2024-04-08 Bruno Haible <bruno@clisp.org>
ptsname_r: Work around ptsname_r bug on NetBSD 10.0.
/* Erase sensitive data from memory.
- Copyright 2022-2023 Free Software Foundation, Inc.
+ Copyright 2022-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
#include <config.h>
-/* memset_s need this define */
-#if HAVE_MEMSET_S
-# define __STDC_WANT_LIB_EXT1__ 1
-#endif
-
+/* Specification. */
#include <string.h>
/* Set S's bytes to C, where S has LEN bytes. The compiler will not
-# serial 23 -*- Autoconf -*-
+# serial 25 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
-# Copyright (C) 2003, 2006-2023 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2024 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
[Define to enable the declarations of ISO C 11 types and functions.])
;;
esac
+
+ dnl On OpenSolaris derivatives, the include files contains a couple of
+ dnl declarations that are only activated with an explicit
+ dnl -D__STDC_WANT_LIB_EXT1__.
+ AH_VERBATIM([USE_ISO_C_23_ANNEX_K_EXTENSIONS],
+[/* Define to enable the declarations of ISO C 23 Annex K types and functions. */
+#if !(defined __STDC_WANT_LIB_EXT1__ && __STDC_WANT_LIB_EXT1__)
+#undef/**/__STDC_WANT_LIB_EXT1__
+#define __STDC_WANT_LIB_EXT1__ 1
+#endif
+])
])
-# memset_explicit.m4 serial 2
+# memset_explicit.m4 serial 3
dnl Copyright 2022-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_DEFUN([gl_FUNC_MEMSET_EXPLICIT],
[
AC_REQUIRE([gl_STRING_H_DEFAULTS])
+ dnl Persuade OpenSolaris derivatives' <string.h> to declare memset_s().
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
gl_CHECK_FUNCS_ANDROID([memset_explicit], [[#include <string.h>]])
if test $ac_cv_func_memset_explicit = no; then
Depends-on:
string
+extensions
configure.ac:
gl_FUNC_MEMSET_EXPLICIT