+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-19 Collin Funk <collin.funk1@gmail.com>
gnulib-tool.py: Make use of GLModule's __hash__ method.
#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
# extensions.m4
-# serial 23 -*- Autoconf -*-
+# serial 24 -*- Autoconf -*-
dnl Copyright (C) 2003, 2006-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,
[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__.
+ AC_DEFINE([__STDC_WANT_LIB_EXT1__], [1],
+ [Define to enable the declarations of ISO C 23 Annex K types and functions.])
])
# memset_explicit.m4
-# serial 2
+# 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