* lib/fts_.h: Include <sys/cdefs.h> if the system has it.
(__THROW, __BEGIN_DECLS, __END_DECLS): Define properly if not previously
defined.
* m4/fts.m4 (gl_FUNC_FTS_CORE): Check for sys/cdefs.h.
+2025-05-10 Collin Funk <collin.funk1@gmail.com>
+
+ fts: Fix redefinition of __THROW.
+ * lib/fts_.h: Include <sys/cdefs.h> if the system has it.
+ (__THROW, __BEGIN_DECLS, __END_DECLS): Define properly if not previously
+ defined.
+ * m4/fts.m4 (gl_FUNC_FTS_CORE): Check for sys/cdefs.h.
+
2025-05-10 Bruno Haible <bruno@clisp.org>
string-desc, xstring-desc: Avoid GCC attributes in function definitions.
# define __FLEXIBLE_ARRAY_MEMBER
# endif
# else
+# if HAVE_SYS_CDEFS_H
+# include <sys/cdefs.h>
+# endif
# define __FLEXIBLE_ARRAY_MEMBER FLEXIBLE_ARRAY_MEMBER
-# undef __THROW
-# define __THROW
-# undef __BEGIN_DECLS
-# undef __END_DECLS
-# ifdef __cplusplus
-# define __BEGIN_DECLS extern "C" {
-# define __END_DECLS }
-# else
-# define __BEGIN_DECLS
-# define __END_DECLS
+# ifndef __THROW
+# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major__ >= 4)
+# if __cplusplus >= 201103L
+# define __THROW noexcept (true)
+# else
+# define __THROW throw ()
+# endif
+# else
+# define __THROW
+# endif
+# endif
+# ifndef __BEGIN_DECLS
+# ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# else
+# define __BEGIN_DECLS /* nothing */
+# endif
+# endif
+# ifndef __END_DECLS
+# ifdef __cplusplus
+# define __END_DECLS }
+# else
+# define __END_DECLS /* nothing */
+# endif
# endif
# endif
# fts.m4
-# serial 24
+# serial 25
dnl Copyright (C) 2005-2025 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
[
dnl Prerequisites of lib/fts.c.
gl_FUNC_OPENAT
+ AC_CHECK_HEADERS_ONCE([sys/cdefs.h])
AC_CHECK_FUNCS_ONCE([fstatfs])
AC_CHECK_HEADERS_ONCE([sys/param.h sys/vfs.h])dnl