summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/endian.c2
-rw-r--r--lib/intprops-internal.h9
-rw-r--r--lib/limits.in.h6
-rw-r--r--lib/signal.in.h6
-rw-r--r--lib/stdbit.c2
-rw-r--r--lib/stdbit.in.h3
-rw-r--r--lib/stdio.in.h6
-rw-r--r--lib/stdlib.c2
-rw-r--r--lib/stdlib.in.h9
-rw-r--r--lib/string.in.h6
-rw-r--r--lib/unistd.c2
11 files changed, 30 insertions, 23 deletions
diff --git a/lib/endian.c b/lib/endian.c
index 3e7e56f523d..089f5f7825e 100644
--- a/lib/endian.c
+++ b/lib/endian.c
@@ -17,7 +17,7 @@
/* Written by Collin Funk. */
+#define _GL_ENDIAN_INLINE _GL_EXTERN_INLINE
#include <config.h>
-#define _GL_ENDIAN_INLINE _GL_EXTERN_INLINE
#include <endian.h>
diff --git a/lib/intprops-internal.h b/lib/intprops-internal.h
index c8cc0e20194..0b7e1f539aa 100644
--- a/lib/intprops-internal.h
+++ b/lib/intprops-internal.h
@@ -77,10 +77,11 @@
/* Does the __typeof__ keyword work? This could be done by
'configure', but for now it's easier to do it by hand. */
-#if (2 <= __GNUC__ \
- || (4 <= __clang_major__) \
- || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
- || (0x5110 <= __SUNPRO_C && !__STDC__))
+#if ((defined __GNUC__ && 2 <= __GNUC__) \
+ || (defined __clang_major__ && 4 <= __clang_major__) \
+ || (defined __IBMC__ && 1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
+ || (defined __SUNPRO_C && 0x5110 <= __SUNPRO_C && !__STDC__) \
+ || (defined _MSC_VER && 1939 <= _MSC_VER))
# define _GL_HAVE___TYPEOF__ 1
#else
# define _GL_HAVE___TYPEOF__ 0
diff --git a/lib/limits.in.h b/lib/limits.in.h
index c65eb4c1cfe..3347e369fb5 100644
--- a/lib/limits.in.h
+++ b/lib/limits.in.h
@@ -20,7 +20,7 @@
#endif
@PRAGMA_COLUMNS@
-#if defined _GL_ALREADY_INCLUDING_LIMITS_H
+#if defined _@GUARD_PREFIX@_ALREADY_INCLUDING_LIMITS_H
/* Special invocation convention:
On Haiku/x86_64, we have a sequence of nested includes
<limits.h> -> <syslimits.h> -> <limits.h>.
@@ -34,12 +34,12 @@
#ifndef _@GUARD_PREFIX@_LIMITS_H
-# define _GL_ALREADY_INCLUDING_LIMITS_H
+# define _@GUARD_PREFIX@_ALREADY_INCLUDING_LIMITS_H
/* The include_next requires a split double-inclusion guard. */
# @INCLUDE_NEXT@ @NEXT_LIMITS_H@
-# undef _GL_ALREADY_INCLUDING_LIMITS_H
+# undef _@GUARD_PREFIX@_ALREADY_INCLUDING_LIMITS_H
#ifndef _@GUARD_PREFIX@_LIMITS_H
#define _@GUARD_PREFIX@_LIMITS_H
diff --git a/lib/signal.in.h b/lib/signal.in.h
index 6239b90adf3..18c88f0c1d7 100644
--- a/lib/signal.in.h
+++ b/lib/signal.in.h
@@ -20,7 +20,7 @@
#endif
@PRAGMA_COLUMNS@
-#if defined __need_sig_atomic_t || defined __need_sigset_t || defined _GL_ALREADY_INCLUDING_SIGNAL_H || (defined _SIGNAL_H && !defined __SIZEOF_PTHREAD_MUTEX_T)
+#if defined __need_sig_atomic_t || defined __need_sigset_t || defined _@GUARD_PREFIX@_ALREADY_INCLUDING_SIGNAL_H || (defined _SIGNAL_H && !defined __SIZEOF_PTHREAD_MUTEX_T)
/* Special invocation convention:
- Inside glibc header files.
- On glibc systems we have a sequence of nested includes
@@ -39,7 +39,7 @@
#ifndef _@GUARD_PREFIX@_SIGNAL_H
-#define _GL_ALREADY_INCLUDING_SIGNAL_H
+#define _@GUARD_PREFIX@_ALREADY_INCLUDING_SIGNAL_H
/* Define pid_t, uid_t.
Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>.
@@ -50,7 +50,7 @@
/* The include_next requires a split double-inclusion guard. */
#@INCLUDE_NEXT@ @NEXT_SIGNAL_H@
-#undef _GL_ALREADY_INCLUDING_SIGNAL_H
+#undef _@GUARD_PREFIX@_ALREADY_INCLUDING_SIGNAL_H
#ifndef _@GUARD_PREFIX@_SIGNAL_H
#define _@GUARD_PREFIX@_SIGNAL_H
diff --git a/lib/stdbit.c b/lib/stdbit.c
index 4801e74d281..b9c52698e91 100644
--- a/lib/stdbit.c
+++ b/lib/stdbit.c
@@ -17,7 +17,7 @@
/* Written by Paul Eggert. */
+#define _GL_STDBIT_INLINE _GL_EXTERN_INLINE
#include <config.h>
-#define _GL_STDBIT_INLINE _GL_EXTERN_INLINE
#include <stdbit.h>
diff --git a/lib/stdbit.in.h b/lib/stdbit.in.h
index 20b9f4f4662..91d237d7ad0 100644
--- a/lib/stdbit.in.h
+++ b/lib/stdbit.in.h
@@ -77,7 +77,8 @@ _GL_INLINE_HEADER_BEGIN
#if ((defined __GNUC__ && 2 <= __GNUC__) \
|| (defined __clang_major__ && 4 <= __clang_major__) \
|| (defined __IBMC__ && 1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
- || (defined __SUNPRO_C && 0x5110 <= __SUNPRO_C && !__STDC__))
+ || (defined __SUNPRO_C && 0x5110 <= __SUNPRO_C && !__STDC__) \
+ || (defined _MSC_VER && 1939 <= _MSC_VER))
# define _GL_STDBIT_TYPEOF_CAST(a, b) ((__typeof__ (a)) (b))
#elif 202311 <= __STDC_VERSION__
# define _GL_STDBIT_TYPEOF_CAST(a, b) ((typeof (a)) (b))
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index e77798d9b25..ed260d308b0 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -20,7 +20,7 @@
#endif
@PRAGMA_COLUMNS@
-#if defined __need_FILE || defined __need___FILE || defined _GL_ALREADY_INCLUDING_STDIO_H
+#if defined __need_FILE || defined __need___FILE || defined _@GUARD_PREFIX@_ALREADY_INCLUDING_STDIO_H || defined _GL_SKIP_GNULIB_STDIO_H
/* Special invocation convention:
- Inside glibc header files.
- On OSF/1 5.1 we have a sequence of nested includes
@@ -48,12 +48,12 @@
# endif
#endif
-#define _GL_ALREADY_INCLUDING_STDIO_H
+#define _@GUARD_PREFIX@_ALREADY_INCLUDING_STDIO_H
/* The include_next requires a split double-inclusion guard. */
#@INCLUDE_NEXT@ @NEXT_STDIO_H@
-#undef _GL_ALREADY_INCLUDING_STDIO_H
+#undef _@GUARD_PREFIX@_ALREADY_INCLUDING_STDIO_H
#ifdef _GL_DEFINED__POSIX_C_SOURCE
# undef _GL_DEFINED__POSIX_C_SOURCE
diff --git a/lib/stdlib.c b/lib/stdlib.c
index 521d64627dc..6f70fa4bbda 100644
--- a/lib/stdlib.c
+++ b/lib/stdlib.c
@@ -15,7 +15,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
+#define _GL_STDLIB_INLINE _GL_EXTERN_INLINE
#include <config.h>
-#define _GL_STDLIB_INLINE _GL_EXTERN_INLINE
#include <stdlib.h>
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index adbef69131b..14f45cc21e5 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -746,15 +746,20 @@ _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
# endif
#endif
-/* Return maximum number of bytes of a multibyte character. */
+/* Return maximum number of bytes in a multibyte character in the
+ current locale. */
#if @REPLACE_MB_CUR_MAX@
# if !GNULIB_defined_MB_CUR_MAX
-_GL_STDLIB_INLINE int
+_GL_STDLIB_INLINE size_t
gl_MB_CUR_MAX (void)
{
+# if 0 < @REPLACE_MB_CUR_MAX@
+ return @REPLACE_MB_CUR_MAX@;
+# else
/* Turn the value 3 to the value 4, as needed for the UTF-8 encoding. */
int gl_mb_cur_max = MB_CUR_MAX;
return gl_mb_cur_max == 3 ? 4 : gl_mb_cur_max;
+# endif
}
# undef MB_CUR_MAX
# define MB_CUR_MAX gl_MB_CUR_MAX ()
diff --git a/lib/string.in.h b/lib/string.in.h
index f5a6d8b3267..72cd7566e65 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -20,7 +20,7 @@
#endif
@PRAGMA_COLUMNS@
-#if defined _GL_ALREADY_INCLUDING_STRING_H
+#if defined _@GUARD_PREFIX@_ALREADY_INCLUDING_STRING_H
/* Special invocation convention:
- On OS X/NetBSD we have a sequence of nested includes
<string.h> -> <strings.h> -> "string.h"
@@ -34,12 +34,12 @@
#ifndef _@GUARD_PREFIX@_STRING_H
-#define _GL_ALREADY_INCLUDING_STRING_H
+#define _@GUARD_PREFIX@_ALREADY_INCLUDING_STRING_H
/* The include_next requires a split double-inclusion guard. */
#@INCLUDE_NEXT@ @NEXT_STRING_H@
-#undef _GL_ALREADY_INCLUDING_STRING_H
+#undef _@GUARD_PREFIX@_ALREADY_INCLUDING_STRING_H
#ifndef _@GUARD_PREFIX@_STRING_H
#define _@GUARD_PREFIX@_STRING_H
diff --git a/lib/unistd.c b/lib/unistd.c
index f3b3f7bd2fe..b25112eb91e 100644
--- a/lib/unistd.c
+++ b/lib/unistd.c
@@ -15,8 +15,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
+#define _GL_UNISTD_INLINE _GL_EXTERN_INLINE
#include <config.h>
-#define _GL_UNISTD_INLINE _GL_EXTERN_INLINE
#include <unistd.h>
typedef int dummy;