]> Savannah Git Hosting - gnulib.git/commitdiff
Fix warnings for functions introduced in Android API level 12.
authorBruno Haible <bruno@clisp.org>
Thu, 19 Jan 2023 20:55:15 +0000 (21:55 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 19 Jan 2023 20:55:15 +0000 (21:55 +0100)
Reported by Po Lu <luangruo@yahoo.com>.

* m4/ftruncate.m4 (gl_FUNC_FTRUNCATE): Test for ftruncate using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/glob.m4 (gl_PREREQ_GLOB): Test for getpwnam_r using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/nproc.m4 (gl_PREREQ_NPROC): Test for sched_getaffinity using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/pread.m4 (gl_FUNC_PREAD): Test for pread using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/pwrite.m4 (gl_FUNC_PWRITE): Test for pwrite using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/thread.m4 (gl_THREAD): Test for pthread_atfork using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/timegm.m4 (gl_FUNC_TIMEGM): Test for timegm using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Test for utimensat using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/utimens.m4 (gl_UTIMENS): Likewise.

ChangeLog
m4/ftruncate.m4
m4/glob.m4
m4/nproc.m4
m4/pread.m4
m4/pwrite.m4
m4/thread.m4
m4/timegm.m4
m4/utimens.m4
m4/utimensat.m4

index 26c07501b315f70b744ca445db6e527f7d3729dc..c29bd760ec70c38782824e439869e44774a1f133 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2023-01-19  Bruno Haible  <bruno@clisp.org>
+
+       Fix warnings for functions introduced in Android API level 12.
+       Reported by Po Lu <luangruo@yahoo.com>.
+       * m4/ftruncate.m4 (gl_FUNC_FTRUNCATE): Test for ftruncate using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/glob.m4 (gl_PREREQ_GLOB): Test for getpwnam_r using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/nproc.m4 (gl_PREREQ_NPROC): Test for sched_getaffinity using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
+       * m4/pread.m4 (gl_FUNC_PREAD): Test for pread using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/pwrite.m4 (gl_FUNC_PWRITE): Test for pwrite using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/thread.m4 (gl_THREAD): Test for pthread_atfork using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
+       * m4/timegm.m4 (gl_FUNC_TIMEGM): Test for timegm using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Test for utimensat using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/utimens.m4 (gl_UTIMENS): Likewise.
+
 2023-01-19  Bruno Haible  <bruno@clisp.org>
 
        Fix warnings for functions introduced in Android API level 9.
index 74c347598d111a73fb01d12caac83aead0870948..f48126e8560e2fc880e57e7d0a228fc48bbd4330 100644 (file)
@@ -1,4 +1,4 @@
-# serial 21
+# serial 22
 
 # See if we need to emulate a missing ftruncate function using _chsize.
 
@@ -10,7 +10,7 @@
 AC_DEFUN([gl_FUNC_FTRUNCATE],
 [
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  AC_CHECK_FUNCS_ONCE([ftruncate])
+  gl_CHECK_FUNCS_ANDROID([ftruncate], [[#include <unistd.h>]])
   if test $ac_cv_func_ftruncate = yes; then
     m4_ifdef([gl_LARGEFILE], [
       AC_REQUIRE([AC_CANONICAL_HOST])
index 354581b3beebdc7d3804c225e5cc80fbe0a226a6..847f88038fba3ff2aaa45b326a1dfce6408a0969 100644 (file)
@@ -1,4 +1,4 @@
-# glob.m4 serial 27
+# glob.m4 serial 28
 dnl Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -126,5 +126,5 @@ AC_DEFUN([gl_PREREQ_GLOB],
   AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE])
   AC_CHECK_HEADERS_ONCE([unistd.h])
   gl_CHECK_FUNCS_ANDROID([getlogin_r], [[#include <unistd.h>]])
-  AC_CHECK_FUNCS_ONCE([getpwnam_r])
+  gl_CHECK_FUNCS_ANDROID([getpwnam_r], [[#include <pwd.h>]])
 ])
index 3065b7b9bfffeb14e961509d6e405283f4b2c8be..c892ad74b7d020e7b58e902d94bfb22c79a9f039 100644 (file)
@@ -1,4 +1,4 @@
-# nproc.m4 serial 5
+# nproc.m4 serial 6
 dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -25,8 +25,8 @@ AC_DEFUN([gl_PREREQ_NPROC],
      #endif
     ])
 
-  AC_CHECK_FUNCS([sched_getaffinity sched_getaffinity_np \
-                  pstat_getdynamic sysmp sysctl])
+  AC_CHECK_FUNCS([sched_getaffinity_np pstat_getdynamic sysmp sysctl])
+  gl_CHECK_FUNCS_ANDROID([sched_getaffinity], [[#include <sched.h>]])
 
   dnl Test whether sched_getaffinity has the expected declaration.
   dnl glibc 2.3.[0-2]:
index ac3c1b7d518fdff2222f023d0e7634bf0bd08b4c..8031f910d45f2071ab836be8d4e81f24830ecbb7 100644 (file)
@@ -1,4 +1,4 @@
-# pread.m4 serial 6
+# pread.m4 serial 7
 dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -12,7 +12,7 @@ AC_DEFUN([gl_FUNC_PREAD],
   dnl Persuade glibc <unistd.h> to declare pread().
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
-  AC_CHECK_FUNCS_ONCE([pread])
+  gl_CHECK_FUNCS_ANDROID([pread], [[#include <unistd.h>]])
   if test $ac_cv_func_pread = yes; then
     dnl On HP-UX 11.11 with _FILE_OFFSET_BITS=64, pread() on a file returns 0
     dnl instead of a positive value.
index f77d4210d6dcd41eb4d12de305f3a9c9baec7ab4..48c5255f30bd37affabe0cde9ea2db1cec0e8b86 100644 (file)
@@ -1,4 +1,4 @@
-# pwrite.m4 serial 6
+# pwrite.m4 serial 7
 dnl Copyright (C) 2010-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -12,7 +12,7 @@ AC_DEFUN([gl_FUNC_PWRITE],
   dnl Persuade glibc <unistd.h> to declare pwrite().
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
-  AC_CHECK_FUNCS_ONCE([pwrite])
+  gl_CHECK_FUNCS_ANDROID([pwrite], [[#include <unistd.h>]])
   if test $ac_cv_func_pwrite = yes; then
     dnl On HP-UX 11.11 with _FILE_OFFSET_BITS=64, pwrite() on a file does not
     dnl fail when an invalid (negative) offset is passed and uses an arbitrary
index 12515f6a939f0f0f2d3f6ae6a9cdf89bbf7c1cd2..9c63df39dadda8e339ec02d5eceff1e25977d8c9 100644 (file)
@@ -1,4 +1,4 @@
-# thread.m4 serial 3
+# thread.m4 serial 4
 dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,7 +11,7 @@ AC_DEFUN([gl_THREAD],
   if test $gl_threads_api = posix; then
     gl_save_LIBS="$LIBS"
     LIBS="$LIBS $LIBMULTITHREAD"
-    AC_CHECK_FUNCS([pthread_atfork])
+    gl_CHECK_FUNCS_ANDROID([pthread_atfork], [[#include <pthread.h>]])
     LIBS="$gl_save_LIBS"
   fi
 ])
index 6079f1a39c8db6fb03c132919fc772fdc1badc98..fa84e98db3e7a05d9f44118c92447de29db98b3f 100644 (file)
@@ -1,4 +1,4 @@
-# timegm.m4 serial 13
+# timegm.m4 serial 14
 dnl Copyright (C) 2003, 2007, 2009-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -9,7 +9,7 @@ AC_DEFUN([gl_FUNC_TIMEGM],
   AC_REQUIRE([gl_TIME_H_DEFAULTS])
   AC_REQUIRE([gl_FUNC_MKTIME_WORKS])
   REPLACE_TIMEGM=0
-  AC_CHECK_FUNCS_ONCE([timegm])
+  gl_CHECK_FUNCS_ANDROID([timegm], [[#include <time.h>]])
   if test $ac_cv_func_timegm = yes; then
     if test "$gl_cv_func_working_mktime" != yes; then
       # Assume that timegm is buggy if mktime is.
index c5d9b69e6f55784f973ccb08305c19b1b92e3e73..900b4f6aa34599bdead58c7107269efa66617492 100644 (file)
@@ -3,7 +3,7 @@ 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 serial 12
+dnl serial 13
 
 AC_DEFUN([gl_UTIMENS],
 [
@@ -11,9 +11,10 @@ AC_DEFUN([gl_UTIMENS],
   AC_REQUIRE([gl_FUNC_UTIMES])
   AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-  AC_CHECK_FUNCS_ONCE([futimens utimensat lutimes])
+  AC_CHECK_FUNCS_ONCE([futimens lutimes])
   gl_CHECK_FUNCS_ANDROID([futimes], [[#include <sys/time.h>]])
   gl_CHECK_FUNCS_ANDROID([futimesat], [[#include <sys/time.h>]])
+  gl_CHECK_FUNCS_ANDROID([utimensat], [[#include <sys/stat.h>]])
 
   if test $ac_cv_func_futimens = no && test $ac_cv_func_futimesat = yes; then
     dnl FreeBSD 8.0-rc2 mishandles futimesat(fd,NULL,time).  It is not
index dd210fc989a766b18adc99388528b81d62227835..1d3db2efa232b6cf28cbc3733b34b53f187894a5 100644 (file)
@@ -1,4 +1,4 @@
-# serial 9
+# serial 10
 # See if we need to provide utimensat replacement.
 
 dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
@@ -13,7 +13,7 @@ AC_DEFUN([gl_FUNC_UTIMENSAT],
   AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-  AC_CHECK_FUNCS_ONCE([utimensat])
+  gl_CHECK_FUNCS_ANDROID([utimensat], [[#include <sys/stat.h>]])
   if test $ac_cv_func_utimensat = no; then
     HAVE_UTIMENSAT=0
   else