* lib/time.in.h (timespec_getres): Consider REPLACE_TIMESPEC_GETRES.
* m4/time_h.m4 (gl_TIME_H_DEFAULTS): Initialize REPLACE_TIMESPEC_GETRES.
* modules/time-h (Makefile.am): Substitute REPLACE_TIMESPEC_GETRES.
* m4/timespec_getres.m4 (gl_FUNC_TIMESPEC_GETRES): Test for
timespec_getres using gl_CHECK_FUNCS_ANDROID instead of
AC_CHECK_FUNCS_ONCE. Conditionally set REPLACE_TIMESPEC_GETRES.
* modules/timespec_getres (Depends-on, configure.ac): Consider
REPLACE_TIMESPEC_GETRES.
* m4/gettime.m4 (gl_GETTIME_RES): Test for timespec_getres using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* doc/posix-functions/timespec_getres.texi: Mention the Android API
levels.
+2024-01-25 Bruno Haible <bruno@clisp.org>
+
+ Resolve conflicts for functions introduced in Android API level 35.
+
+ * lib/time.in.h (timespec_getres): Consider REPLACE_TIMESPEC_GETRES.
+ * m4/time_h.m4 (gl_TIME_H_DEFAULTS): Initialize REPLACE_TIMESPEC_GETRES.
+ * modules/time-h (Makefile.am): Substitute REPLACE_TIMESPEC_GETRES.
+ * m4/timespec_getres.m4 (gl_FUNC_TIMESPEC_GETRES): Test for
+ timespec_getres using gl_CHECK_FUNCS_ANDROID instead of
+ AC_CHECK_FUNCS_ONCE. Conditionally set REPLACE_TIMESPEC_GETRES.
+ * modules/timespec_getres (Depends-on, configure.ac): Consider
+ REPLACE_TIMESPEC_GETRES.
+ * m4/gettime.m4 (gl_GETTIME_RES): Test for timespec_getres using
+ gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+ * doc/posix-functions/timespec_getres.texi: Mention the Android API
+ levels.
+
2024-01-25 Bruno Haible <bruno@clisp.org>
Resolve conflicts for functions introduced in Android API level 34.
/* A more-standard <time.h>.
- Copyright (C) 2007-2023 Free Software Foundation, Inc.
+ Copyright (C) 2007-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
/* Set *TS to the current time resolution, and return BASE.
Upon failure, return 0. */
# if @GNULIB_TIMESPEC_GETRES@
-# if ! @HAVE_TIMESPEC_GETRES@
+# if @REPLACE_TIMESPEC_GETRES@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef timespec_getres
+# define timespec_getres rpl_timespec_getres
+# endif
+_GL_FUNCDECL_RPL (timespec_getres, int, (struct timespec *ts, int base)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (timespec_getres, int, (struct timespec *ts, int base));
+# else
+# if !@HAVE_TIMESPEC_GETRES@
_GL_FUNCDECL_SYS (timespec_getres, int, (struct timespec *ts, int base)
_GL_ARG_NONNULL ((1)));
-# endif
+# endif
_GL_CXXALIAS_SYS (timespec_getres, int, (struct timespec *ts, int base));
+# endif
_GL_CXXALIASWARN (timespec_getres);
# elif defined GNULIB_POSIXCHECK
# undef timespec_getres
-# gettime.m4 serial 14
-dnl Copyright (C) 2002, 2004-2006, 2009-2023 Free Software Foundation, Inc.
+# gettime.m4 serial 15
+dnl Copyright (C) 2002, 2004-2006, 2009-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,
dnl with or without modifications, as long as this notice is preserved.
dnl Prerequisites of lib/gettime-res.c.
AC_REQUIRE([gl_CLOCK_TIME])
AC_REQUIRE([gl_TIMESPEC])
- AC_CHECK_FUNCS_ONCE([timespec_getres])
+ gl_CHECK_FUNCS_ANDROID([timespec_getres], [[#include <time.h>]])
])
# Configure a more-standard replacement for <time.h>.
-# Copyright (C) 2000-2001, 2003-2007, 2009-2023 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2024 Free Software Foundation, Inc.
-# serial 23
+# serial 23.1
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
REPLACE_TIME=0; AC_SUBST([REPLACE_TIME])
REPLACE_TIMEGM=0; AC_SUBST([REPLACE_TIMEGM])
REPLACE_TIMESPEC_GET=0; AC_SUBST([REPLACE_TIMESPEC_GET])
+ REPLACE_TIMESPEC_GETRES=0; AC_SUBST([REPLACE_TIMESPEC_GETRES])
REPLACE_TZSET=0; AC_SUBST([REPLACE_TZSET])
dnl Hack so that the time module doesn't depend on the sys_time module.
-# Test whether timespec_getres works.
-dnl Copyright 2021-2023 Free Software Foundation, Inc.
+# timespec_getres serial 2
+dnl Copyright 2021-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,
dnl with or without modifications, as long as this notice is preserved.
dnl Might be needed for the same reason timespec_get needs it.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
- AC_CHECK_FUNCS_ONCE([timespec_getres])
+ gl_CHECK_FUNCS_ANDROID([timespec_getres], [[#include <time.h>]])
if test $ac_cv_func_timespec_getres != yes; then
HAVE_TIMESPEC_GETRES=0
+ case "$gl_cv_onwards_func_timespec_getres" in
+ future*) REPLACE_TIMESPEC_GETRES=1 ;;
+ esac
fi
])
-e 's|@''REPLACE_TIME''@|$(REPLACE_TIME)|g' \
-e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
-e 's|@''REPLACE_TIMESPEC_GET''@|$(REPLACE_TIMESPEC_GET)|g' \
+ -e 's|@''REPLACE_TIMESPEC_GETRES''@|$(REPLACE_TIMESPEC_GETRES)|g' \
-e 's|@''REPLACE_TZSET''@|$(REPLACE_TZSET)|g' \
-e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \
-e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
Depends-on:
extensions
time-h
-gettime-res [test $HAVE_TIMESPEC_GETRES = 0]
+gettime-res [test $HAVE_TIMESPEC_GETRES = 0 || test $REPLACE_TIMESPEC_GETRES = 1]
configure.ac:
AC_REQUIRE([gl_FUNC_TIMESPEC_GETRES])
-gl_CONDITIONAL([GL_COND_OBJ_TIMESPEC_GETRES], [test $HAVE_TIMESPEC_GETRES = 0])
+gl_CONDITIONAL([GL_COND_OBJ_TIMESPEC_GETRES],
+ [test $HAVE_TIMESPEC_GETRES = 0 || test $REPLACE_TIMESPEC_GETRES = 1])
gl_TIME_MODULE_INDICATOR([timespec_getres])
Makefile.am: