summaryrefslogtreecommitdiffstats
path: root/gl/m4/errno_h.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/errno_h.m4')
-rw-r--r--gl/m4/errno_h.m459
1 files changed, 2 insertions, 57 deletions
diff --git a/gl/m4/errno_h.m4 b/gl/m4/errno_h.m4
index 420d5bb3..ade19b6f 100644
--- a/gl/m4/errno_h.m4
+++ b/gl/m4/errno_h.m4
@@ -1,6 +1,6 @@
1# errno_h.m4 1# errno_h.m4
2# serial 18 2# serial 19
3dnl Copyright (C) 2004, 2006, 2008-2025 Free Software Foundation, Inc. 3dnl Copyright (C) 2004, 2006, 2008-2026 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -83,59 +83,4 @@ booboo
83 gl_NEXT_HEADERS([errno.h]) 83 gl_NEXT_HEADERS([errno.h])
84 GL_GENERATE_ERRNO_H=true 84 GL_GENERATE_ERRNO_H=true
85 fi 85 fi
86 gl_REPLACE_ERRNO_VALUE([EMULTIHOP])
87 gl_REPLACE_ERRNO_VALUE([ENOLINK])
88 gl_REPLACE_ERRNO_VALUE([EOVERFLOW])
89])
90
91# Assuming $1 = EOVERFLOW.
92# The EOVERFLOW errno value ought to be defined in <errno.h>, according to
93# POSIX. But some systems (like OpenBSD 4.0 or AIX 3) don't define it, and
94# some systems (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined.
95# Check for the value of EOVERFLOW.
96# Set the variables EOVERFLOW_HIDDEN and EOVERFLOW_VALUE.
97AC_DEFUN([gl_REPLACE_ERRNO_VALUE],
98[
99 if $GL_GENERATE_ERRNO_H; then
100 AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [
101 AC_EGREP_CPP([yes],[
102#include <errno.h>
103#ifdef ]$1[
104yes
105#endif
106 ],
107 [gl_cv_header_errno_h_]$1[=yes],
108 [gl_cv_header_errno_h_]$1[=no])
109 if test $gl_cv_header_errno_h_]$1[ = no; then
110 AC_EGREP_CPP([yes],[
111#define _XOPEN_SOURCE_EXTENDED 1
112#include <errno.h>
113#ifdef ]$1[
114yes
115#endif
116 ], [gl_cv_header_errno_h_]$1[=hidden])
117 if test $gl_cv_header_errno_h_]$1[ = hidden; then
118 dnl The macro exists but is hidden.
119 dnl Define it to the same value.
120 AC_COMPUTE_INT([gl_cv_header_errno_h_]$1, $1, [
121#define _XOPEN_SOURCE_EXTENDED 1
122#include <errno.h>
123/* The following two lines are a workaround against an autoconf-2.52 bug. */
124#include <stdio.h>
125#include <stdlib.h>
126])
127 fi
128 fi
129 ])
130 case $gl_cv_header_errno_h_]$1[ in
131 yes | no)
132 ]$1[_HIDDEN=0; ]$1[_VALUE=
133 ;;
134 *)
135 ]$1[_HIDDEN=1; ]$1[_VALUE="$gl_cv_header_errno_h_]$1["
136 ;;
137 esac
138 AC_SUBST($1[_HIDDEN])
139 AC_SUBST($1[_VALUE])
140 fi
141]) 86])