summaryrefslogtreecommitdiff
path: root/gl
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2010-04-21 23:18:24 +0200
committerSimon Josefsson <simon@josefsson.org>2010-04-21 23:18:24 +0200
commit742c31198cc4061a13a1dc3f46cc5f9c9be2741d (patch)
tree2c4d805005fdf743d305c8b5576d7ca5b4bcc0a1 /gl
parentd153ee5f4519f27e32c8ef637a1f67539ede4af2 (diff)
downloadgnutls-742c31198cc4061a13a1dc3f46cc5f9c9be2741d.tar.gz
Update gnulib files.
Diffstat (limited to 'gl')
-rw-r--r--gl/Makefile.am2
-rw-r--r--gl/m4/gnulib-comp.m431
-rw-r--r--gl/m4/ioctl.m438
-rw-r--r--gl/m4/netdb_h.m412
-rw-r--r--gl/stdbool.in.h3
-rwxr-xr-xgl/tests/test-lseek.sh3
-rwxr-xr-xgl/tests/test-select-in.sh3
-rw-r--r--gl/tests/test-stdbool.c5
-rw-r--r--gl/tests/test-stdint.c1
9 files changed, 53 insertions, 45 deletions
diff --git a/gl/Makefile.am b/gl/Makefile.am
index 327ac12e60..b43e6bb96d 100644
--- a/gl/Makefile.am
+++ b/gl/Makefile.am
@@ -435,7 +435,7 @@ libgnu_la_SOURCES += minmax.h
## begin gnulib module netdb
-BUILT_SOURCES += $(NETDB_H)
+BUILT_SOURCES += netdb.h
# We need the following in order to create <netdb.h> when the system
# doesn't have one that works with the given compiler.
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 65fb6c6d4f..387c5df1c8 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -475,35 +475,7 @@ changequote([, ])dnl
gl_FUNC_UNGETC_WORKS
AC_C_BIGENDIAN
AC_C_BIGENDIAN
- AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])
- AC_REQUIRE([gl_HEADER_SYS_SOCKET])
- if test "$ac_cv_header_winsock2_h" = yes; then
- dnl Even if the 'socket' module is not used here, another part of the
- dnl application may use it and pass file descriptors that refer to
- dnl sockets to the ioctl() function. So enable the support for sockets.
- AC_LIBOBJ([ioctl])
- gl_REPLACE_SYS_IOCTL_H
- else
- AC_CHECK_FUNCS([ioctl])
- dnl On glibc systems, the second parameter is 'unsigned long int request',
- dnl not 'int request'. We cannot simply cast the function pointer, but
- dnl instead need a wrapper.
- AC_CACHE_CHECK([for ioctl with POSIX signature],
- [gl_cv_func_ioctl_posix_signature],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <sys/ioctl.h>]],
- [[extern int ioctl (int, int, ...);]])
- ],
- [gl_cv_func_ioctl_posix_signature=yes],
- [gl_cv_func_ioctl_posix_signature=no])
- ])
- if test $gl_cv_func_ioctl_posix_signature != yes; then
- REPLACE_IOCTL=1
- AC_LIBOBJ([ioctl])
- gl_REPLACE_SYS_IOCTL_H
- fi
- fi
+ gl_FUNC_IOCTL
gl_SYS_IOCTL_MODULE_INDICATOR([ioctl])
AC_CHECK_HEADERS_ONCE([unistd.h sys/wait.h])
gt_TYPE_WCHAR_T
@@ -733,6 +705,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/inet_pton.m4
m4/intmax_t.m4
m4/inttypes_h.m4
+ m4/ioctl.m4
m4/lib-ld.m4
m4/lib-link.m4
m4/lib-prefix.m4
diff --git a/gl/m4/ioctl.m4 b/gl/m4/ioctl.m4
new file mode 100644
index 0000000000..4a0a99f16a
--- /dev/null
+++ b/gl/m4/ioctl.m4
@@ -0,0 +1,38 @@
+# ioctl.m4 serial 1
+dnl Copyright (C) 2008-2010 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.
+
+AC_DEFUN([gl_FUNC_IOCTL],
+[
+ AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])
+ AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ dnl Even if the 'socket' module is not used here, another part of the
+ dnl application may use it and pass file descriptors that refer to
+ dnl sockets to the ioctl() function. So enable the support for sockets.
+ AC_LIBOBJ([ioctl])
+ gl_REPLACE_SYS_IOCTL_H
+ else
+ AC_CHECK_FUNCS([ioctl])
+ dnl On glibc systems, the second parameter is 'unsigned long int request',
+ dnl not 'int request'. We cannot simply cast the function pointer, but
+ dnl instead need a wrapper.
+ AC_CACHE_CHECK([for ioctl with POSIX signature],
+ [gl_cv_func_ioctl_posix_signature],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/ioctl.h>]],
+ [[extern int ioctl (int, int, ...);]])
+ ],
+ [gl_cv_func_ioctl_posix_signature=yes],
+ [gl_cv_func_ioctl_posix_signature=no])
+ ])
+ if test $gl_cv_func_ioctl_posix_signature != yes; then
+ REPLACE_IOCTL=1
+ AC_LIBOBJ([ioctl])
+ gl_REPLACE_SYS_IOCTL_H
+ fi
+ fi
+])
diff --git a/gl/m4/netdb_h.m4 b/gl/m4/netdb_h.m4
index 40ba8f6633..e04a2d13ee 100644
--- a/gl/m4/netdb_h.m4
+++ b/gl/m4/netdb_h.m4
@@ -1,4 +1,4 @@
-# netdb_h.m4 serial 7
+# netdb_h.m4 serial 8
dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -10,21 +10,11 @@ AC_DEFUN([gl_HEADER_NETDB],
AC_CHECK_HEADERS_ONCE([netdb.h])
gl_CHECK_NEXT_HEADERS([netdb.h])
if test $ac_cv_header_netdb_h = yes; then
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[
- #include <netdb.h>
- struct addrinfo a;
- int b = EAI_OVERFLOW;
- int c = AI_NUMERICSERV;
- ]])],
- [NETDB_H=''], [NETDB_H='netdb.h'])
HAVE_NETDB_H=1
else
- NETDB_H='netdb.h'
HAVE_NETDB_H=0
fi
AC_SUBST([HAVE_NETDB_H])
- AC_SUBST([NETDB_H])
])
AC_DEFUN([gl_NETDB_MODULE_INDICATOR],
diff --git a/gl/stdbool.in.h b/gl/stdbool.in.h
index e2312ecb80..574c281a8f 100644
--- a/gl/stdbool.in.h
+++ b/gl/stdbool.in.h
@@ -50,6 +50,9 @@
with this substitute. With this substitute, only the values 0 and 1
give the expected result when converted to _Bool' or 'bool'.
+ - C99 allows the use of (_Bool)0.0 in constant expressions, but
+ this substitute cannot always provide this property.
+
Also, it is suggested that programs use 'bool' rather than '_Bool';
this isn't required, but 'bool' is more common. */
diff --git a/gl/tests/test-lseek.sh b/gl/tests/test-lseek.sh
index ae3b23e57e..d5cc093e3b 100755
--- a/gl/tests/test-lseek.sh
+++ b/gl/tests/test-lseek.sh
@@ -8,7 +8,8 @@ tmpfiles=t-lseek.tmp
./test-lseek${EXEEXT} 0 < "$srcdir/test-lseek.sh" > t-lseek.tmp || exit 1
# pipes
-echo hi | ./test-lseek${EXEEXT} 1 | cat || exit 1
+: | { ./test-lseek${EXEEXT} 1; echo $? > t-lseek.tmp; } | :
+test "x`cat t-lseek.tmp`" = x0 || exit 1
# closed descriptors
# Doesn't work under mingw -- simon@josefsson.org
diff --git a/gl/tests/test-select-in.sh b/gl/tests/test-select-in.sh
index fdeb01ce83..2a8b742268 100755
--- a/gl/tests/test-select-in.sh
+++ b/gl/tests/test-select-in.sh
@@ -18,7 +18,8 @@ test `cat t-select-in.tmp` = "1" || exit 1
# Pipes.
rm -f t-select-in.tmp
-{ sleep 1; echo abc; } | ./test-select-fd${EXEEXT} r 0 t-select-in.tmp
+{ sleep 1; echo abc; } | \
+ { ./test-select-fd${EXEEXT} r 0 t-select-in.tmp; cat > /dev/null; }
test `cat t-select-in.tmp` = "0" || exit 1
rm -f t-select-in.tmp
diff --git a/gl/tests/test-stdbool.c b/gl/tests/test-stdbool.c
index 560e0e534d..fcb534de4c 100644
--- a/gl/tests/test-stdbool.c
+++ b/gl/tests/test-stdbool.c
@@ -46,11 +46,12 @@ struct s { _Bool s: 1; _Bool t; } s;
char a[true == 1 ? 1 : -1];
char b[false == 0 ? 1 : -1];
char c[__bool_true_false_are_defined == 1 ? 1 : -1];
-#if 0 /* Cannot be guaranteed with gnulib's <stdbool.h>. */
+#if 0 /* Cannot be guaranteed with gnulib's <stdbool.h>, at least,
+not for all compilers. */
char d[(bool) 0.5 == true ? 1 : -1];
bool e = &s;
-#endif
char f[(_Bool) 0.0 == false ? 1 : -1];
+#endif
char g[true];
char h[sizeof (_Bool)];
#if 0 /* See above. */
diff --git a/gl/tests/test-stdint.c b/gl/tests/test-stdint.c
index 9cec2e2f80..d64057a256 100644
--- a/gl/tests/test-stdint.c
+++ b/gl/tests/test-stdint.c
@@ -22,6 +22,7 @@
#define DO_PEDANTIC 0
#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
+#define __STDC_CONSTANT_MACROS 1 /* likewise */
#include <stdint.h>
#include "verify.h"