]> Savannah Git Hosting - gnulib.git/commitdiff
getpagesize: Fix use of 'extern inline' (regression 2012-11-20).
authorBruno Haible <bruno@clisp.org>
Mon, 11 Nov 2024 08:33:11 +0000 (09:33 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 12 Nov 2024 00:46:25 +0000 (01:46 +0100)
* lib/unistd.in.h (_GL_GETPAGESIZE_INLINE): New macro.
(getpagesize): Use it.
* lib/getpagesize.c (_GL_GETPAGESIZE_INLINE): Define.
* modules/getpagesize (configure.ac): Compile getpagesize.c also when
getpagesize is missing.

ChangeLog
lib/getpagesize.c
lib/unistd.in.h
modules/getpagesize

index 30ec241d31f084153e61d78d9be043a39594986b..880cdff1a67c0b6ddbb53b270bb621ece357e0b4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-11-11  Bruno Haible  <bruno@clisp.org>
+
+       getpagesize: Fix use of 'extern inline' (regression 2012-11-20).
+       * lib/unistd.in.h (_GL_GETPAGESIZE_INLINE): New macro.
+       (getpagesize): Use it.
+       * lib/getpagesize.c (_GL_GETPAGESIZE_INLINE): Define.
+       * modules/getpagesize (configure.ac): Compile getpagesize.c also when
+       getpagesize is missing.
+
 2024-11-10  Bruno Haible  <bruno@clisp.org>
 
        relocatable-prog-wrapper: Fix compilation error on NetBSD 7.
index d203155329077876a0f6e26eaf3317381ebffe65..dd880a6ca278a5384c4e0fc332c5935f7ede5fa3 100644 (file)
@@ -20,6 +20,7 @@
 #include <config.h>
 
 /* Specification. */
+#define _GL_GETPAGESIZE_INLINE _GL_EXTERN_INLINE
 #include <unistd.h>
 
 /* This implementation is only for native Windows systems.  */
index 952e153bcd6ecbf495915b51c46fb8a70da4e489..6c5ee5bf072f14f1714cd0756e9c806b5fc0ea17 100644 (file)
@@ -180,6 +180,9 @@ _GL_INLINE_HEADER_BEGIN
 #ifndef _GL_UNISTD_INLINE
 # define _GL_UNISTD_INLINE _GL_INLINE
 #endif
+#ifndef _GL_GETPAGESIZE_INLINE
+# define _GL_GETPAGESIZE_INLINE _GL_INLINE
+#endif
 
 /* Hide some function declarations from <winsock2.h>.  */
 
@@ -1460,7 +1463,7 @@ _GL_FUNCDECL_SYS (getpagesize, int, (void));
 #     define getpagesize() _gl_getpagesize ()
 #    else
 #     if !GNULIB_defined_getpagesize_function
-_GL_UNISTD_INLINE int
+_GL_GETPAGESIZE_INLINE int
 getpagesize ()
 {
   return _gl_getpagesize ();
index 7b38fff93bdb4761d413e75c29a97e86af613dce..a883edf06794cf3fb599eb5e9bbfeba37eac4f4d 100644 (file)
@@ -10,7 +10,8 @@ unistd
 
 configure.ac:
 gl_FUNC_GETPAGESIZE
-gl_CONDITIONAL([GL_COND_OBJ_GETPAGESIZE], [test $REPLACE_GETPAGESIZE = 1])
+gl_CONDITIONAL([GL_COND_OBJ_GETPAGESIZE],
+               [test $HAVE_GETPAGESIZE = 0 || test $REPLACE_GETPAGESIZE = 1])
 gl_UNISTD_MODULE_INDICATOR([getpagesize])
 
 Makefile.am: