summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2011-02-20 16:25:16 +0100
committerSimon Josefsson <simon@josefsson.org>2011-02-20 16:26:21 +0100
commitaee017b8888c904c42a303586f05a193f778cedb (patch)
treea44f8ee5f243968fdef3bc5f5719387360831479
parent8f177e5e8fc4ea89d3611be2a70832147dba5e82 (diff)
downloadgnutls-aee017b8888c904c42a303586f05a193f778cedb.tar.gz
Update gnulib files.
-rw-r--r--GNUmakefile2
-rw-r--r--build-aux/arg-nonnull.h4
-rw-r--r--build-aux/c++defs.h4
-rwxr-xr-xbuild-aux/config.rpath104
-rwxr-xr-xbuild-aux/gendocs.sh5
-rw-r--r--build-aux/pmccabe2html2
-rwxr-xr-xbuild-aux/update-copyright51
-rwxr-xr-xbuild-aux/useless-if-before-free10
-rwxr-xr-xbuild-aux/vc-list-files2
-rw-r--r--build-aux/warn-on-use.h4
-rw-r--r--gl/Makefile.am91
-rw-r--r--gl/accept.c2
-rw-r--r--gl/alignof.h2
-rw-r--r--gl/alloca.c16
-rw-r--r--gl/alloca.in.h2
-rw-r--r--gl/arpa_inet.in.h37
-rw-r--r--gl/asnprintf.c2
-rw-r--r--gl/bind.c2
-rw-r--r--gl/c-ctype.c2
-rw-r--r--gl/c-ctype.h2
-rw-r--r--gl/close-hook.c4
-rw-r--r--gl/close-hook.h4
-rw-r--r--gl/close.c2
-rw-r--r--gl/connect.c2
-rw-r--r--gl/errno.in.h2
-rw-r--r--gl/error.c2
-rw-r--r--gl/error.h18
-rw-r--r--gl/fclose.c2
-rw-r--r--gl/float+.h2
-rw-r--r--gl/float.in.h2
-rw-r--r--gl/fseeko.c6
-rw-r--r--gl/ftello.c4
-rw-r--r--gl/gai_strerror.c4
-rw-r--r--gl/getaddrinfo.c2
-rw-r--r--gl/getdelim.c4
-rw-r--r--gl/getline.c2
-rw-r--r--gl/getpass.c2
-rw-r--r--gl/getpass.h2
-rw-r--r--gl/gettext.h8
-rw-r--r--gl/gettime.c2
-rw-r--r--gl/gettimeofday.c2
-rw-r--r--gl/inet_ntop.c2
-rw-r--r--gl/inet_pton.c2
-rw-r--r--gl/intprops.h7
-rw-r--r--gl/listen.c2
-rw-r--r--gl/lseek.c2
-rw-r--r--gl/m4/00gnulib.m42
-rw-r--r--gl/m4/alloca.m42
-rw-r--r--gl/m4/arpa_inet_h.m47
-rw-r--r--gl/m4/asm-underscore.m42
-rw-r--r--gl/m4/autobuild.m43
-rw-r--r--gl/m4/clock_time.m42
-rw-r--r--gl/m4/close.m42
-rw-r--r--gl/m4/errno_h.m46
-rw-r--r--gl/m4/error.m42
-rw-r--r--gl/m4/extensions.m42
-rw-r--r--gl/m4/fclose.m42
-rw-r--r--gl/m4/fcntl-o.m4112
-rw-r--r--gl/m4/fcntl_h.m443
-rw-r--r--gl/m4/float_h.m46
-rw-r--r--gl/m4/fseeko.m49
-rw-r--r--gl/m4/ftello.m49
-rw-r--r--gl/m4/getaddrinfo.m42
-rw-r--r--gl/m4/getdelim.m42
-rw-r--r--gl/m4/getline.m42
-rw-r--r--gl/m4/getpagesize.m42
-rw-r--r--gl/m4/getpass.m42
-rw-r--r--gl/m4/gettime.m42
-rw-r--r--gl/m4/gettimeofday.m42
-rw-r--r--gl/m4/gnulib-cache.m42
-rw-r--r--gl/m4/gnulib-common.m424
-rw-r--r--gl/m4/gnulib-comp.m426
-rw-r--r--gl/m4/gnulib-tool.m42
-rw-r--r--gl/m4/hostent.m42
-rw-r--r--gl/m4/include_next.m499
-rw-r--r--gl/m4/inet_ntop.m412
-rw-r--r--gl/m4/inet_pton.m412
-rw-r--r--gl/m4/intmax_t.m42
-rw-r--r--gl/m4/inttypes_h.m42
-rw-r--r--gl/m4/ioctl.m42
-rw-r--r--gl/m4/lib-ld.m42
-rw-r--r--gl/m4/lib-link.m46
-rw-r--r--gl/m4/lib-prefix.m42
-rw-r--r--gl/m4/longlong.m483
-rw-r--r--gl/m4/lseek.m42
-rw-r--r--gl/m4/malloc.m42
-rw-r--r--gl/m4/manywarnings.m42
-rw-r--r--gl/m4/memchr.m42
-rw-r--r--gl/m4/minmax.m42
-rw-r--r--gl/m4/mmap-anon.m42
-rw-r--r--gl/m4/multiarch.m49
-rw-r--r--gl/m4/netdb_h.m45
-rw-r--r--gl/m4/netinet_in_h.m42
-rw-r--r--gl/m4/perror.m42
-rw-r--r--gl/m4/pipe.m416
-rw-r--r--gl/m4/printf.m447
-rw-r--r--gl/m4/read-file.m43
-rw-r--r--gl/m4/readline.m42
-rw-r--r--gl/m4/realloc.m42
-rw-r--r--gl/m4/select.m42
-rw-r--r--gl/m4/servent.m42
-rw-r--r--gl/m4/size_max.m42
-rw-r--r--gl/m4/snprintf.m49
-rw-r--r--gl/m4/socketlib.m42
-rw-r--r--gl/m4/sockets.m42
-rw-r--r--gl/m4/socklen.m42
-rw-r--r--gl/m4/sockpfaf.m42
-rw-r--r--gl/m4/stdarg.m46
-rw-r--r--gl/m4/stdbool.m416
-rw-r--r--gl/m4/stddef_h.m46
-rw-r--r--gl/m4/stdint.m423
-rw-r--r--gl/m4/stdint_h.m42
-rw-r--r--gl/m4/stdio_h.m48
-rw-r--r--gl/m4/stdlib_h.m424
-rw-r--r--gl/m4/strerror.m42
-rw-r--r--gl/m4/string_h.m46
-rw-r--r--gl/m4/sys_ioctl_h.m42
-rw-r--r--gl/m4/sys_select_h.m45
-rw-r--r--gl/m4/sys_socket_h.m416
-rw-r--r--gl/m4/sys_stat_h.m42
-rw-r--r--gl/m4/sys_time_h.m42
-rw-r--r--gl/m4/time_h.m48
-rw-r--r--gl/m4/timespec.m42
-rw-r--r--gl/m4/ungetc.m42
-rw-r--r--gl/m4/unistd_h.m414
-rw-r--r--gl/m4/valgrind-tests.m42
-rw-r--r--gl/m4/vasnprintf.m42
-rw-r--r--gl/m4/version-etc.m42
-rw-r--r--gl/m4/warn-on-use.m42
-rw-r--r--gl/m4/warnings.m42
-rw-r--r--gl/m4/wchar_h.m4154
-rw-r--r--gl/m4/wchar_t.m42
-rw-r--r--gl/m4/wint_t.m42
-rw-r--r--gl/m4/xsize.m42
-rw-r--r--gl/malloc.c2
-rw-r--r--gl/memchr.c2
-rw-r--r--gl/minmax.h2
-rw-r--r--gl/netdb.in.h5
-rw-r--r--gl/netinet_in.in.h2
-rw-r--r--gl/perror.c2
-rw-r--r--gl/printf-args.c2
-rw-r--r--gl/printf-args.h6
-rw-r--r--gl/printf-parse.c41
-rw-r--r--gl/printf-parse.h9
-rw-r--r--gl/progname.c2
-rw-r--r--gl/progname.h2
-rw-r--r--gl/read-file.c85
-rw-r--r--gl/read-file.h2
-rw-r--r--gl/readline.c2
-rw-r--r--gl/readline.h2
-rw-r--r--gl/realloc.c2
-rw-r--r--gl/recv.c2
-rw-r--r--gl/select.c2
-rw-r--r--gl/send.c2
-rw-r--r--gl/setsockopt.c2
-rw-r--r--gl/shutdown.c2
-rw-r--r--gl/size_max.h2
-rw-r--r--gl/snprintf.c2
-rw-r--r--gl/socket.c2
-rw-r--r--gl/sockets.c2
-rw-r--r--gl/sockets.h2
-rw-r--r--gl/stdarg.in.h2
-rw-r--r--gl/stdbool.in.h2
-rw-r--r--gl/stddef.in.h2
-rw-r--r--gl/stdint.in.h21
-rw-r--r--gl/stdio-impl.h13
-rw-r--r--gl/stdio-write.c2
-rw-r--r--gl/stdio.in.h110
-rw-r--r--gl/stdlib.in.h45
-rw-r--r--gl/strerror.c2
-rw-r--r--gl/string.in.h11
-rw-r--r--gl/sys_select.in.h17
-rw-r--r--gl/sys_socket.in.h46
-rw-r--r--gl/sys_stat.in.h8
-rw-r--r--gl/sys_time.in.h7
-rw-r--r--gl/tests/Makefile.am68
-rw-r--r--gl/tests/binary-io.h18
-rw-r--r--gl/tests/dummy.c2
-rw-r--r--gl/tests/fcntl.in.h308
-rw-r--r--gl/tests/getpagesize.c2
-rw-r--r--gl/tests/init.sh49
-rw-r--r--gl/tests/ioctl.c2
-rw-r--r--gl/tests/macros.h2
-rw-r--r--gl/tests/pipe.c42
-rw-r--r--gl/tests/signature.h2
-rw-r--r--gl/tests/sys_ioctl.in.h2
-rw-r--r--gl/tests/test-alignof.c2
-rw-r--r--gl/tests/test-alloca-opt.c2
-rw-r--r--gl/tests/test-arpa_inet.c2
-rw-r--r--gl/tests/test-binary-io.c2
-rw-r--r--gl/tests/test-c-ctype.c2
-rw-r--r--gl/tests/test-errno.c2
-rw-r--r--gl/tests/test-fcntl-h.c (renamed from lib/gl/tests/test-wchar.c)21
-rw-r--r--gl/tests/test-fseeko.c2
-rw-r--r--gl/tests/test-ftello.c2
-rw-r--r--gl/tests/test-ftello3.c2
-rw-r--r--gl/tests/test-getaddrinfo.c2
-rw-r--r--gl/tests/test-getdelim.c2
-rw-r--r--gl/tests/test-getline.c2
-rw-r--r--gl/tests/test-gettimeofday.c2
-rw-r--r--gl/tests/test-inet_ntop.c2
-rw-r--r--gl/tests/test-inet_pton.c2
-rw-r--r--gl/tests/test-lseek.c2
-rw-r--r--gl/tests/test-memchr.c2
-rw-r--r--gl/tests/test-netdb.c2
-rw-r--r--gl/tests/test-netinet_in.c2
-rw-r--r--gl/tests/test-perror.c2
-rw-r--r--gl/tests/test-pipe.c103
-rw-r--r--gl/tests/test-read-file.c2
-rw-r--r--gl/tests/test-select-fd.c2
-rw-r--r--gl/tests/test-select-stdin.c2
-rw-r--r--gl/tests/test-select.c52
-rw-r--r--gl/tests/test-snprintf.c10
-rw-r--r--gl/tests/test-sockets.c2
-rw-r--r--gl/tests/test-stdbool.c37
-rw-r--r--gl/tests/test-stddef.c2
-rw-r--r--gl/tests/test-stdint.c2
-rw-r--r--gl/tests/test-stdio.c2
-rw-r--r--gl/tests/test-stdlib.c2
-rw-r--r--gl/tests/test-strerror.c2
-rw-r--r--gl/tests/test-string.c2
-rw-r--r--gl/tests/test-sys_ioctl.c2
-rw-r--r--gl/tests/test-sys_select.c2
-rw-r--r--gl/tests/test-sys_socket.c2
-rw-r--r--gl/tests/test-sys_stat.c2
-rw-r--r--gl/tests/test-sys_time.c2
-rw-r--r--gl/tests/test-sys_wait.h2
-rw-r--r--gl/tests/test-time.c2
-rw-r--r--gl/tests/test-unistd.c2
-rwxr-xr-xgl/tests/test-update-copyright.sh18
-rw-r--r--gl/tests/test-vasnprintf.c2
-rwxr-xr-xgl/tests/test-vc-list-files-cvs.sh2
-rwxr-xr-xgl/tests/test-vc-list-files-git.sh2
-rw-r--r--gl/tests/test-verify.c2
-rw-r--r--gl/tests/test-version-etc.c2
-rwxr-xr-xgl/tests/test-version-etc.sh2
-rw-r--r--gl/tests/w32sock.h2
-rw-r--r--gl/tests/zerosize-ptr.h2
-rw-r--r--gl/time.in.h20
-rw-r--r--gl/timespec.h2
-rw-r--r--gl/unistd.in.h51
-rw-r--r--gl/vasnprintf.c7
-rw-r--r--gl/vasnprintf.h16
-rw-r--r--gl/verify.h2
-rw-r--r--gl/version-etc-fsf.c2
-rw-r--r--gl/version-etc.c4
-rw-r--r--gl/version-etc.h10
-rw-r--r--gl/w32sock.h2
-rw-r--r--gl/wchar.in.h433
-rw-r--r--gl/xsize.h2
-rw-r--r--lib/build-aux/arg-nonnull.h4
-rw-r--r--lib/build-aux/c++defs.h4
-rwxr-xr-xlib/build-aux/config.rpath104
-rw-r--r--lib/build-aux/warn-on-use.h4
-rw-r--r--lib/gl/Makefile.am88
-rw-r--r--lib/gl/alignof.h2
-rw-r--r--lib/gl/alloca.in.h4
-rw-r--r--lib/gl/asnprintf.c2
-rw-r--r--lib/gl/asprintf.c2
-rw-r--r--lib/gl/byteswap.in.h2
-rw-r--r--lib/gl/c-ctype.c2
-rw-r--r--lib/gl/c-ctype.h2
-rw-r--r--lib/gl/close-hook.c2
-rw-r--r--lib/gl/close-hook.h2
-rw-r--r--lib/gl/errno.in.h2
-rw-r--r--lib/gl/float+.h2
-rw-r--r--lib/gl/float.in.h2
-rw-r--r--lib/gl/fseeko.c6
-rw-r--r--lib/gl/ftello.c4
-rw-r--r--lib/gl/gettext.h8
-rw-r--r--lib/gl/lseek.c2
-rw-r--r--lib/gl/m4/00gnulib.m42
-rw-r--r--lib/gl/m4/alloca.m42
-rw-r--r--lib/gl/m4/asm-underscore.m42
-rw-r--r--lib/gl/m4/byteswap.m42
-rw-r--r--lib/gl/m4/codeset.m42
-rw-r--r--lib/gl/m4/errno_h.m46
-rw-r--r--lib/gl/m4/extensions.m42
-rw-r--r--lib/gl/m4/fcntl-o.m42
-rw-r--r--lib/gl/m4/fcntl_h.m443
-rw-r--r--lib/gl/m4/float_h.m46
-rw-r--r--lib/gl/m4/fseeko.m49
-rw-r--r--lib/gl/m4/ftello.m49
-rw-r--r--lib/gl/m4/func.m42
-rw-r--r--lib/gl/m4/getpagesize.m42
-rw-r--r--lib/gl/m4/gettext.m42
-rw-r--r--lib/gl/m4/glibc2.m43
-rw-r--r--lib/gl/m4/glibc21.m43
-rw-r--r--lib/gl/m4/gnulib-cache.m42
-rw-r--r--lib/gl/m4/gnulib-common.m424
-rw-r--r--lib/gl/m4/gnulib-comp.m416
-rw-r--r--lib/gl/m4/gnulib-tool.m42
-rw-r--r--lib/gl/m4/iconv.m42
-rw-r--r--lib/gl/m4/include_next.m499
-rw-r--r--lib/gl/m4/intdiv0.m42
-rw-r--r--lib/gl/m4/intl.m42
-rw-r--r--lib/gl/m4/intldir.m42
-rw-r--r--lib/gl/m4/intlmacosx.m42
-rw-r--r--lib/gl/m4/intmax.m42
-rw-r--r--lib/gl/m4/intmax_t.m42
-rw-r--r--lib/gl/m4/inttypes-pri.m42
-rw-r--r--lib/gl/m4/inttypes_h.m42
-rw-r--r--lib/gl/m4/lcmessage.m42
-rw-r--r--lib/gl/m4/ld-output-def.m42
-rw-r--r--lib/gl/m4/ld-version-script.m42
-rw-r--r--lib/gl/m4/lib-ld.m42
-rw-r--r--lib/gl/m4/lib-link.m46
-rw-r--r--lib/gl/m4/lib-prefix.m42
-rw-r--r--lib/gl/m4/lock.m42
-rw-r--r--lib/gl/m4/longlong.m483
-rw-r--r--lib/gl/m4/lseek.m42
-rw-r--r--lib/gl/m4/malloc.m42
-rw-r--r--lib/gl/m4/memchr.m42
-rw-r--r--lib/gl/m4/memmem.m445
-rw-r--r--lib/gl/m4/minmax.m42
-rw-r--r--lib/gl/m4/mmap-anon.m42
-rw-r--r--lib/gl/m4/multiarch.m49
-rw-r--r--lib/gl/m4/netdb_h.m45
-rw-r--r--lib/gl/m4/nls.m42
-rw-r--r--lib/gl/m4/po.m42
-rw-r--r--lib/gl/m4/printf-posix.m42
-rw-r--r--lib/gl/m4/printf.m447
-rw-r--r--lib/gl/m4/progtest.m42
-rw-r--r--lib/gl/m4/read-file.m43
-rw-r--r--lib/gl/m4/realloc.m42
-rw-r--r--lib/gl/m4/size_max.m42
-rw-r--r--lib/gl/m4/snprintf.m49
-rw-r--r--lib/gl/m4/socketlib.m42
-rw-r--r--lib/gl/m4/sockets.m42
-rw-r--r--lib/gl/m4/socklen.m42
-rw-r--r--lib/gl/m4/sockpfaf.m42
-rw-r--r--lib/gl/m4/stdbool.m416
-rw-r--r--lib/gl/m4/stddef_h.m46
-rw-r--r--lib/gl/m4/stdint.m423
-rw-r--r--lib/gl/m4/stdint_h.m42
-rw-r--r--lib/gl/m4/stdio_h.m48
-rw-r--r--lib/gl/m4/stdlib_h.m424
-rw-r--r--lib/gl/m4/strcase.m42
-rw-r--r--lib/gl/m4/string_h.m46
-rw-r--r--lib/gl/m4/strings_h.m42
-rw-r--r--lib/gl/m4/strverscmp.m42
-rw-r--r--lib/gl/m4/sys_socket_h.m416
-rw-r--r--lib/gl/m4/sys_stat_h.m42
-rw-r--r--lib/gl/m4/threadlib.m42
-rw-r--r--lib/gl/m4/time_h.m48
-rw-r--r--lib/gl/m4/time_r.m410
-rw-r--r--lib/gl/m4/uintmax_t.m42
-rw-r--r--lib/gl/m4/ungetc.m42
-rw-r--r--lib/gl/m4/unistd_h.m414
-rw-r--r--lib/gl/m4/vasnprintf.m42
-rw-r--r--lib/gl/m4/vasprintf.m42
-rw-r--r--lib/gl/m4/visibility.m42
-rw-r--r--lib/gl/m4/vsnprintf.m49
-rw-r--r--lib/gl/m4/warn-on-use.m42
-rw-r--r--lib/gl/m4/wchar_h.m4154
-rw-r--r--lib/gl/m4/wchar_t.m42
-rw-r--r--lib/gl/m4/wint_t.m42
-rw-r--r--lib/gl/m4/xsize.m42
-rw-r--r--lib/gl/malloc.c2
-rw-r--r--lib/gl/memchr.c2
-rw-r--r--lib/gl/memmem.c4
-rw-r--r--lib/gl/minmax.h2
-rw-r--r--lib/gl/netdb.in.h5
-rw-r--r--lib/gl/printf-args.c2
-rw-r--r--lib/gl/printf-args.h6
-rw-r--r--lib/gl/printf-parse.c41
-rw-r--r--lib/gl/printf-parse.h9
-rw-r--r--lib/gl/read-file.c85
-rw-r--r--lib/gl/read-file.h2
-rw-r--r--lib/gl/realloc.c2
-rw-r--r--lib/gl/size_max.h2
-rw-r--r--lib/gl/snprintf.c2
-rw-r--r--lib/gl/sockets.c2
-rw-r--r--lib/gl/sockets.h2
-rw-r--r--lib/gl/stdbool.in.h2
-rw-r--r--lib/gl/stddef.in.h2
-rw-r--r--lib/gl/stdint.in.h21
-rw-r--r--lib/gl/stdio-impl.h13
-rw-r--r--lib/gl/stdio-write.c2
-rw-r--r--lib/gl/stdio.in.h110
-rw-r--r--lib/gl/stdlib.in.h45
-rw-r--r--lib/gl/str-two-way.h2
-rw-r--r--lib/gl/strcasecmp.c2
-rw-r--r--lib/gl/string.in.h11
-rw-r--r--lib/gl/strings.in.h2
-rw-r--r--lib/gl/strncasecmp.c2
-rw-r--r--lib/gl/strverscmp.c2
-rw-r--r--lib/gl/sys_socket.in.h46
-rw-r--r--lib/gl/sys_stat.in.h8
-rw-r--r--lib/gl/tests/Makefile.am51
-rw-r--r--lib/gl/tests/binary-io.h18
-rw-r--r--lib/gl/tests/dummy.c2
-rw-r--r--lib/gl/tests/fcntl.in.h308
-rw-r--r--lib/gl/tests/getpagesize.c2
-rw-r--r--lib/gl/tests/init.sh49
-rw-r--r--lib/gl/tests/intprops.h7
-rw-r--r--lib/gl/tests/macros.h2
-rw-r--r--lib/gl/tests/signature.h2
-rw-r--r--lib/gl/tests/test-alloca-opt.c2
-rw-r--r--lib/gl/tests/test-binary-io.c2
-rw-r--r--lib/gl/tests/test-byteswap.c2
-rw-r--r--lib/gl/tests/test-c-ctype.c2
-rw-r--r--lib/gl/tests/test-errno.c2
-rw-r--r--lib/gl/tests/test-fcntl-h.c (renamed from gl/tests/test-wchar.c)21
-rw-r--r--lib/gl/tests/test-fseeko.c2
-rw-r--r--lib/gl/tests/test-ftello.c2
-rw-r--r--lib/gl/tests/test-ftello3.c2
-rw-r--r--lib/gl/tests/test-func.c2
-rw-r--r--lib/gl/tests/test-memchr.c2
-rw-r--r--lib/gl/tests/test-netdb.c2
-rw-r--r--lib/gl/tests/test-read-file.c2
-rw-r--r--lib/gl/tests/test-snprintf.c10
-rw-r--r--lib/gl/tests/test-sockets.c2
-rw-r--r--lib/gl/tests/test-stdbool.c37
-rw-r--r--lib/gl/tests/test-stddef.c2
-rw-r--r--lib/gl/tests/test-stdint.c2
-rw-r--r--lib/gl/tests/test-stdio.c2
-rw-r--r--lib/gl/tests/test-stdlib.c2
-rw-r--r--lib/gl/tests/test-string.c2
-rw-r--r--lib/gl/tests/test-strings.c2
-rw-r--r--lib/gl/tests/test-strverscmp.c2
-rw-r--r--lib/gl/tests/test-sys_socket.c2
-rw-r--r--lib/gl/tests/test-sys_stat.c2
-rw-r--r--lib/gl/tests/test-sys_wait.h2
-rw-r--r--lib/gl/tests/test-time.c2
-rw-r--r--lib/gl/tests/test-unistd.c2
-rw-r--r--lib/gl/tests/test-vasnprintf.c2
-rw-r--r--lib/gl/tests/test-vasprintf.c2
-rw-r--r--lib/gl/tests/test-verify.c2
-rw-r--r--lib/gl/tests/test-vsnprintf.c10
-rw-r--r--lib/gl/tests/zerosize-ptr.h2
-rw-r--r--lib/gl/time.in.h20
-rw-r--r--lib/gl/time_r.c2
-rw-r--r--lib/gl/unistd.in.h51
-rw-r--r--lib/gl/vasnprintf.c7
-rw-r--r--lib/gl/vasnprintf.h16
-rw-r--r--lib/gl/vasprintf.c2
-rw-r--r--lib/gl/verify.h2
-rw-r--r--lib/gl/vsnprintf.c2
-rw-r--r--lib/gl/w32sock.h2
-rw-r--r--lib/gl/wchar.in.h433
-rw-r--r--lib/gl/xsize.h2
-rwxr-xr-xlibextra/build-aux/config.rpath104
-rw-r--r--libextra/gl/gnulib.mk2
-rw-r--r--libextra/gl/hmac-md5.c2
-rw-r--r--libextra/gl/hmac.h2
-rw-r--r--libextra/gl/m4/00gnulib.m42
-rw-r--r--libextra/gl/m4/extensions.m42
-rw-r--r--libextra/gl/m4/gnulib-cache.m42
-rw-r--r--libextra/gl/m4/gnulib-common.m424
-rw-r--r--libextra/gl/m4/gnulib-comp.m42
-rw-r--r--libextra/gl/m4/gnulib-tool.m42
-rw-r--r--libextra/gl/m4/hmac-md5.m42
-rw-r--r--libextra/gl/m4/ld-output-def.m42
-rw-r--r--libextra/gl/m4/ld-version-script.m42
-rw-r--r--libextra/gl/m4/lib-ld.m42
-rw-r--r--libextra/gl/m4/lib-link.m46
-rw-r--r--libextra/gl/m4/lib-prefix.m42
-rw-r--r--libextra/gl/m4/md5.m43
-rw-r--r--libextra/gl/m4/memxor.m42
-rw-r--r--libextra/gl/md5.c4
-rw-r--r--libextra/gl/md5.h2
-rw-r--r--libextra/gl/memxor.c2
-rw-r--r--libextra/gl/memxor.h2
-rw-r--r--maint.mk55
465 files changed, 3281 insertions, 2828 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 0394d98698..6e00ec89e7 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -5,7 +5,7 @@
# It is necessary if you want to build targets usually of interest
# only to the maintainer.
-# Copyright (C) 2001, 2003, 2006-2010 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2006-2011 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/build-aux/arg-nonnull.h b/build-aux/arg-nonnull.h
index 7e3e2db82e..6c2f1e82d0 100644
--- a/build-aux/arg-nonnull.h
+++ b/build-aux/arg-nonnull.h
@@ -1,5 +1,5 @@
/* A C macro for declaring that specific arguments must not be NULL.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
@@ -9,7 +9,7 @@
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+ General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
diff --git a/build-aux/c++defs.h b/build-aux/c++defs.h
index 0c2fad7a21..b6821a64ac 100644
--- a/build-aux/c++defs.h
+++ b/build-aux/c++defs.h
@@ -1,5 +1,5 @@
/* C++ compatible function declaration macros.
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
@@ -9,7 +9,7 @@
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+ General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
diff --git a/build-aux/config.rpath b/build-aux/config.rpath
index 17298f2348..8bd7f5d726 100755
--- a/build-aux/config.rpath
+++ b/build-aux/config.rpath
@@ -2,7 +2,7 @@
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
-# Copyright 1996-2010 Free Software Foundation, Inc.
+# Copyright 1996-2011 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
@@ -57,13 +57,6 @@ else
aix*)
wl='-Wl,'
;;
- darwin*)
- case $cc_basename in
- xlc*)
- wl='-Wl,'
- ;;
- esac
- ;;
mingw* | cygwin* | pw32* | os2* | cegcc*)
;;
hpux9* | hpux10* | hpux11*)
@@ -72,9 +65,7 @@ else
irix5* | irix6* | nonstopux*)
wl='-Wl,'
;;
- newsos6)
- ;;
- linux* | k*bsd*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
ecc*)
wl='-Wl,'
@@ -85,17 +76,26 @@ else
lf95*)
wl='-Wl,'
;;
- pgcc | pgf77 | pgf90)
+ nagfor*)
+ wl='-Wl,-Wl,,'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
wl='-Wl,'
;;
ccc*)
wl='-Wl,'
;;
+ xl* | bgxl* | bgf* | mpixl*)
+ wl='-Wl,'
+ ;;
como)
wl='-lopt='
;;
*)
case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ F* | *Sun*Fortran*)
+ wl=
+ ;;
*Sun\ C*)
wl='-Wl,'
;;
@@ -103,13 +103,24 @@ else
;;
esac
;;
+ newsos6)
+ ;;
+ *nto* | *qnx*)
+ ;;
osf3* | osf4* | osf5*)
wl='-Wl,'
;;
rdos*)
;;
solaris*)
- wl='-Wl,'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ wl='-Qoption ld '
+ ;;
+ *)
+ wl='-Wl,'
+ ;;
+ esac
;;
sunos4*)
wl='-Qoption ld '
@@ -171,15 +182,14 @@ if test "$with_gnu_ld" = yes; then
fi
;;
amigaos*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we cannot use
- # them.
- ld_shlibs=no
+ case "$host_cpu" in
+ powerpc)
+ ;;
+ m68k)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
;;
beos*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
@@ -198,11 +208,13 @@ if test "$with_gnu_ld" = yes; then
ld_shlibs=no
fi
;;
+ haiku*)
+ ;;
interix[3-9]*)
hardcode_direct=no
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
- gnu* | linux* | k*bsd*-gnu)
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
@@ -325,10 +337,14 @@ else
fi
;;
amigaos*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs=no
+ case "$host_cpu" in
+ powerpc)
+ ;;
+ m68k)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
;;
bsdi[45]*)
;;
@@ -342,24 +358,15 @@ else
;;
darwin* | rhapsody*)
hardcode_direct=no
- if test "$GCC" = yes ; then
+ if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
:
else
- case $cc_basename in
- xlc*)
- ;;
- *)
- ld_shlibs=no
- ;;
- esac
+ ld_shlibs=no
fi
;;
dgux*)
hardcode_libdir_flag_spec='-L$libdir'
;;
- freebsd1*)
- ld_shlibs=no
- ;;
freebsd2.2*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
@@ -420,6 +427,8 @@ else
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
+ *nto* | *qnx*)
+ ;;
openbsd*)
if test -f /usr/libexec/ld.so; then
hardcode_direct=yes
@@ -515,7 +524,12 @@ case "$host_os" in
library_names_spec='$libname$shrext'
;;
amigaos*)
- library_names_spec='$libname.a'
+ case "$host_cpu" in
+ powerpc*)
+ library_names_spec='$libname$shrext' ;;
+ m68k)
+ library_names_spec='$libname.a' ;;
+ esac
;;
beos*)
library_names_spec='$libname$shrext'
@@ -534,8 +548,6 @@ case "$host_os" in
dgux*)
library_names_spec='$libname$shrext'
;;
- freebsd1*)
- ;;
freebsd* | dragonfly*)
case "$host_os" in
freebsd[123]*)
@@ -547,6 +559,9 @@ case "$host_os" in
gnu*)
library_names_spec='$libname$shrext'
;;
+ haiku*)
+ library_names_spec='$libname$shrext'
+ ;;
hpux9* | hpux10* | hpux11*)
case $host_cpu in
ia64*)
@@ -582,7 +597,7 @@ case "$host_os" in
;;
linux*oldld* | linux*aout* | linux*coff*)
;;
- linux* | k*bsd*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
library_names_spec='$libname$shrext'
;;
knetbsd*-gnu)
@@ -594,7 +609,7 @@ case "$host_os" in
newsos6)
library_names_spec='$libname$shrext'
;;
- nto-qnx*)
+ *nto* | *qnx*)
library_names_spec='$libname$shrext'
;;
openbsd*)
@@ -625,6 +640,9 @@ case "$host_os" in
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
library_names_spec='$libname$shrext'
;;
+ tpf*)
+ library_names_spec='$libname$shrext'
+ ;;
uts4*)
library_names_spec='$libname$shrext'
;;
diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh
index 31808419b4..34ef112e35 100755
--- a/build-aux/gendocs.sh
+++ b/build-aux/gendocs.sh
@@ -2,9 +2,10 @@
# gendocs.sh -- generate a GNU manual in many formats. This script is
# mentioned in maintain.texi. See the help message below for usage details.
-scriptversion=2010-11-27.07
+scriptversion=2010-11-29.11
-# Copyright 2003-2010 Free Software Foundation, Inc.
+# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/build-aux/pmccabe2html b/build-aux/pmccabe2html
index 1a4cdd1e21..c7cf3d0970 100644
--- a/build-aux/pmccabe2html
+++ b/build-aux/pmccabe2html
@@ -1,6 +1,6 @@
# pmccabe2html - AWK script to convert pmccabe output to html -*- awk -*-
-# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2007-2011 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/build-aux/update-copyright b/build-aux/update-copyright
index 28ff44180e..ef0b1ce668 100755
--- a/build-aux/update-copyright
+++ b/build-aux/update-copyright
@@ -3,9 +3,9 @@ eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" ${1+"$@"}'
if 0;
# Update an FSF copyright year list to include the current year.
-my $VERSION = '2009-12-28.11:09'; # UTC
+my $VERSION = '2011-01-02.20:59'; # UTC
-# Copyright (C) 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2009-2011 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -22,12 +22,16 @@ my $VERSION = '2009-12-28.11:09'; # UTC
# Written by Jim Meyering and Joel E. Denny
-# The arguments to this script should be names of files that contain FSF
-# copyright statements to be updated. For example, you might wish to
-# use the update-copyright target rule in maint.mk from gnulib's
-# maintainer-makefile module.
+# The arguments to this script should be names of files that contain
+# copyright statements to be updated. The copyright holder's name
+# defaults to "Free Softward Foundation, Inc." but may be changed to
+# any other name by using the "UPDATE_COPYRIGHT_HOLDER" environment
+# variable.
#
-# Iff an FSF copyright statement is recognized in a file and the final
+# For example, you might wish to use the update-copyright target rule
+# in maint.mk from gnulib's maintainer-makefile module.
+#
+# Iff a copyright statement is recognized in a file and the final
# year is not the current year, then the statement is updated for the
# new year and it is reformatted to:
#
@@ -36,10 +40,10 @@ my $VERSION = '2009-12-28.11:09'; # UTC
# 3. Expand copyright year intervals. (See "Environment variables"
# below.)
#
-# A warning is printed for every file for which no FSF copyright
+# A warning is printed for every file for which no copyright
# statement is recognized.
#
-# Each file's FSF copyright statement must be formated correctly in
+# Each file's copyright statement must be formated correctly in
# order to be recognized. For example, each of these is fine:
#
# Copyright @copyright{} 1990-2005, 2007-2009 Free Software
@@ -59,23 +63,17 @@ my $VERSION = '2009-12-28.11:09'; # UTC
# ## Copyright (C) 1990-2005, 2007-2009 Free Software
# # Foundation, Inc.
#
-# The following copyright statement is not recognized because the
-# copyright holder is not the FSF:
-#
-# Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
-#
-# However, any correctly formatted FSF copyright statement following
-# either of the previous two copyright statements would be recognized.
+# However, any correctly formatted copyright statement following
+# a non-matching copyright statements would be recognized.
#
-# The exact conditions that a file's FSF copyright statement must meet
+# The exact conditions that a file's copyright statement must meet
# to be recognized are:
#
-# 1. It is the first FSF copyright statement that meets all of the
-# following conditions. Subsequent FSF copyright statements are
+# 1. It is the first copyright statement that meets all of the
+# following conditions. Subsequent copyright statements are
# ignored.
# 2. Its format is "Copyright (C)", then a list of copyright years,
-# and then the name of the copyright holder, which is "Free
-# Software Foundation, Inc.".
+# and then the name of the copyright holder.
# 3. The "(C)" takes one of the following forms or is omitted
# entirely:
#
@@ -84,9 +82,9 @@ my $VERSION = '2009-12-28.11:09'; # UTC
# C. @copyright{}
# D. &copy;
#
-# 4. The "Copyright" appears at the beginning of a line except that it
+# 4. The "Copyright" appears at the beginning of a line, except that it
# may be prefixed by any sequence (e.g., a comment) of no more than
-# 5 characters.
+# 5 characters -- including white space.
# 5. Iff such a prefix is present, the same prefix appears at the
# beginning of each remaining line within the FSF copyright
# statement. There is one exception in order to support C-style
@@ -116,13 +114,16 @@ my $VERSION = '2009-12-28.11:09'; # UTC
# UPDATE_COPYRIGHT_YEAR.
# 4. The default maximum line length for a copyright line is 72.
# Set UPDATE_COPYRIGHT_MAX_LINE_LENGTH to use a different length.
+# 5. Set UPDATE_COPYRIGHT_HOLDER if the copyright holder is other
+# than "Free Software Foundation, Inc.".
use strict;
use warnings;
my $copyright_re = 'Copyright';
my $circle_c_re = '(?:\([cC]\)|@copyright{}|&copy;)';
-my $holder = 'Free Software Foundation, Inc.';
+my $holder = $ENV{UPDATE_COPYRIGHT_HOLDER};
+$holder ||= 'Free Software Foundation, Inc.';
my $prefix_max = 5;
my $margin = $ENV{UPDATE_COPYRIGHT_MAX_LINE_LENGTH};
!$margin || $margin !~ m/^\d+$/
@@ -252,7 +253,7 @@ if (defined $stmt_re)
}
else
{
- print STDERR "$ARGV: warning: FSF copyright statement not found\n";
+ print STDERR "$ARGV: warning: copyright statement not found\n";
}
# Local variables:
diff --git a/build-aux/useless-if-before-free b/build-aux/useless-if-before-free
index 6aa7d3965f..a6c228bcf4 100755
--- a/build-aux/useless-if-before-free
+++ b/build-aux/useless-if-before-free
@@ -2,17 +2,15 @@ eval '(exit $?0)' && eval 'exec perl -wST "$0" ${1+"$@"}'
& eval 'exec perl -wST "$0" $argv:q'
if 0;
# Detect instances of "if (p) free (p);".
-# Likewise for "if (p != NULL) free (p);". And with braces.
-# Also detect "if (NULL != p) free (p);".
-# And with 0 in place of NULL.
+# Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces.
-my $VERSION = '2009-04-16 15:57'; # UTC
+my $VERSION = '2011-01-09 01:39'; # UTC
# The definition above must lie within the first 8 lines in order
# for the Emacs time-stamp write hook (at end) to update it.
# If you change this file with Emacs, please let the write hook
# do its job. Otherwise, update this string manually.
-# Copyright (C) 2008-2010 Free Software Foundation, Inc.
+# Copyright (C) 2008-2011 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -63,7 +61,7 @@ detect free-like functions named FOO and BAR.
OPTIONS:
- --list print only the name of each matching FILE (\0-terminated)
+ --list print only the name of each matching FILE (\\0-terminated)
--name=N add name N to the list of \`free\'-like functions to detect;
may be repeated
diff --git a/build-aux/vc-list-files b/build-aux/vc-list-files
index 48a33ee7f4..9bb6fe6d3d 100755
--- a/build-aux/vc-list-files
+++ b/build-aux/vc-list-files
@@ -4,7 +4,7 @@
# Print a version string.
scriptversion=2010-04-23.22; # UTC
-# Copyright (C) 2006-2010 Free Software Foundation, Inc.
+# Copyright (C) 2006-2011 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/build-aux/warn-on-use.h b/build-aux/warn-on-use.h
index 171e599163..2cdeec3e66 100644
--- a/build-aux/warn-on-use.h
+++ b/build-aux/warn-on-use.h
@@ -1,5 +1,5 @@
/* A C macro for emitting warnings if a function is used.
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
@@ -9,7 +9,7 @@
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+ General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
diff --git a/gl/Makefile.am b/gl/Makefile.am
index a4c50aad10..d70be60160 100644
--- a/gl/Makefile.am
+++ b/gl/Makefile.am
@@ -1,6 +1,6 @@
## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+# Copyright (C) 2002-2011 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
@@ -124,7 +124,7 @@ BUILT_SOURCES += arpa/inet.h
# We need the following in order to create <arpa/inet.h> when the system
# doesn't have one.
-arpa/inet.h: arpa_inet.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+arpa/inet.h: arpa_inet.in.h $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
$(AM_V_at)$(MKDIR_P) arpa
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
@@ -138,6 +138,7 @@ arpa/inet.h: arpa_inet.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
-e 's|@''GNULIB_INET_PTON''@|$(GNULIB_INET_PTON)|g' \
-e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \
-e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/arpa_inet.in.h; \
@@ -729,6 +730,7 @@ stdint.h: stdint.in.h
-e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
-e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
-e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
+ -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
-e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
-e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
-e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
@@ -810,6 +812,8 @@ stdio.h: stdio.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
< $(srcdir)/stdio.in.h | \
sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
+ -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
+ -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
-e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
-e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
-e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
@@ -904,7 +908,8 @@ stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''GNULIB_SYSTEM_POSIX''@|$(GNULIB_SYSTEM_POSIX)|g' \
-e 's|@''GNULIB_UNLOCKPT''@|$(GNULIB_UNLOCKPT)|g' \
-e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \
- -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
+ < $(srcdir)/stdlib.in.h | \
+ sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
-e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
-e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \
-e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
@@ -920,14 +925,14 @@ stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
-e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \
-e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
- -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \
+ -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \
-e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
-e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
-e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \
-e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \
-e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
-e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \
- -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \
+ -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \
-e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \
-e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
-e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \
@@ -940,8 +945,7 @@ stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
- -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
- < $(srcdir)/stdlib.in.h; \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += stdlib.h stdlib.h-t
@@ -1241,7 +1245,7 @@ time.h: time.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''GNULIB_STRPTIME''@|$(GNULIB_STRPTIME)|g' \
-e 's|@''GNULIB_TIMEGM''@|$(GNULIB_TIMEGM)|g' \
-e 's|@''GNULIB_TIME_R''@|$(GNULIB_TIME_R)|g' \
- -e 's|@''HAVE_LOCALTIME_R''@|$(HAVE_LOCALTIME_R)|g' \
+ -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \
-e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
-e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
-e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
@@ -1309,6 +1313,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \
-e 's|@''GNULIB_LINKAT''@|$(GNULIB_LINKAT)|g' \
-e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
+ -e 's|@''GNULIB_PIPE''@|$(GNULIB_PIPE)|g' \
-e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \
-e 's|@''GNULIB_PREAD''@|$(GNULIB_PREAD)|g' \
-e 's|@''GNULIB_PWRITE''@|$(GNULIB_PWRITE)|g' \
@@ -1343,6 +1348,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
-e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
-e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \
+ -e 's|@''HAVE_PIPE''@|$(HAVE_PIPE)|g' \
-e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \
-e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \
-e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \
@@ -1351,23 +1357,26 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
-e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \
-e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \
- -e 's|@''HAVE_TTYNAME_R''@|$(HAVE_TTYNAME_R)|g' \
-e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
-e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
-e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
+ -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \
-e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \
-e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
-e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \
-e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \
+ -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \
-e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
-e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
- -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
+ | \
+ sed -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
-e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
-e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
-e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
-e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
-e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
-e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
+ -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
-e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
-e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
-e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
@@ -1465,68 +1474,6 @@ EXTRA_DIST += $(top_srcdir)/build-aux/warn-on-use.h
## end gnulib module warn-on-use
-## begin gnulib module wchar
-
-BUILT_SOURCES += wchar.h
-
-# We need the following in order to create <wchar.h> when the system
-# version does not work standalone.
-wchar.h: wchar.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
- $(AM_V_GEN)rm -f $@-t $@ && \
- { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
- sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
- -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
- -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
- -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
- -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
- -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \
- -e 's|@''GNULIB_BTOWC''@|$(GNULIB_BTOWC)|g' \
- -e 's|@''GNULIB_WCTOB''@|$(GNULIB_WCTOB)|g' \
- -e 's|@''GNULIB_MBSINIT''@|$(GNULIB_MBSINIT)|g' \
- -e 's|@''GNULIB_MBRTOWC''@|$(GNULIB_MBRTOWC)|g' \
- -e 's|@''GNULIB_MBRLEN''@|$(GNULIB_MBRLEN)|g' \
- -e 's|@''GNULIB_MBSRTOWCS''@|$(GNULIB_MBSRTOWCS)|g' \
- -e 's|@''GNULIB_MBSNRTOWCS''@|$(GNULIB_MBSNRTOWCS)|g' \
- -e 's|@''GNULIB_WCRTOMB''@|$(GNULIB_WCRTOMB)|g' \
- -e 's|@''GNULIB_WCSRTOMBS''@|$(GNULIB_WCSRTOMBS)|g' \
- -e 's|@''GNULIB_WCSNRTOMBS''@|$(GNULIB_WCSNRTOMBS)|g' \
- -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \
- -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
- -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
- -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \
- -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \
- -e 's|@''HAVE_MBRLEN''@|$(HAVE_MBRLEN)|g' \
- -e 's|@''HAVE_MBSRTOWCS''@|$(HAVE_MBSRTOWCS)|g' \
- -e 's|@''HAVE_MBSNRTOWCS''@|$(HAVE_MBSNRTOWCS)|g' \
- -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \
- -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \
- -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \
- -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \
- -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
- -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
- -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \
- -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \
- -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \
- -e 's|@''REPLACE_MBRTOWC''@|$(REPLACE_MBRTOWC)|g' \
- -e 's|@''REPLACE_MBRLEN''@|$(REPLACE_MBRLEN)|g' \
- -e 's|@''REPLACE_MBSRTOWCS''@|$(REPLACE_MBSRTOWCS)|g' \
- -e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \
- -e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \
- -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \
- -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \
- -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
- -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
- -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
- -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
- < $(srcdir)/wchar.in.h; \
- } > $@-t && \
- mv $@-t $@
-MOSTLYCLEANFILES += wchar.h wchar.h-t
-
-EXTRA_DIST += wchar.in.h
-
-## end gnulib module wchar
-
## begin gnulib module xsize
libgnu_la_SOURCES += xsize.h
diff --git a/gl/accept.c b/gl/accept.c
index a68f7dcfc0..5591fa50a4 100644
--- a/gl/accept.c
+++ b/gl/accept.c
@@ -1,6 +1,6 @@
/* accept.c --- wrappers for Windows accept function
- Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/alignof.h b/gl/alignof.h
index 240468c682..03bed6f4a9 100644
--- a/gl/alignof.h
+++ b/gl/alignof.h
@@ -1,5 +1,5 @@
/* Determine alignment of types.
- Copyright (C) 2003-2004, 2006, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 2003-2004, 2006, 2009-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/alloca.c b/gl/alloca.c
index 75afdb9607..771c2faa34 100644
--- a/gl/alloca.c
+++ b/gl/alloca.c
@@ -94,21 +94,20 @@ static int stack_dir; /* 1 or -1 once known. */
# define STACK_DIR stack_dir
static void
-find_stack_direction (void)
+find_stack_direction (char **ptr)
{
- static char *addr = NULL; /* Address of first `dummy', once known. */
auto char dummy; /* To get stack address. */
- if (addr == NULL)
+ if (*ptr == NULL)
{ /* Initial entry. */
- addr = ADDRESS_FUNCTION (dummy);
+ *ptr = ADDRESS_FUNCTION (dummy);
- find_stack_direction (); /* Recurse once. */
+ find_stack_direction (ptr); /* Recurse once. */
}
else
{
/* Second entry. */
- if (ADDRESS_FUNCTION (dummy) > addr)
+ if (ADDRESS_FUNCTION (dummy) > *ptr)
stack_dir = 1; /* Stack grew upward. */
else
stack_dir = -1; /* Stack grew downward. */
@@ -155,7 +154,10 @@ alloca (size_t size)
# if STACK_DIRECTION == 0
if (STACK_DIR == 0) /* Unknown growth direction. */
- find_stack_direction ();
+ {
+ char *addr = NULL; /* Address of first `dummy', once known. */
+ find_stack_direction (&addr);
+ }
# endif
/* Reclaim garbage, defined as all alloca'd storage that
diff --git a/gl/alloca.in.h b/gl/alloca.in.h
index 44f20b7a1a..5b69c6c81a 100644
--- a/gl/alloca.in.h
+++ b/gl/alloca.in.h
@@ -1,6 +1,6 @@
/* Memory allocation on the stack.
- Copyright (C) 1995, 1999, 2001-2004, 2006-2010 Free Software Foundation,
+ Copyright (C) 1995, 1999, 2001-2004, 2006-2011 Free Software Foundation,
Inc.
This program is free software; you can redistribute it and/or modify it
diff --git a/gl/arpa_inet.in.h b/gl/arpa_inet.in.h
index f17d642b84..1470f866b8 100644
--- a/gl/arpa_inet.in.h
+++ b/gl/arpa_inet.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <arpa/inet.h>.
- Copyright (C) 2005-2006, 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2008-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -34,6 +34,12 @@
# include <sys/socket.h>
#endif
+/* On NonStop Kernel, inet_ntop and inet_pton are declared in <netdb.h>.
+ But avoid namespace pollution on glibc systems. */
+#if defined __TANDEM && !defined __GLIBC__
+# include <netdb.h>
+#endif
+
#if @HAVE_ARPA_INET_H@
/* The include_next requires a split double-inclusion guard. */
@@ -44,13 +50,12 @@
#ifndef _GL_ARPA_INET_H
#define _GL_ARPA_INET_H
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
/* The definition of _GL_ARG_NONNULL is copied here. */
/* The definition of _GL_WARN_ON_USE is copied here. */
-#ifdef __cplusplus
-extern "C" {
-#endif
#if @GNULIB_INET_NTOP@
# if !@HAVE_DECL_INET_NTOP@
@@ -69,10 +74,17 @@ extern "C" {
For more details, see the POSIX:2001 specification
<http://www.opengroup.org/susv3xsh/inet_ntop.html>. */
-extern const char *inet_ntop (int af, const void *restrict src,
- char *restrict dst, socklen_t cnt)
- _GL_ARG_NONNULL ((2, 3));
+_GL_FUNCDECL_SYS (inet_ntop, const char *,
+ (int af, const void *restrict src,
+ char *restrict dst, socklen_t cnt)
+ _GL_ARG_NONNULL ((2, 3)));
# endif
+/* Need to cast, because on NonStop Kernel, the fourth parameter is
+ size_t cnt. */
+_GL_CXXALIAS_SYS_CAST (inet_ntop, const char *,
+ (int af, const void *restrict src,
+ char *restrict dst, socklen_t cnt));
+_GL_CXXALIASWARN (inet_ntop);
#elif defined GNULIB_POSIXCHECK
# undef inet_ntop
# if HAVE_RAW_DECL_INET_NTOP
@@ -83,9 +95,13 @@ _GL_WARN_ON_USE (inet_ntop, "inet_ntop is unportable - "
#if @GNULIB_INET_PTON@
# if !@HAVE_DECL_INET_PTON@
-extern int inet_pton (int af, const char *restrict src, void *restrict dst)
- _GL_ARG_NONNULL ((2, 3));
+_GL_FUNCDECL_SYS (inet_pton, int,
+ (int af, const char *restrict src, void *restrict dst)
+ _GL_ARG_NONNULL ((2, 3)));
# endif
+_GL_CXXALIAS_SYS (inet_pton, int,
+ (int af, const char *restrict src, void *restrict dst));
+_GL_CXXALIASWARN (inet_pton);
#elif defined GNULIB_POSIXCHECK
# undef inet_pton
# if HAVE_RAW_DECL_INET_PTON
@@ -94,9 +110,6 @@ _GL_WARN_ON_USE (inet_pton, "inet_pton is unportable - "
# endif
#endif
-#ifdef __cplusplus
-}
-#endif
#endif /* _GL_ARPA_INET_H */
#endif /* _GL_ARPA_INET_H */
diff --git a/gl/asnprintf.c b/gl/asnprintf.c
index 3bd2229d52..e4fd95c6ee 100644
--- a/gl/asnprintf.c
+++ b/gl/asnprintf.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 1999, 2002, 2006, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2006, 2009-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/bind.c b/gl/bind.c
index b974d63c8a..e6d959dce5 100644
--- a/gl/bind.c
+++ b/gl/bind.c
@@ -1,6 +1,6 @@
/* bind.c --- wrappers for Windows bind function
- Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/c-ctype.c b/gl/c-ctype.c
index 0d8da205b6..0fb42953ab 100644
--- a/gl/c-ctype.c
+++ b/gl/c-ctype.c
@@ -1,6 +1,6 @@
/* Character handling in C locale.
- Copyright 2000-2003, 2006, 2009-2010 Free Software Foundation, Inc.
+ Copyright 2000-2003, 2006, 2009-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/c-ctype.h b/gl/c-ctype.h
index 0eb27e659b..57e71ee02c 100644
--- a/gl/c-ctype.h
+++ b/gl/c-ctype.h
@@ -5,7 +5,7 @@
<ctype.h> functions' behaviour depends on the current locale set via
setlocale.
- Copyright (C) 2000-2003, 2006, 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2000-2003, 2006, 2008-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/close-hook.c b/gl/close-hook.c
index 0253c4dc59..ecc5f46cdb 100644
--- a/gl/close-hook.c
+++ b/gl/close-hook.c
@@ -1,5 +1,5 @@
/* Hook for making the close() function extensible.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2009.
This program is free software: you can redistribute it and/or modify it
@@ -10,7 +10,7 @@
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+ General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
diff --git a/gl/close-hook.h b/gl/close-hook.h
index 1e115516d6..283bebbe3f 100644
--- a/gl/close-hook.h
+++ b/gl/close-hook.h
@@ -1,5 +1,5 @@
/* Hook for making the close() function extensible.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
@@ -9,7 +9,7 @@
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+ General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
diff --git a/gl/close.c b/gl/close.c
index afa8f64058..1c06c166f7 100644
--- a/gl/close.c
+++ b/gl/close.c
@@ -1,5 +1,5 @@
/* close replacement.
- Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/connect.c b/gl/connect.c
index 70a5ff6d06..ea03e77bc0 100644
--- a/gl/connect.c
+++ b/gl/connect.c
@@ -1,6 +1,6 @@
/* connect.c --- wrappers for Windows connect function
- Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/errno.in.h b/gl/errno.in.h
index 7ebaddcfc2..a91f5912ea 100644
--- a/gl/errno.in.h
+++ b/gl/errno.in.h
@@ -1,6 +1,6 @@
/* A POSIX-like <errno.h>.
- Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/error.c b/gl/error.c
index ed9dba0d27..a2d1c1be33 100644
--- a/gl/error.c
+++ b/gl/error.c
@@ -1,5 +1,5 @@
/* Error handler for noninteractive utilities
- Copyright (C) 1990-1998, 2000-2007, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 1990-1998, 2000-2007, 2009-2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software: you can redistribute it and/or modify
diff --git a/gl/error.h b/gl/error.h
index 9deef02d2f..80f81bcef2 100644
--- a/gl/error.h
+++ b/gl/error.h
@@ -1,6 +1,6 @@
/* Declaration for error-reporting function
- Copyright (C) 1995, 1996, 1997, 2003, 2006, 2008, 2009, 2010 Free Software
- Foundation, Inc.
+ Copyright (C) 1995-1997, 2003, 2006, 2008-2011 Free Software Foundation,
+ Inc.
This file is part of the GNU C Library.
This program is free software: you can redistribute it and/or modify
@@ -19,16 +19,16 @@
#ifndef _ERROR_H
#define _ERROR_H 1
-#ifndef __attribute__
/* The __attribute__ feature is available in gcc versions 2.5 and later.
The __-protected variants of the attributes 'format' and 'printf' are
accepted by gcc versions 2.6.4 (effectively 2.7) and later.
- We enable __attribute__ only if these are supported too, because
+ We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
gnulib and libintl do '#define printf __printf__' when they override
the 'printf' function. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-# define __attribute__(Spec) /* empty */
-# endif
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+#else
+# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
#endif
#ifdef __cplusplus
@@ -40,11 +40,11 @@ extern "C" {
If STATUS is nonzero, terminate the program with `exit (STATUS)'. */
extern void error (int __status, int __errnum, const char *__format, ...)
- __attribute__ ((__format__ (__printf__, 3, 4)));
+ _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 4));
extern void error_at_line (int __status, int __errnum, const char *__fname,
unsigned int __lineno, const char *__format, ...)
- __attribute__ ((__format__ (__printf__, 5, 6)));
+ _GL_ATTRIBUTE_FORMAT ((__printf__, 5, 6));
/* If NULL, error will flush stdout, then print on stderr the program
name, a colon and a space. Otherwise, error will call this
diff --git a/gl/fclose.c b/gl/fclose.c
index 9f4388912a..1d7e85b668 100644
--- a/gl/fclose.c
+++ b/gl/fclose.c
@@ -1,5 +1,5 @@
/* fclose replacement.
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/float+.h b/gl/float+.h
index bf6714ae10..2e844890c9 100644
--- a/gl/float+.h
+++ b/gl/float+.h
@@ -1,5 +1,5 @@
/* Supplemental information about the floating-point formats.
- Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2007.
This program is free software; you can redistribute it and/or modify
diff --git a/gl/float.in.h b/gl/float.in.h
index a68ec61a96..d32f20ee4d 100644
--- a/gl/float.in.h
+++ b/gl/float.in.h
@@ -1,6 +1,6 @@
/* A correct <float.h>.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/fseeko.c b/gl/fseeko.c
index 05a7384c07..2dd4cdcd94 100644
--- a/gl/fseeko.c
+++ b/gl/fseeko.c
@@ -1,5 +1,5 @@
/* An fseeko() function that, together with fflush(), is POSIX compliant.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -69,7 +69,7 @@ fseeko (FILE *fp, off_t offset, int whence)
&& fp->_rcount == 0
&& fp->_wcount == 0
&& fp->_ungetc_count == 0)
-#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
+#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */
if (fp_->_ptr == fp_->_base
&& (fp_->_ptr == NULL || fp_->_cnt == 0))
#elif defined __UCLIBC__ /* uClibc */
@@ -131,7 +131,7 @@ fseeko (FILE *fp, off_t offset, int whence)
fp_->_flags &= ~__SEOF;
#elif defined __EMX__ /* emx+gcc */
fp->_flags &= ~_IOEOF;
-#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
+#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */
fp->_flag &= ~_IOEOF;
#elif defined __MINT__ /* Atari FreeMiNT */
fp->__offset = pos;
diff --git a/gl/ftello.c b/gl/ftello.c
index 098e36ae58..fbdc44f2ea 100644
--- a/gl/ftello.c
+++ b/gl/ftello.c
@@ -1,5 +1,5 @@
/* An ftello() function that works around platform bugs.
- Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -50,7 +50,7 @@ ftello (FILE *fp)
ftello (fp);
/* Compute the file position ourselves. */
- pos = llseek (fileno (fp), (off_t) 0, SEEK_CUR);
+ pos = lseek (fileno (fp), (off_t) 0, SEEK_CUR);
if (pos >= 0)
{
if ((fp_->_flag & _IONBF) == 0 && fp_->_base != NULL)
diff --git a/gl/gai_strerror.c b/gl/gai_strerror.c
index c05b5c47ee..402ba6f745 100644
--- a/gl/gai_strerror.c
+++ b/gl/gai_strerror.c
@@ -1,5 +1,5 @@
-/* Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2008, 2009, 2010 Free
- Software Foundation, Inc.
+/* Copyright (C) 1997, 2001-2002, 2004-2006, 2008-2011 Free Software
+ Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Philip Blundell <pjb27@cam.ac.uk>, 1997.
diff --git a/gl/getaddrinfo.c b/gl/getaddrinfo.c
index 4734606a47..99b29ec88c 100644
--- a/gl/getaddrinfo.c
+++ b/gl/getaddrinfo.c
@@ -1,5 +1,5 @@
/* Get address information (partial implementation).
- Copyright (C) 1997, 2001-2002, 2004-2010 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2001-2002, 2004-2011 Free Software Foundation, Inc.
Contributed by Simon Josefsson <simon@josefsson.org>.
This program is free software; you can redistribute it and/or modify
diff --git a/gl/getdelim.c b/gl/getdelim.c
index 66d07b9ae0..14a8bce818 100644
--- a/gl/getdelim.c
+++ b/gl/getdelim.c
@@ -1,6 +1,6 @@
/* getdelim.c --- Implementation of replacement getdelim function.
- Copyright (C) 1994, 1996, 1997, 1998, 2001, 2003, 2005, 2006, 2007, 2008,
- 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1996-1998, 2001, 2003, 2005-2011 Free Software
+ Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
diff --git a/gl/getline.c b/gl/getline.c
index 30c076e870..e6e918724d 100644
--- a/gl/getline.c
+++ b/gl/getline.c
@@ -1,5 +1,5 @@
/* getline.c --- Implementation of replacement getline function.
- Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2005-2007, 2009-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
diff --git a/gl/getpass.c b/gl/getpass.c
index e9b4eb9b1b..37b35b308e 100644
--- a/gl/getpass.c
+++ b/gl/getpass.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2001, 2003-2007, 2009-2010 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2001, 2003-2007, 2009-2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/gl/getpass.h b/gl/getpass.h
index 6a54261afe..f1e67b5aa6 100644
--- a/gl/getpass.h
+++ b/gl/getpass.h
@@ -1,5 +1,5 @@
/* getpass.h -- Read a password of arbitrary length from /dev/tty or stdin.
- Copyright (C) 2004, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2009-2011 Free Software Foundation, Inc.
Contributed by Simon Josefsson <jas@extundo.com>, 2004.
This program is free software; you can redistribute it and/or modify
diff --git a/gl/gettext.h b/gl/gettext.h
index f08759e186..88d9867e39 100644
--- a/gl/gettext.h
+++ b/gl/gettext.h
@@ -1,5 +1,5 @@
/* Convenience header for conditional use of GNU <libintl.h>.
- Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2010 Free Software
+ Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2011 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -93,6 +93,12 @@
#endif
+/* Prefer gnulib's setlocale override over libintl's setlocale override. */
+#ifdef GNULIB_defined_setlocale
+# undef setlocale
+# define setlocale rpl_setlocale
+#endif
+
/* A pseudo function call that serves as a marker for the automated
extraction of messages, but does not call gettext(). The run-time
translation is done at a different place in the code.
diff --git a/gl/gettime.c b/gl/gettime.c
index 044b26f0f3..6dbb4574c6 100644
--- a/gl/gettime.c
+++ b/gl/gettime.c
@@ -1,6 +1,6 @@
/* gettime -- get the system clock
- Copyright (C) 2002, 2004-2007, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004-2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/gettimeofday.c b/gl/gettimeofday.c
index 74fc558139..e4ce95107d 100644
--- a/gl/gettimeofday.c
+++ b/gl/gettimeofday.c
@@ -1,6 +1,6 @@
/* Provide gettimeofday for systems that don't have it or for which it's broken.
- Copyright (C) 2001-2003, 2005-2007, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2005-2007, 2009-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/inet_ntop.c b/gl/inet_ntop.c
index 8746114bbe..c1b3b704d8 100644
--- a/gl/inet_ntop.c
+++ b/gl/inet_ntop.c
@@ -1,6 +1,6 @@
/* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
- Copyright (C) 2005-2006, 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2008-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/inet_pton.c b/gl/inet_pton.c
index d8a2dee0ff..8b38e8091d 100644
--- a/gl/inet_pton.c
+++ b/gl/inet_pton.c
@@ -1,6 +1,6 @@
/* inet_pton.c -- convert IPv4 and IPv6 addresses from text to binary form
- Copyright (C) 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/intprops.h b/gl/intprops.h
index 0c2787582f..58b1b3fbf4 100644
--- a/gl/intprops.h
+++ b/gl/intprops.h
@@ -1,7 +1,6 @@
/* intprops.h -- properties of integer types
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009, 2010 Free Software
- Foundation, Inc.
+ Copyright (C) 2001-2005, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -50,11 +49,11 @@
? (t) 0 \
: TYPE_SIGNED_MAGNITUDE (t) \
? ~ (t) 0 \
- : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
+ : ~ TYPE_MAXIMUM (t)))
# define TYPE_MAXIMUM(t) \
((t) (! TYPE_SIGNED (t) \
? (t) -1 \
- : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
+ : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
/* Return zero if T can be determined to be an unsigned type.
Otherwise, return 1.
diff --git a/gl/listen.c b/gl/listen.c
index 4a77de22ea..938aa75460 100644
--- a/gl/listen.c
+++ b/gl/listen.c
@@ -1,6 +1,6 @@
/* listen.c --- wrappers for Windows listen function
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/lseek.c b/gl/lseek.c
index 0d5376ab34..8339044ba8 100644
--- a/gl/lseek.c
+++ b/gl/lseek.c
@@ -1,5 +1,5 @@
/* An lseek() function that detects pipes.
- Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/m4/00gnulib.m4 b/gl/m4/00gnulib.m4
index 301469b31c..7feed46694 100644
--- a/gl/m4/00gnulib.m4
+++ b/gl/m4/00gnulib.m4
@@ -1,5 +1,5 @@
# 00gnulib.m4 serial 2
-dnl Copyright (C) 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2011 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.
diff --git a/gl/m4/alloca.m4 b/gl/m4/alloca.m4
index 80d67aad77..e2e8a05a6e 100644
--- a/gl/m4/alloca.m4
+++ b/gl/m4/alloca.m4
@@ -1,5 +1,5 @@
# alloca.m4 serial 10
-dnl Copyright (C) 2002-2004, 2006-2007, 2009-2010 Free Software Foundation,
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2011 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/arpa_inet_h.m4 b/gl/m4/arpa_inet_h.m4
index 80fdb406b6..d21b162fc7 100644
--- a/gl/m4/arpa_inet_h.m4
+++ b/gl/m4/arpa_inet_h.m4
@@ -1,5 +1,5 @@
-# arpa_inet_h.m4 serial 10
-dnl Copyright (C) 2006, 2008-2010 Free Software Foundation, Inc.
+# arpa_inet_h.m4 serial 11
+dnl Copyright (C) 2006, 2008-2011 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.
@@ -31,6 +31,9 @@ AC_DEFUN([gl_HEADER_ARPA_INET],
#if !(defined __GLIBC__ || defined __UCLIBC__)
# include <sys/socket.h>
#endif
+#ifdef __TANDEM
+# include <netdb.h>
+#endif
#include <arpa/inet.h>
]], [inet_ntop inet_pton])
])
diff --git a/gl/m4/asm-underscore.m4 b/gl/m4/asm-underscore.m4
index 1736cc432a..15c89cca91 100644
--- a/gl/m4/asm-underscore.m4
+++ b/gl/m4/asm-underscore.m4
@@ -1,5 +1,5 @@
# asm-underscore.m4 serial 1
-dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2011 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.
diff --git a/gl/m4/autobuild.m4 b/gl/m4/autobuild.m4
index 93ccb5468a..04971d409d 100644
--- a/gl/m4/autobuild.m4
+++ b/gl/m4/autobuild.m4
@@ -1,6 +1,5 @@
# autobuild.m4 serial 7
-dnl Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-dnl Inc.
+dnl Copyright (C) 2004, 2006-2011 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.
diff --git a/gl/m4/clock_time.m4 b/gl/m4/clock_time.m4
index 8be179db87..3c085129c1 100644
--- a/gl/m4/clock_time.m4
+++ b/gl/m4/clock_time.m4
@@ -1,5 +1,5 @@
# clock_time.m4 serial 10
-dnl Copyright (C) 2002-2006, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2011 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.
diff --git a/gl/m4/close.m4 b/gl/m4/close.m4
index 1ee3add9b9..fc131381af 100644
--- a/gl/m4/close.m4
+++ b/gl/m4/close.m4
@@ -1,5 +1,5 @@
# close.m4 serial 5
-dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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.
diff --git a/gl/m4/errno_h.m4 b/gl/m4/errno_h.m4
index e4325ac660..687bafff2d 100644
--- a/gl/m4/errno_h.m4
+++ b/gl/m4/errno_h.m4
@@ -1,5 +1,5 @@
-# errno_h.m4 serial 7
-dnl Copyright (C) 2004, 2006, 2008-2010 Free Software Foundation, Inc.
+# errno_h.m4 serial 8
+dnl Copyright (C) 2004, 2006, 2008-2011 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.
@@ -50,7 +50,7 @@ booboo
if test $gl_cv_header_errno_h_complete = yes; then
ERRNO_H=''
else
- gl_CHECK_NEXT_HEADERS([errno.h])
+ gl_NEXT_HEADERS([errno.h])
ERRNO_H='errno.h'
fi
AC_SUBST([ERRNO_H])
diff --git a/gl/m4/error.m4 b/gl/m4/error.m4
index dd5a197b6e..6ea75ac029 100644
--- a/gl/m4/error.m4
+++ b/gl/m4/error.m4
@@ -1,6 +1,6 @@
#serial 13
-# Copyright (C) 1996-1998, 2001-2004, 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 1996-1998, 2001-2004, 2009-2011 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/extensions.m4 b/gl/m4/extensions.m4
index 7d9458a8d6..1330503f0d 100644
--- a/gl/m4/extensions.m4
+++ b/gl/m4/extensions.m4
@@ -1,7 +1,7 @@
# serial 9 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
-# Copyright (C) 2003, 2006-2010 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2011 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/fclose.m4 b/gl/m4/fclose.m4
index 85de629423..278859c6c2 100644
--- a/gl/m4/fclose.m4
+++ b/gl/m4/fclose.m4
@@ -1,5 +1,5 @@
# fclose.m4 serial 2
-dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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.
diff --git a/gl/m4/fcntl-o.m4 b/gl/m4/fcntl-o.m4
new file mode 100644
index 0000000000..88db07ec73
--- /dev/null
+++ b/gl/m4/fcntl-o.m4
@@ -0,0 +1,112 @@
+# fcntl-o.m4 serial 3
+dnl Copyright (C) 2006, 2009-2011 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.
+
+dnl Written by Paul Eggert.
+
+# Test whether the flags O_NOATIME and O_NOFOLLOW actually work.
+# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise.
+# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise.
+AC_DEFUN([gl_FCNTL_O_FLAGS],
+[
+ dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
+ dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
+ dnl AC_GNU_SOURCE.
+ m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
+ [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
+ [AC_REQUIRE([AC_GNU_SOURCE])])
+ AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
+ #include <fcntl.h>
+ #ifndef O_NOATIME
+ #define O_NOATIME 0
+ #endif
+ #ifndef O_NOFOLLOW
+ #define O_NOFOLLOW 0
+ #endif
+ static int const constants[] =
+ {
+ O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
+ O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
+ };
+ ]],
+ [[
+ int result = !constants;
+ {
+ static char const sym[] = "conftest.sym";
+ if (symlink (".", sym) != 0)
+ result |= 2;
+ else
+ {
+ int fd = open (sym, O_RDONLY | O_NOFOLLOW);
+ if (fd >= 0)
+ {
+ close (fd);
+ result |= 4;
+ }
+ }
+ unlink (sym);
+ }
+ {
+ static char const file[] = "confdefs.h";
+ int fd = open (file, O_RDONLY | O_NOATIME);
+ if (fd < 0)
+ result |= 8;
+ else
+ {
+ struct stat st0;
+ if (fstat (fd, &st0) != 0)
+ result |= 16;
+ else
+ {
+ char c;
+ sleep (1);
+ if (read (fd, &c, 1) != 1)
+ result |= 24;
+ else
+ {
+ if (close (fd) != 0)
+ result |= 32;
+ else
+ {
+ struct stat st1;
+ if (stat (file, &st1) != 0)
+ result |= 40;
+ else
+ if (st0.st_atime != st1.st_atime)
+ result |= 64;
+ }
+ }
+ }
+ }
+ }
+ return result;]])],
+ [gl_cv_header_working_fcntl_h=yes],
+ [case $? in #(
+ 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
+ 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
+ 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
+ *) gl_cv_header_working_fcntl_h='no';;
+ esac],
+ [gl_cv_header_working_fcntl_h=cross-compiling])])
+
+ case $gl_cv_header_working_fcntl_h in #(
+ *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
+ *) ac_val=1;;
+ esac
+ AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val],
+ [Define to 1 if O_NOATIME works.])
+
+ case $gl_cv_header_working_fcntl_h in #(
+ *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
+ *) ac_val=1;;
+ esac
+ AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val],
+ [Define to 1 if O_NOFOLLOW works.])
+])
diff --git a/gl/m4/fcntl_h.m4 b/gl/m4/fcntl_h.m4
new file mode 100644
index 0000000000..1ef4f455b7
--- /dev/null
+++ b/gl/m4/fcntl_h.m4
@@ -0,0 +1,43 @@
+# serial 13
+# Configure fcntl.h.
+dnl Copyright (C) 2006-2007, 2009-2011 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.
+
+dnl Written by Paul Eggert.
+
+AC_DEFUN([gl_FCNTL_H],
+[
+ AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+ AC_REQUIRE([gl_FCNTL_O_FLAGS])
+ gl_NEXT_HEADERS([fcntl.h])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use, if it is not common
+ dnl enough to be declared everywhere.
+ gl_WARN_ON_USE_PREPARE([[#include <fcntl.h>
+ ]], [fcntl openat])
+])
+
+AC_DEFUN([gl_FCNTL_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_FCNTL_H_DEFAULTS],
+[
+ GNULIB_FCNTL=0; AC_SUBST([GNULIB_FCNTL])
+ GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN])
+ GNULIB_OPENAT=0; AC_SUBST([GNULIB_OPENAT])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL])
+ HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT])
+ REPLACE_FCNTL=0; AC_SUBST([REPLACE_FCNTL])
+ REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN])
+ REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT])
+])
diff --git a/gl/m4/float_h.m4 b/gl/m4/float_h.m4
index f6099db405..265a4c1a6e 100644
--- a/gl/m4/float_h.m4
+++ b/gl/m4/float_h.m4
@@ -1,5 +1,5 @@
-# float_h.m4 serial 4
-dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+# float_h.m4 serial 5
+dnl Copyright (C) 2007, 2009-2011 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.
@@ -12,7 +12,7 @@ AC_DEFUN([gl_FLOAT_H],
case "$host_os" in
beos* | openbsd* | mirbsd*)
FLOAT_H=float.h
- gl_CHECK_NEXT_HEADERS([float.h])
+ gl_NEXT_HEADERS([float.h])
;;
esac
AC_SUBST([FLOAT_H])
diff --git a/gl/m4/fseeko.m4 b/gl/m4/fseeko.m4
index b97df53377..4a672606a7 100644
--- a/gl/m4/fseeko.m4
+++ b/gl/m4/fseeko.m4
@@ -1,5 +1,5 @@
-# fseeko.m4 serial 9
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# fseeko.m4 serial 10
+dnl Copyright (C) 2007-2011 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.
@@ -10,6 +10,11 @@ AC_DEFUN([gl_FUNC_FSEEKO],
AC_REQUIRE([gl_HAVE_FSEEKO])
AC_REQUIRE([gl_STDIN_LARGE_OFFSET])
+ AC_CHECK_DECLS_ONCE([fseeko])
+ if test $ac_cv_have_decl_fseeko = no; then
+ HAVE_DECL_FSEEKO=0
+ fi
+
if test $gl_cv_func_fseeko = no; then
HAVE_FSEEKO=0
gl_REPLACE_FSEEKO
diff --git a/gl/m4/ftello.m4 b/gl/m4/ftello.m4
index 33201a0107..599f8f2047 100644
--- a/gl/m4/ftello.m4
+++ b/gl/m4/ftello.m4
@@ -1,5 +1,5 @@
-# ftello.m4 serial 8
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# ftello.m4 serial 9
+dnl Copyright (C) 2007-2011 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.
@@ -13,6 +13,11 @@ AC_DEFUN([gl_FUNC_FTELLO],
dnl Persuade glibc <stdio.h> to declare ftello().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_DECLS_ONCE([ftello])
+ if test $ac_cv_have_decl_ftello = no; then
+ HAVE_DECL_FTELLO=0
+ fi
+
AC_CACHE_CHECK([for ftello], [gl_cv_func_ftello],
[
AC_LINK_IFELSE(
diff --git a/gl/m4/getaddrinfo.m4 b/gl/m4/getaddrinfo.m4
index bc3066db18..94c276f836 100644
--- a/gl/m4/getaddrinfo.m4
+++ b/gl/m4/getaddrinfo.m4
@@ -1,5 +1,5 @@
# getaddrinfo.m4 serial 23
-dnl Copyright (C) 2004-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2011 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.
diff --git a/gl/m4/getdelim.m4 b/gl/m4/getdelim.m4
index 49c14444a7..ef1273668b 100644
--- a/gl/m4/getdelim.m4
+++ b/gl/m4/getdelim.m4
@@ -1,6 +1,6 @@
# getdelim.m4 serial 8
-dnl Copyright (C) 2005-2007, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2007, 2009-2011 Free Software Foundation, Inc.
dnl
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/getline.m4 b/gl/m4/getline.m4
index 8f6c5851b4..ec001b91be 100644
--- a/gl/m4/getline.m4
+++ b/gl/m4/getline.m4
@@ -1,6 +1,6 @@
# getline.m4 serial 23
-dnl Copyright (C) 1998-2003, 2005-2007, 2009-2010 Free Software Foundation,
+dnl Copyright (C) 1998-2003, 2005-2007, 2009-2011 Free Software Foundation,
dnl Inc.
dnl
dnl This file is free software; the Free Software Foundation
diff --git a/gl/m4/getpagesize.m4 b/gl/m4/getpagesize.m4
index 313ad7fa26..79dfbbe493 100644
--- a/gl/m4/getpagesize.m4
+++ b/gl/m4/getpagesize.m4
@@ -1,5 +1,5 @@
# getpagesize.m4 serial 8
-dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2010 Free Software Foundation,
+dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2011 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/getpass.m4 b/gl/m4/getpass.m4
index 8072e46442..c6ec427f08 100644
--- a/gl/m4/getpass.m4
+++ b/gl/m4/getpass.m4
@@ -1,5 +1,5 @@
# getpass.m4 serial 12
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2010 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2011 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/gettime.m4 b/gl/m4/gettime.m4
index 9e7fde4272..2b148abb5c 100644
--- a/gl/m4/gettime.m4
+++ b/gl/m4/gettime.m4
@@ -1,5 +1,5 @@
# gettime.m4 serial 7
-dnl Copyright (C) 2002, 2004-2006, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2004-2006, 2009-2011 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.
diff --git a/gl/m4/gettimeofday.m4 b/gl/m4/gettimeofday.m4
index 709a4d4fb4..84acadf216 100644
--- a/gl/m4/gettimeofday.m4
+++ b/gl/m4/gettimeofday.m4
@@ -1,6 +1,6 @@
# serial 15
-# Copyright (C) 2001-2003, 2005, 2007, 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2001-2003, 2005, 2007, 2009-2011 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4
index 0987814cfe..60d45ee920 100644
--- a/gl/m4/gnulib-cache.m4
+++ b/gl/m4/gnulib-cache.m4
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+# Copyright (C) 2002-2011 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4
index d0c8b66287..ecbf33694e 100644
--- a/gl/m4/gnulib-common.m4
+++ b/gl/m4/gnulib-common.m4
@@ -1,5 +1,5 @@
-# gnulib-common.m4 serial 21
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# gnulib-common.m4 serial 23
+dnl Copyright (C) 2007-2011 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.
@@ -102,6 +102,26 @@ AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS],
[Define to 1 when the gnulib module $1 should be tested.])
])
+# gl_ASSERT_NO_GNULIB_POSIXCHECK
+# asserts that there will never be a need to #define GNULIB_POSIXCHECK.
+# and thereby enables an optimization of configure and config.h.
+# Used by Emacs.
+AC_DEFUN([gl_ASSERT_NO_GNULIB_POSIXCHECK],
+[
+ dnl Override gl_WARN_ON_USE_PREPARE.
+ AC_DEFUN([gl_WARN_ON_USE_PREPARE], [])
+])
+
+# gl_ASSERT_NO_GNULIB_TESTS
+# asserts that there will be no gnulib tests in the scope of the configure.ac
+# and thereby enables an optimization of config.h.
+# Used by Emacs.
+AC_DEFUN([gl_ASSERT_NO_GNULIB_TESTS],
+[
+ dnl Override gl_MODULE_INDICATOR_FOR_TESTS.
+ AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], [])
+])
+
# Test whether <features.h> exists.
# Set HAVE_FEATURES_H.
AC_DEFUN([gl_FEATURES_H],
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 56f86b804a..7fcdee94df 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -1,5 +1,5 @@
# DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+# Copyright (C) 2002-2011 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
@@ -53,6 +53,8 @@ AC_DEFUN([gl_EARLY],
# Code from module extensions:
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
# Code from module fclose:
+ # Code from module fcntl-h:
+ # Code from module fcntl-h-tests:
# Code from module fdl-1.3:
# Code from module float:
# Code from module fseeko:
@@ -103,6 +105,8 @@ AC_DEFUN([gl_EARLY],
# Code from module netinet_in-tests:
# Code from module perror:
# Code from module perror-tests:
+ # Code from module pipe-posix:
+ # Code from module pipe-posix-tests:
# Code from module pmccabe2html:
# Code from module progname:
# Code from module read-file:
@@ -174,8 +178,6 @@ AC_DEFUN([gl_EARLY],
# Code from module version-etc-tests:
# Code from module warn-on-use:
# Code from module warnings:
- # Code from module wchar:
- # Code from module wchar-tests:
# Code from module xsize:
])
@@ -374,6 +376,7 @@ AC_SUBST([LTALLOCA])
# Code from module snprintf:
gl_FUNC_SNPRINTF
gl_STDIO_MODULE_INDICATOR([snprintf])
+ gl_MODULE_INDICATOR([snprintf])
# Code from module socket:
AC_REQUIRE([gl_HEADER_SYS_SOCKET])
if test "$ac_cv_header_winsock2_h" = yes; then
@@ -444,8 +447,6 @@ AC_SUBST([LTALLOCA])
# Code from module warn-on-use:
# Code from module warnings:
AC_SUBST([WARN_CFLAGS])
- # Code from module wchar:
- gl_WCHAR_H
# Code from module xsize:
gl_XSIZE
# End of code from modules
@@ -494,6 +495,7 @@ changequote([, ])dnl
AC_SUBST([gltests_WITNESS])
gl_module_indicator_condition=$gltests_WITNESS
m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition])
+ gl_FCNTL_H
gl_FUNC_UNGETC_WORKS
gl_FUNC_UNGETC_WORKS
gl_FUNC_GETPAGESIZE
@@ -506,7 +508,9 @@ changequote([, ])dnl
gl_FUNC_MMAP_ANON
AC_CHECK_HEADERS_ONCE([sys/mman.h])
AC_CHECK_FUNCS_ONCE([mprotect])
- AC_CHECK_HEADERS_ONCE([unistd.h sys/wait.h])
+ gl_FUNC_PIPE
+ gl_UNISTD_MODULE_INDICATOR([pipe])
+ AC_CHECK_HEADERS_ONCE([sys/wait.h])
gt_TYPE_WCHAR_T
gt_TYPE_WINT_T
gl_SYS_IOCTL_H
@@ -711,7 +715,6 @@ AC_DEFUN([gl_FILE_LIST], [
lib/version-etc.c
lib/version-etc.h
lib/w32sock.h
- lib/wchar.in.h
lib/xsize.h
m4/00gnulib.m4
m4/alloca.m4
@@ -724,6 +727,8 @@ AC_DEFUN([gl_FILE_LIST], [
m4/error.m4
m4/extensions.m4
m4/fclose.m4
+ m4/fcntl-o.m4
+ m4/fcntl_h.m4
m4/float_h.m4
m4/fseeko.m4
m4/ftello.m4
@@ -756,6 +761,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/netdb_h.m4
m4/netinet_in_h.m4
m4/perror.m4
+ m4/pipe.m4
m4/printf.m4
m4/read-file.m4
m4/readline.m4
@@ -791,7 +797,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/version-etc.m4
m4/warn-on-use.m4
m4/warnings.m4
- m4/wchar_h.m4
m4/wchar_t.m4
m4/wint_t.m4
m4/xsize.m4
@@ -805,6 +810,7 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-binary-io.sh
tests/test-c-ctype.c
tests/test-errno.c
+ tests/test-fcntl-h.c
tests/test-fseeko.c
tests/test-fseeko.sh
tests/test-fseeko2.sh
@@ -825,6 +831,7 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-netinet_in.c
tests/test-perror.c
tests/test-perror.sh
+ tests/test-pipe.c
tests/test-read-file.c
tests/test-select-fd.c
tests/test-select-in.sh
@@ -856,12 +863,13 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-verify.sh
tests/test-version-etc.c
tests/test-version-etc.sh
- tests/test-wchar.c
tests/zerosize-ptr.h
tests=lib/binary-io.h
tests=lib/dummy.c
+ tests=lib/fcntl.in.h
tests=lib/getpagesize.c
tests=lib/ioctl.c
+ tests=lib/pipe.c
tests=lib/sys_ioctl.in.h
tests=lib/w32sock.h
top/GNUmakefile
diff --git a/gl/m4/gnulib-tool.m4 b/gl/m4/gnulib-tool.m4
index 69e7733b99..ed41e9d415 100644
--- a/gl/m4/gnulib-tool.m4
+++ b/gl/m4/gnulib-tool.m4
@@ -1,5 +1,5 @@
# gnulib-tool.m4 serial 2
-dnl Copyright (C) 2004-2005, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2005, 2009-2011 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.
diff --git a/gl/m4/hostent.m4 b/gl/m4/hostent.m4
index 7104b3089a..36ade7e8aa 100644
--- a/gl/m4/hostent.m4
+++ b/gl/m4/hostent.m4
@@ -1,5 +1,5 @@
# hostent.m4 serial 2
-dnl Copyright (C) 2008, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008, 2010-2011 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.
diff --git a/gl/m4/include_next.m4 b/gl/m4/include_next.m4
index e37eb0567d..b3c7849185 100644
--- a/gl/m4/include_next.m4
+++ b/gl/m4/include_next.m4
@@ -1,5 +1,5 @@
-# include_next.m4 serial 16
-dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
+# include_next.m4 serial 18
+dnl Copyright (C) 2006-2011 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.
@@ -147,11 +147,33 @@ choke me
# Note: This macro assumes that the header file is not empty after
# preprocessing, i.e. it does not only define preprocessor macros but also
# provides some type/enum definitions or function/variable declarations.
+#
+# This macro also checks whether each header exists, by invoking
+# AC_CHECK_HEADERS_ONCE or AC_CHECK_HEADERS on each argument.
AC_DEFUN([gl_CHECK_NEXT_HEADERS],
[
+ gl_NEXT_HEADERS_INTERNAL([$1], [check])
+])
+
+# gl_NEXT_HEADERS(HEADER1 HEADER2 ...)
+# ------------------------------------
+# Like gl_CHECK_NEXT_HEADERS, except do not check whether the headers exist.
+# This is suitable for headers like <stddef.h> that are standardized by C89
+# and therefore can be assumed to exist.
+AC_DEFUN([gl_NEXT_HEADERS],
+[
+ gl_NEXT_HEADERS_INTERNAL([$1], [assume])
+])
+
+# The guts of gl_CHECK_NEXT_HEADERS and gl_NEXT_HEADERS.
+AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
+[
AC_REQUIRE([gl_INCLUDE_NEXT])
AC_REQUIRE([AC_CANONICAL_HOST])
- AC_CHECK_HEADERS_ONCE([$1])
+
+ m4_if([$2], [check],
+ [AC_CHECK_HEADERS_ONCE([$1])
+ ])
m4_foreach_w([gl_HEADER_NAME], [$1],
[AS_VAR_PUSHDEF([gl_next_header],
@@ -162,39 +184,44 @@ AC_DEFUN([gl_CHECK_NEXT_HEADERS],
AC_CACHE_CHECK(
[absolute name of <]m4_defn([gl_HEADER_NAME])[>],
m4_defn([gl_next_header]),
- [AS_VAR_PUSHDEF([gl_header_exists],
- [ac_cv_header_]m4_defn([gl_HEADER_NAME]))
- if test AS_VAR_GET(gl_header_exists) = yes; then
- AC_LANG_CONFTEST(
- [AC_LANG_SOURCE(
- [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
- )])
- dnl AIX "xlc -E" and "cc -E" omit #line directives for header files
- dnl that contain only a #include of other header files and no
- dnl non-comment tokens of their own. This leads to a failure to
- dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
- dnl and others. The workaround is to force preservation of comments
- dnl through option -C. This ensures all necessary #line directives
- dnl are present. GCC supports option -C as well.
- case "$host_os" in
- aix*) gl_absname_cpp="$ac_cpp -C" ;;
- *) gl_absname_cpp="$ac_cpp" ;;
- esac
- dnl eval is necessary to expand gl_absname_cpp.
- dnl Ultrix and Pyramid sh refuse to redirect output of eval,
- dnl so use subshell.
- AS_VAR_SET([gl_next_header],
- ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
- sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
- s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
- s#^/[^/]#//&#
- p
- q
- }'`'"'])
- else
- AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
- fi
- AS_VAR_POPDEF([gl_header_exists])])
+ [m4_if([$2], [check],
+ [AS_VAR_PUSHDEF([gl_header_exists],
+ [ac_cv_header_]m4_defn([gl_HEADER_NAME]))
+ if test AS_VAR_GET(gl_header_exists) = yes; then
+ AS_VAR_POPDEF([gl_header_exists])
+ ])
+ AC_LANG_CONFTEST(
+ [AC_LANG_SOURCE(
+ [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
+ )])
+ dnl AIX "xlc -E" and "cc -E" omit #line directives for header
+ dnl files that contain only a #include of other header files and
+ dnl no non-comment tokens of their own. This leads to a failure
+ dnl to detect the absolute name of <dirent.h>, <signal.h>,
+ dnl <poll.h> and others. The workaround is to force preservation
+ dnl of comments through option -C. This ensures all necessary
+ dnl #line directives are present. GCC supports option -C as well.
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+ dnl eval is necessary to expand gl_absname_cpp.
+ dnl Ultrix and Pyramid sh refuse to redirect output of eval,
+ dnl so use subshell.
+ AS_VAR_SET([gl_next_header],
+ ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+ sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
+ s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
+ s#^/[^/]#//&#
+ p
+ q
+ }'`'"'])
+ m4_if([$2], [check],
+ [else
+ AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+ fi
+ ])
+ ])
fi
AC_SUBST(
AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
diff --git a/gl/m4/inet_ntop.m4 b/gl/m4/inet_ntop.m4
index a6d219c208..57580b8a4a 100644
--- a/gl/m4/inet_ntop.m4
+++ b/gl/m4/inet_ntop.m4
@@ -1,5 +1,5 @@
-# inet_ntop.m4 serial 12
-dnl Copyright (C) 2005, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
+# inet_ntop.m4 serial 13
+dnl Copyright (C) 2005-2006, 2008-2011 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.
@@ -29,7 +29,13 @@ AC_DEFUN([gl_FUNC_INET_NTOP],
# Prerequisites of lib/inet_ntop.c.
AC_DEFUN([gl_PREREQ_INET_NTOP], [
- AC_CHECK_DECLS([inet_ntop],,,[#include <arpa/inet.h>])
+ AC_CHECK_HEADERS_ONCE([netdb.h])
+ AC_CHECK_DECLS([inet_ntop],,,
+ [#include <arpa/inet.h>
+ #if HAVE_NETDB_H
+ # include <netdb.h>
+ #endif
+ ])
if test $ac_cv_have_decl_inet_ntop = no; then
HAVE_DECL_INET_NTOP=0
fi
diff --git a/gl/m4/inet_pton.m4 b/gl/m4/inet_pton.m4
index 193f17d0a3..9a7ad3b384 100644
--- a/gl/m4/inet_pton.m4
+++ b/gl/m4/inet_pton.m4
@@ -1,5 +1,5 @@
-# inet_pton.m4 serial 10
-dnl Copyright (C) 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
+# inet_pton.m4 serial 11
+dnl Copyright (C) 2006, 2008-2011 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.
@@ -29,7 +29,13 @@ AC_DEFUN([gl_FUNC_INET_PTON],
# Prerequisites of lib/inet_pton.c.
AC_DEFUN([gl_PREREQ_INET_PTON], [
- AC_CHECK_DECLS([inet_pton],,,[#include <arpa/inet.h>])
+ AC_CHECK_HEADERS_ONCE([netdb.h])
+ AC_CHECK_DECLS([inet_pton],,,
+ [#include <arpa/inet.h>
+ #if HAVE_NETDB_H
+ # include <netdb.h>
+ #endif
+ ])
if test $ac_cv_have_decl_inet_pton = no; then
HAVE_DECL_INET_PTON=0
fi
diff --git a/gl/m4/intmax_t.m4 b/gl/m4/intmax_t.m4
index 493e4a9328..7341054b6f 100644
--- a/gl/m4/intmax_t.m4
+++ b/gl/m4/intmax_t.m4
@@ -1,5 +1,5 @@
# intmax_t.m4 serial 8
-dnl Copyright (C) 1997-2004, 2006-2007, 2009-2010 Free Software Foundation,
+dnl Copyright (C) 1997-2004, 2006-2007, 2009-2011 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/inttypes_h.m4 b/gl/m4/inttypes_h.m4
index 9d8f926926..f10fd54f63 100644
--- a/gl/m4/inttypes_h.m4
+++ b/gl/m4/inttypes_h.m4
@@ -1,5 +1,5 @@
# inttypes_h.m4 serial 10
-dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2011 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.
diff --git a/gl/m4/ioctl.m4 b/gl/m4/ioctl.m4
index 4a0a99f16a..8cb36d88fe 100644
--- a/gl/m4/ioctl.m4
+++ b/gl/m4/ioctl.m4
@@ -1,5 +1,5 @@
# ioctl.m4 serial 1
-dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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.
diff --git a/gl/m4/lib-ld.m4 b/gl/m4/lib-ld.m4
index 294db72e13..ae003f7c59 100644
--- a/gl/m4/lib-ld.m4
+++ b/gl/m4/lib-ld.m4
@@ -1,5 +1,5 @@
# lib-ld.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 1996-2003, 2009-2011 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.
diff --git a/gl/m4/lib-link.m4 b/gl/m4/lib-link.m4
index 2ea9d6d073..e7c9ba9d3d 100644
--- a/gl/m4/lib-link.m4
+++ b/gl/m4/lib-link.m4
@@ -1,5 +1,5 @@
-# lib-link.m4 serial 25 (gettext-0.18.2)
-dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
+# lib-link.m4 serial 26 (gettext-0.18.2)
+dnl Copyright (C) 2001-2011 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.
@@ -116,6 +116,8 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
dnl Determine the platform dependent parameters needed to use rpath:
dnl acl_libext,
dnl acl_shlibext,
+dnl acl_libname_spec,
+dnl acl_library_names_spec,
dnl acl_hardcode_libdir_flag_spec,
dnl acl_hardcode_libdir_separator,
dnl acl_hardcode_direct,
diff --git a/gl/m4/lib-prefix.m4 b/gl/m4/lib-prefix.m4
index 1601ceaefd..7e5f0bde03 100644
--- a/gl/m4/lib-prefix.m4
+++ b/gl/m4/lib-prefix.m4
@@ -1,5 +1,5 @@
# lib-prefix.m4 serial 7 (gettext-0.18)
-dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2005, 2008-2011 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.
diff --git a/gl/m4/longlong.m4 b/gl/m4/longlong.m4
index cca3c1a90f..aed816cfa5 100644
--- a/gl/m4/longlong.m4
+++ b/gl/m4/longlong.m4
@@ -1,5 +1,5 @@
-# longlong.m4 serial 14
-dnl Copyright (C) 1999-2007, 2009-2010 Free Software Foundation, Inc.
+# longlong.m4 serial 16
+dnl Copyright (C) 1999-2007, 2009-2011 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.
@@ -7,8 +7,8 @@ dnl with or without modifications, as long as this notice is preserved.
dnl From Paul Eggert.
# Define HAVE_LONG_LONG_INT if 'long long int' works.
-# This fixes a bug in Autoconf 2.61, but can be removed once we
-# assume 2.62 everywhere.
+# This fixes a bug in Autoconf 2.61, and can be faster
+# than what's in Autoconf 2.62 through 2.68.
# Note: If the type 'long long int' exists but is only 32 bits large
# (as on some very old compilers), HAVE_LONG_LONG_INT will not be
@@ -16,35 +16,39 @@ dnl From Paul Eggert.
AC_DEFUN([AC_TYPE_LONG_LONG_INT],
[
+ AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
- [AC_LINK_IFELSE(
- [_AC_TYPE_LONG_LONG_SNIPPET],
- [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
- dnl If cross compiling, assume the bug isn't important, since
- dnl nobody cross compiles for this platform as far as we know.
- AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[@%:@include <limits.h>
- @%:@ifndef LLONG_MAX
- @%:@ define HALF \
- (1LL << (sizeof (long long int) * CHAR_BIT - 2))
- @%:@ define LLONG_MAX (HALF - 1 + HALF)
- @%:@endif]],
- [[long long int n = 1;
- int i;
- for (i = 0; ; i++)
- {
- long long int m = n << i;
- if (m >> i != n)
- return 1;
- if (LLONG_MAX / 2 < m)
- break;
- }
- return 0;]])],
- [ac_cv_type_long_long_int=yes],
- [ac_cv_type_long_long_int=no],
- [ac_cv_type_long_long_int=yes])],
- [ac_cv_type_long_long_int=no])])
+ [ac_cv_type_long_long_int=yes
+ if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+ ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
+ if test $ac_cv_type_long_long_int = yes; then
+ dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
+ dnl If cross compiling, assume the bug is not important, since
+ dnl nobody cross compiles for this platform as far as we know.
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[@%:@include <limits.h>
+ @%:@ifndef LLONG_MAX
+ @%:@ define HALF \
+ (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+ @%:@ define LLONG_MAX (HALF - 1 + HALF)
+ @%:@endif]],
+ [[long long int n = 1;
+ int i;
+ for (i = 0; ; i++)
+ {
+ long long int m = n << i;
+ if (m >> i != n)
+ return 1;
+ if (LLONG_MAX / 2 < m)
+ break;
+ }
+ return 0;]])],
+ [],
+ [ac_cv_type_long_long_int=no],
+ [:])
+ fi
+ fi])
if test $ac_cv_type_long_long_int = yes; then
AC_DEFINE([HAVE_LONG_LONG_INT], [1],
[Define to 1 if the system has the type `long long int'.])
@@ -52,8 +56,8 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT],
])
# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
-# This fixes a bug in Autoconf 2.61, but can be removed once we
-# assume 2.62 everywhere.
+# This fixes a bug in Autoconf 2.61, and can be faster
+# than what's in Autoconf 2.62 through 2.68.
# Note: If the type 'unsigned long long int' exists but is only 32 bits
# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
@@ -64,10 +68,13 @@ AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
[
AC_CACHE_CHECK([for unsigned long long int],
[ac_cv_type_unsigned_long_long_int],
- [AC_LINK_IFELSE(
- [_AC_TYPE_LONG_LONG_SNIPPET],
- [ac_cv_type_unsigned_long_long_int=yes],
- [ac_cv_type_unsigned_long_long_int=no])])
+ [ac_cv_type_unsigned_long_long_int=yes
+ if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+ AC_LINK_IFELSE(
+ [_AC_TYPE_LONG_LONG_SNIPPET],
+ [],
+ [ac_cv_type_unsigned_long_long_int=no])
+ fi])
if test $ac_cv_type_unsigned_long_long_int = yes; then
AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
[Define to 1 if the system has the type `unsigned long long int'.])
diff --git a/gl/m4/lseek.m4 b/gl/m4/lseek.m4
index b0612c7e17..f6452f6f20 100644
--- a/gl/m4/lseek.m4
+++ b/gl/m4/lseek.m4
@@ -1,5 +1,5 @@
# lseek.m4 serial 6
-dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2011 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.
diff --git a/gl/m4/malloc.m4 b/gl/m4/malloc.m4
index 7a749254a1..8094444507 100644
--- a/gl/m4/malloc.m4
+++ b/gl/m4/malloc.m4
@@ -1,5 +1,5 @@
# malloc.m4 serial 12
-dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2011 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.
diff --git a/gl/m4/manywarnings.m4 b/gl/m4/manywarnings.m4
index 844a9ba2a0..e928821952 100644
--- a/gl/m4/manywarnings.m4
+++ b/gl/m4/manywarnings.m4
@@ -1,5 +1,5 @@
# manywarnings.m4 serial 1
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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.
diff --git a/gl/m4/memchr.m4 b/gl/m4/memchr.m4
index 46db9fb654..3c2b313916 100644
--- a/gl/m4/memchr.m4
+++ b/gl/m4/memchr.m4
@@ -1,5 +1,5 @@
# memchr.m4 serial 10
-dnl Copyright (C) 2002-2004, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2009-2011 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.
diff --git a/gl/m4/minmax.m4 b/gl/m4/minmax.m4
index a5c42dea0f..beb9cb1782 100644
--- a/gl/m4/minmax.m4
+++ b/gl/m4/minmax.m4
@@ -1,5 +1,5 @@
# minmax.m4 serial 4
-dnl Copyright (C) 2005, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2009-2011 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.
diff --git a/gl/m4/mmap-anon.m4 b/gl/m4/mmap-anon.m4
index e20fc3c670..7ba7fd26b6 100644
--- a/gl/m4/mmap-anon.m4
+++ b/gl/m4/mmap-anon.m4
@@ -1,5 +1,5 @@
# mmap-anon.m4 serial 9
-dnl Copyright (C) 2005, 2007, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2007, 2009-2011 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.
diff --git a/gl/m4/multiarch.m4 b/gl/m4/multiarch.m4
index 389bd2bbaa..691d89270b 100644
--- a/gl/m4/multiarch.m4
+++ b/gl/m4/multiarch.m4
@@ -1,5 +1,5 @@
-# multiarch.m4 serial 5
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+# multiarch.m4 serial 6
+dnl Copyright (C) 2008-2011 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.
@@ -16,8 +16,7 @@ dnl with or without modifications, as long as this notice is preserved.
# CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
# CPP="gcc -E" CXXCPP="g++ -E"
#
-# Detect this situation and set the macro AA_APPLE_UNIVERSAL_BUILD at the
-# beginning of config.h and set APPLE_UNIVERSAL_BUILD accordingly.
+# Detect this situation and set APPLE_UNIVERSAL_BUILD accordingly.
AC_DEFUN_ONCE([gl_MULTIARCH],
[
@@ -55,8 +54,6 @@ AC_DEFUN_ONCE([gl_MULTIARCH],
done
])
if test $gl_cv_c_multiarch = yes; then
- AC_DEFINE([AA_APPLE_UNIVERSAL_BUILD], [1],
- [Define if the compiler is building for multiple architectures of Apple platforms at once.])
APPLE_UNIVERSAL_BUILD=1
else
APPLE_UNIVERSAL_BUILD=0
diff --git a/gl/m4/netdb_h.m4 b/gl/m4/netdb_h.m4
index c870fb61b9..9a01cd6a76 100644
--- a/gl/m4/netdb_h.m4
+++ b/gl/m4/netdb_h.m4
@@ -1,5 +1,5 @@
-# netdb_h.m4 serial 9
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+# netdb_h.m4 serial 10
+dnl Copyright (C) 2008-2011 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.
@@ -7,7 +7,6 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_HEADER_NETDB],
[
AC_REQUIRE([gl_NETDB_H_DEFAULTS])
- AC_CHECK_HEADERS_ONCE([netdb.h])
gl_CHECK_NEXT_HEADERS([netdb.h])
if test $ac_cv_header_netdb_h = yes; then
HAVE_NETDB_H=1
diff --git a/gl/m4/netinet_in_h.m4 b/gl/m4/netinet_in_h.m4
index cc7a44cc21..e2d022df7a 100644
--- a/gl/m4/netinet_in_h.m4
+++ b/gl/m4/netinet_in_h.m4
@@ -1,5 +1,5 @@
# netinet_in_h.m4 serial 4
-dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2011 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.
diff --git a/gl/m4/perror.m4 b/gl/m4/perror.m4
index 350cd4203f..2a03e0809d 100644
--- a/gl/m4/perror.m4
+++ b/gl/m4/perror.m4
@@ -1,5 +1,5 @@
# perror.m4 serial 1
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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.
diff --git a/gl/m4/pipe.m4 b/gl/m4/pipe.m4
new file mode 100644
index 0000000000..ae00049977
--- /dev/null
+++ b/gl/m4/pipe.m4
@@ -0,0 +1,16 @@
+# pipe.m4 serial 1
+dnl Copyright (C) 2010-2011 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_PIPE],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+
+ AC_CHECK_FUNCS_ONCE([pipe])
+ if test $ac_cv_func_pipe != yes; then
+ HAVE_PIPE=0
+ AC_LIBOBJ([pipe])
+ fi
+])
diff --git a/gl/m4/printf.m4 b/gl/m4/printf.m4
index 6d1cbfe209..9c2ed1ef2f 100644
--- a/gl/m4/printf.m4
+++ b/gl/m4/printf.m4
@@ -1,5 +1,5 @@
-# printf.m4 serial 40
-dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
+# printf.m4 serial 42
+dnl Copyright (C) 2003, 2007-2011 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.
@@ -71,8 +71,8 @@ changequote(,)dnl
gl_cv_func_printf_sizes_c99="guessing no";;
openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
# Guess yes on Solaris >= 2.10.
- solaris2.[0-9]*) gl_cv_func_printf_sizes_c99="guessing no";;
- solaris*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ solaris*) gl_cv_func_printf_sizes_c99="guessing no";;
# Guess yes on NetBSD >= 3.
netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
gl_cv_func_printf_sizes_c99="guessing no";;
@@ -591,8 +591,8 @@ changequote(,)dnl
darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";;
darwin*) gl_cv_func_printf_directive_f="guessing yes";;
# Guess yes on Solaris >= 2.10.
- solaris2.[0-9]*) gl_cv_func_printf_directive_f="guessing no";;
- solaris*) gl_cv_func_printf_directive_f="guessing yes";;
+ solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ solaris*) gl_cv_func_printf_sizes_c99="guessing no";;
# If we don't know, assume the worst.
*) gl_cv_func_printf_directive_f="guessing no";;
esac
@@ -890,8 +890,9 @@ changequote([,])dnl
dnl Test whether the *printf family of functions supports large precisions.
dnl On mingw, precisions larger than 512 are treated like 512, in integer,
dnl floating-point or pointer output. On Solaris 10/x86, precisions larger
-dnl than 510 in floating-point output crash the program. On BeOS, precisions
-dnl larger than 1044 crash the program.
+dnl than 510 in floating-point output crash the program. On Solaris 10/SPARC,
+dnl precisions larger than 510 in floating-point output yield wrong results.
+dnl On BeOS, precisions larger than 1044 crash the program.
dnl Result is gl_cv_func_printf_precision.
AC_DEFUN([gl_PRINTF_PRECISION],
@@ -917,6 +918,9 @@ int main ()
result |= 1;
if (sprintf (buf, "%.4000f %d", 1.0, 33, 44) < 4000 + 5)
result |= 2;
+ if (sprintf (buf, "%.511f %d", 1.0, 33, 44) < 511 + 5
+ || buf[0] != '1')
+ result |= 4;
return result;
}]])],
[gl_cv_func_printf_precision=yes],
@@ -1102,7 +1106,8 @@ changequote(,)dnl
gl_cv_func_snprintf_truncation_c99="guessing no";;
openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
# Guess yes on Solaris >= 2.6.
- solaris2.[0-5]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ solaris2.[0-5] | solaris2.[0-5].*)
+ gl_cv_func_snprintf_truncation_c99="guessing no";;
solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
# Guess yes on AIX >= 4.
aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
@@ -1161,6 +1166,10 @@ int main ()
strcpy (buf, "ABCDEF");
if (snprintf (buf, 3, "%d %d", 4567, 89) != 7)
return 1;
+ if (snprintf (buf, 0, "%d %d", 4567, 89) != 7)
+ return 2;
+ if (snprintf (NULL, 0, "%d %d", 4567, 89) != 7)
+ return 3;
return 0;
}]])],
[gl_cv_func_snprintf_retval_c99=yes],
@@ -1180,9 +1189,9 @@ changequote(,)dnl
openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
gl_cv_func_snprintf_retval_c99="guessing no";;
openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
- # Guess yes on Solaris >= 2.6.
- solaris2.[0-5]*) gl_cv_func_snprintf_retval_c99="guessing no";;
- solaris*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on Solaris >= 2.10.
+ solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ solaris*) gl_cv_func_printf_sizes_c99="guessing no";;
# Guess yes on AIX >= 4.
aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";;
aix*) gl_cv_func_snprintf_retval_c99="guessing yes";;
@@ -1243,7 +1252,8 @@ changequote(,)dnl
darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";;
darwin*) gl_cv_func_snprintf_directive_n="guessing yes";;
# Guess yes on Solaris >= 2.6.
- solaris2.[0-5]*) gl_cv_func_snprintf_directive_n="guessing no";;
+ solaris2.[0-5] | solaris2.[0-5].*)
+ gl_cv_func_snprintf_directive_n="guessing no";;
solaris*) gl_cv_func_snprintf_directive_n="guessing yes";;
# Guess yes on AIX >= 4.
aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";;
@@ -1371,7 +1381,8 @@ changequote(,)dnl
# Guess yes on Cygwin.
cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
# Guess yes on Solaris >= 2.6.
- solaris2.[0-5]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+ solaris2.[0-5] | solaris2.[0-5].*)
+ gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
# Guess yes on AIX >= 4.
aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
@@ -1452,10 +1463,10 @@ dnl Cygwin 1.5.25 (2008) . . . # # . . # . . . . . # .
dnl Cygwin 1.5.19 (2006) # . . # # # . # . # . # # # . . . . . .
dnl Solaris 11 2010-11 . . # # # . . # . . . # . . . . . . . .
dnl Solaris 10 . . # # # . . # . . . # # . . . . . . .
-dnl Solaris 2.6 ... 9 # . # # # # . # . . . # . . . . . . . .
+dnl Solaris 2.6 ... 9 # . # # # # . # . . . # # . . . # . . .
dnl Solaris 2.5.1 # . # # # # . # . . . # . . # # # # # #
dnl AIX 5.2, 7.1 . . # # # . . . . . . # . . . . . . . .
-dnl AIX 4.3.2, 5.1 # . # # # # . . . . . # . . . . . . . .
+dnl AIX 4.3.2, 5.1 # . # # # # . . . . . # . . . . # . . .
dnl HP-UX 11.31 . . . . # . . . . . . # . . . . # # . .
dnl HP-UX 11.{00,11,23} # . . . # # . . . . . # . . . . # # . #
dnl HP-UX 10.20 # . # . # # . ? . . # # . . . . # # ? #
@@ -1465,6 +1476,6 @@ dnl OSF/1 4.0d # . # # # # . . . . . # . . #
dnl NetBSD 5.0 . . . # # . . . . . . # . # . . . . . .
dnl NetBSD 4.0 . ? ? ? ? ? . ? . ? ? ? ? ? . . . ? ? ?
dnl NetBSD 3.0 . . . . # # . ? # # ? # . # . . . . . .
-dnl Haiku . . . # # # . # . . . . . ? . . . . . .
-dnl BeOS # # . # # # . ? # . ? . # ? . . . . . .
+dnl Haiku . . . # # # . # . . . . . ? . . ? . . .
+dnl BeOS # # . # # # . ? # . ? . # ? . . ? . . .
dnl mingw # # # # # # . . # # . # # ? . # # # . .
diff --git a/gl/m4/read-file.m4 b/gl/m4/read-file.m4
index 35a3a4817f..60d03600a8 100644
--- a/gl/m4/read-file.m4
+++ b/gl/m4/read-file.m4
@@ -1,6 +1,5 @@
# read-file.m4 serial 2
-dnl Copyright (C) 2002, 2003, 2004, 2005, 2006, 2009, 2010 Free Software
-dnl Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2011 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.
diff --git a/gl/m4/readline.m4 b/gl/m4/readline.m4
index 7a97ecba91..90ce357470 100644
--- a/gl/m4/readline.m4
+++ b/gl/m4/readline.m4
@@ -1,5 +1,5 @@
# readline.m4 serial 8
-dnl Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2006, 2009-2011 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.
diff --git a/gl/m4/realloc.m4 b/gl/m4/realloc.m4
index 01c1234f7e..a403d9fb32 100644
--- a/gl/m4/realloc.m4
+++ b/gl/m4/realloc.m4
@@ -1,5 +1,5 @@
# realloc.m4 serial 11
-dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2011 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.
diff --git a/gl/m4/select.m4 b/gl/m4/select.m4
index da266f0bfa..dc771d0ef4 100644
--- a/gl/m4/select.m4
+++ b/gl/m4/select.m4
@@ -1,5 +1,5 @@
# select.m4 serial 3
-dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2011 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.
diff --git a/gl/m4/servent.m4 b/gl/m4/servent.m4
index 2486511aad..c5df01c9b0 100644
--- a/gl/m4/servent.m4
+++ b/gl/m4/servent.m4
@@ -1,5 +1,5 @@
# servent.m4 serial 2
-dnl Copyright (C) 2008, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008, 2010-2011 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.
diff --git a/gl/m4/size_max.m4 b/gl/m4/size_max.m4
index f3b1a9dfb2..e8070981a8 100644
--- a/gl/m4/size_max.m4
+++ b/gl/m4/size_max.m4
@@ -1,5 +1,5 @@
# size_max.m4 serial 10
-dnl Copyright (C) 2003, 2005-2006, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2006, 2008-2011 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.
diff --git a/gl/m4/snprintf.m4 b/gl/m4/snprintf.m4
index 522b107b12..8aa5dbe598 100644
--- a/gl/m4/snprintf.m4
+++ b/gl/m4/snprintf.m4
@@ -1,5 +1,5 @@
# snprintf.m4 serial 5
-dnl Copyright (C) 2002-2004, 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2007-2011 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.
@@ -13,7 +13,12 @@ AC_DEFUN([gl_FUNC_SNPRINTF],
gl_SNPRINTF_SIZE1
case "$gl_cv_func_snprintf_size1" in
*yes)
- gl_cv_func_snprintf_usable=yes
+ gl_SNPRINTF_RETVAL_C99
+ case "$gl_cv_func_snprintf_retval_c99" in
+ *yes)
+ gl_cv_func_snprintf_usable=yes
+ ;;
+ esac
;;
esac
fi
diff --git a/gl/m4/socketlib.m4 b/gl/m4/socketlib.m4
index 7bf02b5aee..2aa972dd88 100644
--- a/gl/m4/socketlib.m4
+++ b/gl/m4/socketlib.m4
@@ -1,5 +1,5 @@
# socketlib.m4 serial 1
-dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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.
diff --git a/gl/m4/sockets.m4 b/gl/m4/sockets.m4
index ba9a563d8e..cbe754f8d5 100644
--- a/gl/m4/sockets.m4
+++ b/gl/m4/sockets.m4
@@ -1,5 +1,5 @@
# sockets.m4 serial 7
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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.
diff --git a/gl/m4/socklen.m4 b/gl/m4/socklen.m4
index d0d6baab55..5e4c69ed79 100644
--- a/gl/m4/socklen.m4
+++ b/gl/m4/socklen.m4
@@ -1,5 +1,5 @@
# socklen.m4 serial 8
-dnl Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2007, 2009-2011 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.
diff --git a/gl/m4/sockpfaf.m4 b/gl/m4/sockpfaf.m4
index 8806705ae2..27899aa59b 100644
--- a/gl/m4/sockpfaf.m4
+++ b/gl/m4/sockpfaf.m4
@@ -1,5 +1,5 @@
# sockpfaf.m4 serial 7
-dnl Copyright (C) 2004, 2006, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2006, 2009-2011 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.
diff --git a/gl/m4/stdarg.m4 b/gl/m4/stdarg.m4
index 8a62f2e844..a1ef178c55 100644
--- a/gl/m4/stdarg.m4
+++ b/gl/m4/stdarg.m4
@@ -1,5 +1,5 @@
-# stdarg.m4 serial 4
-dnl Copyright (C) 2006, 2008-2010 Free Software Foundation, Inc.
+# stdarg.m4 serial 5
+dnl Copyright (C) 2006, 2008-2011 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.
@@ -41,7 +41,7 @@ void (*func) (va_list, va_list) = va_copy;
if test $gl_aixcc = yes; then
dnl Provide a substitute <stdarg.h> file.
STDARG_H=stdarg.h
- gl_CHECK_NEXT_HEADERS([stdarg.h])
+ gl_NEXT_HEADERS([stdarg.h])
dnl Fallback for the case when <stdarg.h> contains only macro definitions.
if test "$gl_cv_next_stdarg_h" = '""'; then
gl_cv_next_stdarg_h='"///usr/include/stdarg.h"'
diff --git a/gl/m4/stdbool.m4 b/gl/m4/stdbool.m4
index 1efe59ea1c..838cf0f467 100644
--- a/gl/m4/stdbool.m4
+++ b/gl/m4/stdbool.m4
@@ -1,17 +1,17 @@
# Check for stdbool.h that conforms to C99.
-dnl Copyright (C) 2002-2006, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2011 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.
-#serial 3
+#serial 4
# Prepare for substituting <stdbool.h> if it is not supported.
AC_DEFUN([AM_STDBOOL_H],
[
- AC_REQUIRE([AC_HEADER_STDBOOL])
+ AC_REQUIRE([AC_CHECK_HEADER_STDBOOL])
# Define two additional variables used in the Makefile substitution.
@@ -33,11 +33,9 @@ AC_DEFUN([AM_STDBOOL_H],
# AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future.
AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H])
-# This version of the macro is needed in autoconf <= 2.67. Autoconf has
-# it built in since 2.60, but we want the tweaks from the 2.68 version
-# to avoid rejecting xlc and clang due to relying on extensions.
+# This version of the macro is needed in autoconf <= 2.68.
-AC_DEFUN([AC_HEADER_STDBOOL],
+AC_DEFUN([AC_CHECK_HEADER_STDBOOL],
[AC_CACHE_CHECK([for stdbool.h that conforms to C99],
[ac_cv_header_stdbool_h],
[AC_COMPILE_IFELSE(
@@ -98,6 +96,4 @@ AC_DEFUN([AC_HEADER_STDBOOL],
[ac_cv_header_stdbool_h=yes],
[ac_cv_header_stdbool_h=no])])
AC_CHECK_TYPES([_Bool])
- if test $ac_cv_header_stdbool_h = yes; then
- AC_DEFINE([HAVE_STDBOOL_H], [1], [Define to 1 if stdbool.h conforms to C99.])
- fi])
+])
diff --git a/gl/m4/stddef_h.m4 b/gl/m4/stddef_h.m4
index c3ae569431..1942b6aa0d 100644
--- a/gl/m4/stddef_h.m4
+++ b/gl/m4/stddef_h.m4
@@ -1,6 +1,6 @@
dnl A placeholder for POSIX 2008 <stddef.h>, for platforms that have issues.
-# stddef_h.m4 serial 2
-dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+# stddef_h.m4 serial 3
+dnl Copyright (C) 2009-2011 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.
@@ -25,7 +25,7 @@ AC_DEFUN([gl_STDDEF_H],
STDDEF_H=stddef.h
fi
if test -n "$STDDEF_H"; then
- gl_CHECK_NEXT_HEADERS([stddef.h])
+ gl_NEXT_HEADERS([stddef.h])
fi
])
diff --git a/gl/m4/stdint.m4 b/gl/m4/stdint.m4
index 7fe28362fc..e7d0d0765a 100644
--- a/gl/m4/stdint.m4
+++ b/gl/m4/stdint.m4
@@ -1,5 +1,5 @@
-# stdint.m4 serial 36
-dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
+# stdint.m4 serial 39
+dnl Copyright (C) 2001-2011 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.
@@ -27,6 +27,15 @@ AC_DEFUN([gl_STDINT_H],
fi
AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT])
+ dnl Check for <wchar.h>, in the same way as gl_WCHAR_H does.
+ AC_CHECK_HEADERS_ONCE([wchar.h])
+ if test $ac_cv_header_wchar_h = yes; then
+ HAVE_WCHAR_H=1
+ else
+ HAVE_WCHAR_H=0
+ fi
+ AC_SUBST([HAVE_WCHAR_H])
+
dnl Check for <inttypes.h>.
dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h.
if test $ac_cv_header_inttypes_h = yes; then
@@ -145,9 +154,11 @@ uintmax_t j = UINTMAX_MAX;
#include <limits.h> /* for CHAR_BIT */
#define TYPE_MINIMUM(t) \
- ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
+ ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
#define TYPE_MAXIMUM(t) \
- ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
+ ((t) ((t) 0 < (t) -1 \
+ ? (t) -1 \
+ : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
struct s {
int check_PTRDIFF:
PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
@@ -290,10 +301,6 @@ static const char *macro_values[] =
fi
AC_SUBST([HAVE_SYS_BITYPES_H])
- dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
- dnl character support).
- AC_CHECK_HEADERS_ONCE([wchar.h])
-
gl_STDINT_TYPE_PROPERTIES
STDINT_H=stdint.h
fi
diff --git a/gl/m4/stdint_h.m4 b/gl/m4/stdint_h.m4
index 670c0cc2bf..356b14e120 100644
--- a/gl/m4/stdint_h.m4
+++ b/gl/m4/stdint_h.m4
@@ -1,5 +1,5 @@
# stdint_h.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2011 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.
diff --git a/gl/m4/stdio_h.m4 b/gl/m4/stdio_h.m4
index f5650cdeab..b6163d6806 100644
--- a/gl/m4/stdio_h.m4
+++ b/gl/m4/stdio_h.m4
@@ -1,5 +1,5 @@
-# stdio_h.m4 serial 31
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# stdio_h.m4 serial 32
+dnl Copyright (C) 2007-2011 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.
@@ -9,7 +9,7 @@ AC_DEFUN([gl_STDIO_H],
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
AC_REQUIRE([AC_C_INLINE])
AC_REQUIRE([gl_ASM_SYMBOL_PREFIX])
- gl_CHECK_NEXT_HEADERS([stdio.h])
+ gl_NEXT_HEADERS([stdio.h])
dnl No need to create extra modules for these functions. Everyone who uses
dnl <stdio.h> likely needs them.
GNULIB_FPRINTF=1
@@ -95,6 +95,8 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_DECL_FPURGE=1; AC_SUBST([HAVE_DECL_FPURGE])
+ HAVE_DECL_FSEEKO=1; AC_SUBST([HAVE_DECL_FSEEKO])
+ HAVE_DECL_FTELLO=1; AC_SUBST([HAVE_DECL_FTELLO])
HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM])
HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE])
HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF])
diff --git a/gl/m4/stdlib_h.m4 b/gl/m4/stdlib_h.m4
index e4697ce213..d28b552e90 100644
--- a/gl/m4/stdlib_h.m4
+++ b/gl/m4/stdlib_h.m4
@@ -1,5 +1,5 @@
-# stdlib_h.m4 serial 31
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# stdlib_h.m4 serial 36
+dnl Copyright (C) 2007-2011 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.
@@ -7,21 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_STDLIB_H],
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
- gl_CHECK_NEXT_HEADERS([stdlib.h])
- AC_CHECK_HEADERS([random.h], [], [], [AC_INCLUDES_DEFAULT])
- if test $ac_cv_header_random_h = yes; then
- HAVE_RANDOM_H=1
- else
- HAVE_RANDOM_H=0
- fi
- AC_SUBST([HAVE_RANDOM_H])
- AC_CHECK_TYPES([struct random_data],
- [], [HAVE_STRUCT_RANDOM_DATA=0],
- [[#include <stdlib.h>
- #if HAVE_RANDOM_H
- # include <random.h>
- #endif
- ]])
+ gl_NEXT_HEADERS([stdlib.h])
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use, and which is not
@@ -89,17 +75,19 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
HAVE_MKSTEMP=1; AC_SUBST([HAVE_MKSTEMP])
HAVE_MKSTEMPS=1; AC_SUBST([HAVE_MKSTEMPS])
HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME])
+ HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H])
HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R])
HAVE_REALPATH=1; AC_SUBST([HAVE_REALPATH])
HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH])
HAVE_SETENV=1; AC_SUBST([HAVE_SETENV])
+ HAVE_DECL_SETENV=1; AC_SUBST([HAVE_DECL_SETENV])
HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD])
HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL])
HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL])
HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA])
HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H])
HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT])
- HAVE_UNSETENV=1; AC_SUBST([HAVE_UNSETENV])
+ HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV])
REPLACE_CALLOC=0; AC_SUBST([REPLACE_CALLOC])
REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME])
REPLACE_MALLOC=0; AC_SUBST([REPLACE_MALLOC])
diff --git a/gl/m4/strerror.m4 b/gl/m4/strerror.m4
index 1649b24511..73d1d54d81 100644
--- a/gl/m4/strerror.m4
+++ b/gl/m4/strerror.m4
@@ -1,5 +1,5 @@
# strerror.m4 serial 9
-dnl Copyright (C) 2002, 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2007-2011 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.
diff --git a/gl/m4/string_h.m4 b/gl/m4/string_h.m4
index 5844b2d660..30ddfbc3a4 100644
--- a/gl/m4/string_h.m4
+++ b/gl/m4/string_h.m4
@@ -1,11 +1,11 @@
# Configure a GNU-like replacement for <string.h>.
-# Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# Copyright (C) 2007-2011 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 18
+# serial 19
# Written by Paul Eggert.
@@ -20,7 +20,7 @@ AC_DEFUN([gl_HEADER_STRING_H_BODY],
[
AC_REQUIRE([AC_C_RESTRICT])
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
- gl_CHECK_NEXT_HEADERS([string.h])
+ gl_NEXT_HEADERS([string.h])
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use, and which is not
diff --git a/gl/m4/sys_ioctl_h.m4 b/gl/m4/sys_ioctl_h.m4
index 5c342a5b1d..97cab84b06 100644
--- a/gl/m4/sys_ioctl_h.m4
+++ b/gl/m4/sys_ioctl_h.m4
@@ -1,5 +1,5 @@
# sys_ioctl_h.m4 serial 9
-dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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.
diff --git a/gl/m4/sys_select_h.m4 b/gl/m4/sys_select_h.m4
index 0e8063ea97..f1671186f3 100644
--- a/gl/m4/sys_select_h.m4
+++ b/gl/m4/sys_select_h.m4
@@ -1,5 +1,5 @@
-# sys_select_h.m4 serial 15
-dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
+# sys_select_h.m4 serial 16
+dnl Copyright (C) 2006-2011 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.
@@ -45,7 +45,6 @@ AC_DEFUN([gl_HEADER_SYS_SELECT],
])
fi
])
- AC_CHECK_HEADERS_ONCE([sys/select.h])
dnl <sys/select.h> is always overridden, because of GNULIB_POSIXCHECK.
gl_CHECK_NEXT_HEADERS([sys/select.h])
if test $ac_cv_header_sys_select_h = yes; then
diff --git a/gl/m4/sys_socket_h.m4 b/gl/m4/sys_socket_h.m4
index c7627cb94e..12dc05d42b 100644
--- a/gl/m4/sys_socket_h.m4
+++ b/gl/m4/sys_socket_h.m4
@@ -1,5 +1,5 @@
-# sys_socket_h.m4 serial 20
-dnl Copyright (C) 2005-2010 Free Software Foundation, Inc.
+# sys_socket_h.m4 serial 21
+dnl Copyright (C) 2005-2011 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.
@@ -9,8 +9,20 @@ dnl From Simon Josefsson.
AC_DEFUN([gl_HEADER_SYS_SOCKET],
[
AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_C_INLINE])
+ dnl On OSF/1, the functions recv(), send(), recvfrom(), sendto() have
+ dnl old-style declarations (with return type 'int' instead of 'ssize_t')
+ dnl unless _POSIX_PII_SOCKET is defined.
+ case "$host_os" in
+ osf*)
+ AC_DEFINE([_POSIX_PII_SOCKET], [1],
+ [Define to 1 in order to get the POSIX compatible declarations
+ of socket functions.])
+ ;;
+ esac
+
AC_CACHE_CHECK([whether <sys/socket.h> is self-contained],
[gl_cv_header_sys_socket_h_selfcontained],
[
diff --git a/gl/m4/sys_stat_h.m4 b/gl/m4/sys_stat_h.m4
index 7181c253b9..fc419129e9 100644
--- a/gl/m4/sys_stat_h.m4
+++ b/gl/m4/sys_stat_h.m4
@@ -1,5 +1,5 @@
# sys_stat_h.m4 serial 24 -*- Autoconf -*-
-dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2011 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.
diff --git a/gl/m4/sys_time_h.m4 b/gl/m4/sys_time_h.m4
index da57527163..3a3adc8c47 100644
--- a/gl/m4/sys_time_h.m4
+++ b/gl/m4/sys_time_h.m4
@@ -1,7 +1,7 @@
# Configure a replacement for <sys/time.h>.
# serial 6
-# Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/time_h.m4 b/gl/m4/time_h.m4
index a45a10a9ee..615da1cfd3 100644
--- a/gl/m4/time_h.m4
+++ b/gl/m4/time_h.m4
@@ -1,8 +1,8 @@
# Configure a more-standard replacement for <time.h>.
-# Copyright (C) 2000-2001, 2003-2007, 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2011 Free Software Foundation, Inc.
-# serial 2
+# serial 4
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -21,7 +21,7 @@ AC_DEFUN([gl_HEADER_TIME_H_BODY],
[
AC_REQUIRE([AC_C_RESTRICT])
AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
- gl_CHECK_NEXT_HEADERS([time.h])
+ gl_NEXT_HEADERS([time.h])
AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
])
@@ -95,7 +95,7 @@ AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS],
GNULIB_TIMEGM=0; AC_SUBST([GNULIB_TIMEGM])
GNULIB_TIME_R=0; AC_SUBST([GNULIB_TIME_R])
dnl Assume proper GNU behavior unless another module says otherwise.
- HAVE_LOCALTIME_R=1; AC_SUBST([HAVE_LOCALTIME_R])
+ HAVE_DECL_LOCALTIME_R=1; AC_SUBST([HAVE_DECL_LOCALTIME_R])
HAVE_NANOSLEEP=1; AC_SUBST([HAVE_NANOSLEEP])
HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME])
HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM])
diff --git a/gl/m4/timespec.m4 b/gl/m4/timespec.m4
index 5dbaed74a0..4a1c7adb4d 100644
--- a/gl/m4/timespec.m4
+++ b/gl/m4/timespec.m4
@@ -1,6 +1,6 @@
#serial 14
-# Copyright (C) 2000-2001, 2003-2007, 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2011 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/ungetc.m4 b/gl/m4/ungetc.m4
index 68ccf88349..749f6bd5dc 100644
--- a/gl/m4/ungetc.m4
+++ b/gl/m4/ungetc.m4
@@ -1,5 +1,5 @@
# ungetc.m4 serial 2
-dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2011 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.
diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4
index e2f7f2bf45..c81a1138e9 100644
--- a/gl/m4/unistd_h.m4
+++ b/gl/m4/unistd_h.m4
@@ -1,5 +1,5 @@
-# unistd_h.m4 serial 48
-dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
+# unistd_h.m4 serial 53
+dnl Copyright (C) 2006-2011 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.
@@ -14,8 +14,6 @@ AC_DEFUN([gl_UNISTD_H],
AC_REQUIRE([AC_C_INLINE])
gl_CHECK_NEXT_HEADERS([unistd.h])
-
- AC_CHECK_HEADERS_ONCE([unistd.h])
if test $ac_cv_header_unistd_h = yes; then
HAVE_UNISTD_H=1
else
@@ -38,7 +36,7 @@ AC_DEFUN([gl_UNISTD_H],
]], [chown dup2 dup3 environ euidaccess faccessat fchdir fchownat
fsync ftruncate getcwd getdomainname getdtablesize getgroups
gethostname getlogin getlogin_r getpagesize getusershell setusershell
- endusershell lchown link linkat lseek pipe2 pread pwrite readlink
+ endusershell lchown link linkat lseek pipe pipe2 pread pwrite readlink
readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat
usleep])
])
@@ -78,6 +76,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
GNULIB_LINK=0; AC_SUBST([GNULIB_LINK])
GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT])
GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK])
+ GNULIB_PIPE=0; AC_SUBST([GNULIB_PIPE])
GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2])
GNULIB_PREAD=0; AC_SUBST([GNULIB_PREAD])
GNULIB_PWRITE=0; AC_SUBST([GNULIB_PWRITE])
@@ -112,6 +111,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN])
HAVE_LINK=1; AC_SUBST([HAVE_LINK])
HAVE_LINKAT=1; AC_SUBST([HAVE_LINKAT])
+ HAVE_PIPE=1; AC_SUBST([HAVE_PIPE])
HAVE_PIPE2=1; AC_SUBST([HAVE_PIPE2])
HAVE_PREAD=1; AC_SUBST([HAVE_PREAD])
HAVE_PWRITE=1; AC_SUBST([HAVE_PWRITE])
@@ -120,14 +120,15 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP])
HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK])
HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT])
- HAVE_TTYNAME_R=1; AC_SUBST([HAVE_TTYNAME_R])
HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT])
HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP])
HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON])
+ HAVE_DECL_FCHDIR=1; AC_SUBST([HAVE_DECL_FCHDIR])
HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME])
HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE])
HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL])
+ HAVE_DECL_TTYNAME_R=1; AC_SUBST([HAVE_DECL_TTYNAME_R])
HAVE_OS_H=0; AC_SUBST([HAVE_OS_H])
HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H])
REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN])
@@ -137,6 +138,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT])
REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD])
REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME])
+ REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R])
REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS])
REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE])
REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN])
diff --git a/gl/m4/valgrind-tests.m4 b/gl/m4/valgrind-tests.m4
index e2434c6b83..8f90dac61d 100644
--- a/gl/m4/valgrind-tests.m4
+++ b/gl/m4/valgrind-tests.m4
@@ -1,5 +1,5 @@
# valgrind-tests.m4 serial 1
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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.
diff --git a/gl/m4/vasnprintf.m4 b/gl/m4/vasnprintf.m4
index 9c04520242..32ea985b3f 100644
--- a/gl/m4/vasnprintf.m4
+++ b/gl/m4/vasnprintf.m4
@@ -1,5 +1,5 @@
# vasnprintf.m4 serial 32
-dnl Copyright (C) 2002-2004, 2006-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2006-2011 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.
diff --git a/gl/m4/version-etc.m4 b/gl/m4/version-etc.m4
index 2c572b4bca..5032bf8553 100644
--- a/gl/m4/version-etc.m4
+++ b/gl/m4/version-etc.m4
@@ -1,5 +1,5 @@
# version-etc.m4 serial 1
-# Copyright (C) 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2009-2011 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/warn-on-use.m4 b/gl/m4/warn-on-use.m4
index 42daae87b8..e0d0f27640 100644
--- a/gl/m4/warn-on-use.m4
+++ b/gl/m4/warn-on-use.m4
@@ -1,5 +1,5 @@
# warn-on-use.m4 serial 2
-dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2011 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.
diff --git a/gl/m4/warnings.m4 b/gl/m4/warnings.m4
index dad5c1f29c..a8f3466326 100644
--- a/gl/m4/warnings.m4
+++ b/gl/m4/warnings.m4
@@ -1,5 +1,5 @@
# warnings.m4 serial 2
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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.
diff --git a/gl/m4/wchar_h.m4 b/gl/m4/wchar_h.m4
deleted file mode 100644
index 8c8fad96df..0000000000
--- a/gl/m4/wchar_h.m4
+++ /dev/null
@@ -1,154 +0,0 @@
-dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
-
-dnl Copyright (C) 2007-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.
-
-dnl Written by Eric Blake.
-
-# wchar_h.m4 serial 35
-
-AC_DEFUN([gl_WCHAR_H],
-[
- AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
- AC_REQUIRE([gl_WCHAR_H_INLINE_OK])
- dnl Prepare for creating substitute <wchar.h>.
- dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
- dnl character support).
- dnl <wchar.h> is always overridden, because of GNULIB_POSIXCHECK.
- AC_CHECK_HEADERS_ONCE([wchar.h])
- gl_CHECK_NEXT_HEADERS([wchar.h])
- if test $ac_cv_header_wchar_h = yes; then
- HAVE_WCHAR_H=1
- else
- HAVE_WCHAR_H=0
- fi
- AC_SUBST([HAVE_WCHAR_H])
-
- AC_REQUIRE([gl_FEATURES_H])
-
- AC_REQUIRE([gt_TYPE_WINT_T])
- if test $gt_cv_c_wint_t = yes; then
- HAVE_WINT_T=1
- else
- HAVE_WINT_T=0
- fi
- AC_SUBST([HAVE_WINT_T])
-
- dnl Check for declarations of anything we want to poison if the
- dnl corresponding gnulib module is not in use.
- gl_WARN_ON_USE_PREPARE([[
-/* Some systems require additional headers. */
-#if !(defined __GLIBC__ && !defined __UCLIBC__)
-# include <stddef.h>
-# include <stdio.h>
-# include <time.h>
-#endif
-#include <wchar.h>
- ]], [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb
- wcsrtombs wcsnrtombs wcwidth])
-])
-
-dnl Check whether <wchar.h> is usable at all.
-AC_DEFUN([gl_WCHAR_H_INLINE_OK],
-[
- dnl Test whether <wchar.h> suffers due to the transition from '__inline' to
- dnl 'gnu_inline'. See <http://sourceware.org/bugzilla/show_bug.cgi?id=4022>
- dnl and <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>. In summary,
- dnl glibc version 2.5 or older, together with gcc version 4.3 or newer and
- dnl the option -std=c99 or -std=gnu99, leads to a broken <wchar.h>.
- AC_CACHE_CHECK([whether <wchar.h> uses 'inline' correctly],
- [gl_cv_header_wchar_h_correct_inline],
- [gl_cv_header_wchar_h_correct_inline=yes
- AC_LANG_CONFTEST([
- AC_LANG_SOURCE([[#define wcstod renamed_wcstod
-#include <wchar.h>
-extern int zero (void);
-int main () { return zero(); }
-]])])
- if AC_TRY_EVAL([ac_compile]); then
- mv conftest.$ac_objext conftest1.$ac_objext
- AC_LANG_CONFTEST([
- AC_LANG_SOURCE([[#define wcstod renamed_wcstod
-#include <wchar.h>
-int zero (void) { return 0; }
-]])])
- if AC_TRY_EVAL([ac_compile]); then
- mv conftest.$ac_objext conftest2.$ac_objext
- if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then
- :
- else
- gl_cv_header_wchar_h_correct_inline=no
- fi
- fi
- fi
- rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext
- ])
- if test $gl_cv_header_wchar_h_correct_inline = no; then
- AC_MSG_ERROR([<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
-This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
-C99 mode. You have four options:
- - Add the flag -fgnu89-inline to CC and reconfigure, or
- - Fix your include files, using parts of
- <http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
- - Use a gcc version older than 4.3, or
- - Don't use the flags -std=c99 or -std=gnu99.
-Configuration aborted.])
- fi
-])
-
-dnl Unconditionally enables the replacement of <wchar.h>.
-AC_DEFUN([gl_REPLACE_WCHAR_H],
-[
- dnl This is a no-op, because <wchar.h> is always overridden.
- :
-])
-
-AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
-[
- dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
- AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
- gl_MODULE_INDICATOR_SET_VARIABLE([$1])
- dnl Define it also as a C macro, for the benefit of the unit tests.
- gl_MODULE_INDICATOR_FOR_TESTS([$1])
-])
-
-AC_DEFUN([gl_WCHAR_H_DEFAULTS],
-[
- GNULIB_BTOWC=0; AC_SUBST([GNULIB_BTOWC])
- GNULIB_WCTOB=0; AC_SUBST([GNULIB_WCTOB])
- GNULIB_MBSINIT=0; AC_SUBST([GNULIB_MBSINIT])
- GNULIB_MBRTOWC=0; AC_SUBST([GNULIB_MBRTOWC])
- GNULIB_MBRLEN=0; AC_SUBST([GNULIB_MBRLEN])
- GNULIB_MBSRTOWCS=0; AC_SUBST([GNULIB_MBSRTOWCS])
- GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS])
- GNULIB_WCRTOMB=0; AC_SUBST([GNULIB_WCRTOMB])
- GNULIB_WCSRTOMBS=0; AC_SUBST([GNULIB_WCSRTOMBS])
- GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS])
- GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH])
- dnl Assume proper GNU behavior unless another module says otherwise.
- HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC])
- HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT])
- HAVE_MBRTOWC=1; AC_SUBST([HAVE_MBRTOWC])
- HAVE_MBRLEN=1; AC_SUBST([HAVE_MBRLEN])
- HAVE_MBSRTOWCS=1; AC_SUBST([HAVE_MBSRTOWCS])
- HAVE_MBSNRTOWCS=1; AC_SUBST([HAVE_MBSNRTOWCS])
- HAVE_WCRTOMB=1; AC_SUBST([HAVE_WCRTOMB])
- HAVE_WCSRTOMBS=1; AC_SUBST([HAVE_WCSRTOMBS])
- HAVE_WCSNRTOMBS=1; AC_SUBST([HAVE_WCSNRTOMBS])
- HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB])
- HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH])
- REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T])
- REPLACE_BTOWC=0; AC_SUBST([REPLACE_BTOWC])
- REPLACE_WCTOB=0; AC_SUBST([REPLACE_WCTOB])
- REPLACE_MBSINIT=0; AC_SUBST([REPLACE_MBSINIT])
- REPLACE_MBRTOWC=0; AC_SUBST([REPLACE_MBRTOWC])
- REPLACE_MBRLEN=0; AC_SUBST([REPLACE_MBRLEN])
- REPLACE_MBSRTOWCS=0; AC_SUBST([REPLACE_MBSRTOWCS])
- REPLACE_MBSNRTOWCS=0; AC_SUBST([REPLACE_MBSNRTOWCS])
- REPLACE_WCRTOMB=0; AC_SUBST([REPLACE_WCRTOMB])
- REPLACE_WCSRTOMBS=0; AC_SUBST([REPLACE_WCSRTOMBS])
- REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS])
- REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH])
-])
diff --git a/gl/m4/wchar_t.m4 b/gl/m4/wchar_t.m4
index a133e6ad58..d2c03c42d2 100644
--- a/gl/m4/wchar_t.m4
+++ b/gl/m4/wchar_t.m4
@@ -1,5 +1,5 @@
# wchar_t.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2002-2003, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2008-2011 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.
diff --git a/gl/m4/wint_t.m4 b/gl/m4/wint_t.m4
index 58ef865565..da1ce3df60 100644
--- a/gl/m4/wint_t.m4
+++ b/gl/m4/wint_t.m4
@@ -1,5 +1,5 @@
# wint_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007-2011 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.
diff --git a/gl/m4/xsize.m4 b/gl/m4/xsize.m4
index b653693a30..8c693bc633 100644
--- a/gl/m4/xsize.m4
+++ b/gl/m4/xsize.m4
@@ -1,5 +1,5 @@
# xsize.m4 serial 4
-dnl Copyright (C) 2003-2004, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2004, 2008-2011 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.
diff --git a/gl/malloc.c b/gl/malloc.c
index 4fa38ee41b..a325d619b2 100644
--- a/gl/malloc.c
+++ b/gl/malloc.c
@@ -1,6 +1,6 @@
/* malloc() function that is glibc compatible.
- Copyright (C) 1997-1998, 2006-2007, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 1997-1998, 2006-2007, 2009-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/memchr.c b/gl/memchr.c
index 6c2b2d6c7d..6d903b1014 100644
--- a/gl/memchr.c
+++ b/gl/memchr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2010
+/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2011
Free Software Foundation, Inc.
Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
diff --git a/gl/minmax.h b/gl/minmax.h
index 78ca8479d8..172fafee4d 100644
--- a/gl/minmax.h
+++ b/gl/minmax.h
@@ -1,5 +1,5 @@
/* MIN, MAX macros.
- Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009, 2010 Free Software
+ Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2011 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
diff --git a/gl/netdb.in.h b/gl/netdb.in.h
index b0c553ef0d..850d97bd52 100644
--- a/gl/netdb.in.h
+++ b/gl/netdb.in.h
@@ -1,5 +1,5 @@
/* Provide a netdb.h header file for systems lacking it (read: MinGW).
- Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
Written by Simon Josefsson.
This program is free software; you can redistribute it and/or modify
@@ -51,6 +51,7 @@
# if !@HAVE_STRUCT_ADDRINFO@
+# if !GNULIB_defined_struct_addrinfo
/* Structure to contain information about address of a service provider. */
struct addrinfo
{
@@ -63,6 +64,8 @@ struct addrinfo
char *ai_canonname; /* Canonical name for service location. */
struct addrinfo *ai_next; /* Pointer to next in list. */
};
+# define GNULIB_defined_struct_addrinfo 1
+# endif
# endif
/* Possible values for `ai_flags' field in `addrinfo' structure. */
diff --git a/gl/netinet_in.in.h b/gl/netinet_in.in.h
index 4b0710fb8d..f5eea43d69 100644
--- a/gl/netinet_in.in.h
+++ b/gl/netinet_in.in.h
@@ -1,5 +1,5 @@
/* Substitute for <netinet/in.h>.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/perror.c b/gl/perror.c
index bc3c764911..2c13a8941a 100644
--- a/gl/perror.c
+++ b/gl/perror.c
@@ -1,5 +1,5 @@
/* Print a message describing error code.
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
Written by Bruno Haible and Simon Josefsson.
This program is free software: you can redistribute it and/or modify
diff --git a/gl/printf-args.c b/gl/printf-args.c
index 46c03a21ea..8f3727bb48 100644
--- a/gl/printf-args.c
+++ b/gl/printf-args.c
@@ -1,5 +1,5 @@
/* Decomposed printf argument list.
- Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2010 Free Software
+ Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2011 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
diff --git a/gl/printf-args.h b/gl/printf-args.h
index 2536ebafd3..70cca4fb65 100644
--- a/gl/printf-args.h
+++ b/gl/printf-args.h
@@ -1,5 +1,5 @@
/* Decomposed printf argument list.
- Copyright (C) 1999, 2002-2003, 2006-2007, 2009-2010 Free Software
+ Copyright (C) 1999, 2002-2003, 2006-2007, 2011 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -136,10 +136,14 @@ typedef struct
}
argument;
+/* Number of directly allocated arguments (no malloc() needed). */
+#define N_DIRECT_ALLOC_ARGUMENTS 7
+
typedef struct
{
size_t count;
argument *arg;
+ argument direct_alloc_arg[N_DIRECT_ALLOC_ARGUMENTS];
}
arguments;
diff --git a/gl/printf-parse.c b/gl/printf-parse.c
index 58cd889089..ff24ba47e2 100644
--- a/gl/printf-parse.c
+++ b/gl/printf-parse.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 1999-2000, 2002-2003, 2006-2010 Free Software Foundation, Inc.
+ Copyright (C) 1999-2000, 2002-2003, 2006-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -63,6 +63,9 @@
/* malloc(), realloc(), free(). */
#include <stdlib.h>
+/* memcpy(). */
+#include <string.h>
+
/* errno. */
#include <errno.h>
@@ -80,23 +83,20 @@ STATIC
int
PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
{
- const CHAR_T *cp = format; /* pointer into format */
+ const CHAR_T *cp = format; /* pointer into format */
size_t arg_posn = 0; /* number of regular arguments consumed */
- size_t d_allocated; /* allocated elements of d->dir */
- size_t a_allocated; /* allocated elements of a->arg */
+ size_t d_allocated; /* allocated elements of d->dir */
+ size_t a_allocated; /* allocated elements of a->arg */
size_t max_width_length = 0;
size_t max_precision_length = 0;
d->count = 0;
- d_allocated = 1;
- d->dir = (DIRECTIVE *) malloc (d_allocated * sizeof (DIRECTIVE));
- if (d->dir == NULL)
- /* Out of memory. */
- goto out_of_memory_1;
+ d_allocated = N_DIRECT_ALLOC_DIRECTIVES;
+ d->dir = d->direct_alloc_dir;
a->count = 0;
- a_allocated = 0;
- a->arg = NULL;
+ a_allocated = N_DIRECT_ALLOC_ARGUMENTS;
+ a->arg = a->direct_alloc_arg;
#define REGISTER_ARG(_index_,_type_) \
{ \
@@ -113,12 +113,14 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
if (size_overflow_p (memory_size)) \
/* Overflow, would lead to out of memory. */ \
goto out_of_memory; \
- memory = (argument *) (a->arg \
+ memory = (argument *) (a->arg != a->direct_alloc_arg \
? realloc (a->arg, memory_size) \
: malloc (memory_size)); \
if (memory == NULL) \
/* Out of memory. */ \
goto out_of_memory; \
+ if (a->arg == a->direct_alloc_arg) \
+ memcpy (memory, a->arg, a->count * sizeof (argument)); \
a->arg = memory; \
} \
while (a->count <= n) \
@@ -588,10 +590,14 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
if (size_overflow_p (memory_size))
/* Overflow, would lead to out of memory. */
goto out_of_memory;
- memory = (DIRECTIVE *) realloc (d->dir, memory_size);
+ memory = (DIRECTIVE *) (d->dir != d->direct_alloc_dir
+ ? realloc (d->dir, memory_size)
+ : malloc (memory_size));
if (memory == NULL)
/* Out of memory. */
goto out_of_memory;
+ if (d->dir == d->direct_alloc_dir)
+ memcpy (memory, d->dir, d->count * sizeof (DIRECTIVE));
d->dir = memory;
}
}
@@ -610,19 +616,18 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
return 0;
error:
- if (a->arg)
+ if (a->arg != a->direct_alloc_arg)
free (a->arg);
- if (d->dir)
+ if (d->dir != d->direct_alloc_dir)
free (d->dir);
errno = EINVAL;
return -1;
out_of_memory:
- if (a->arg)
+ if (a->arg != a->direct_alloc_arg)
free (a->arg);
- if (d->dir)
+ if (d->dir != d->direct_alloc_dir)
free (d->dir);
-out_of_memory_1:
errno = ENOMEM;
return -1;
}
diff --git a/gl/printf-parse.h b/gl/printf-parse.h
index 1b27040b7e..76e5ba3268 100644
--- a/gl/printf-parse.h
+++ b/gl/printf-parse.h
@@ -1,5 +1,5 @@
/* Parse printf format string.
- Copyright (C) 1999, 2002-2003, 2005, 2007, 2009-2010 Free Software
+ Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2011 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -47,6 +47,9 @@
/* xxx_directive: A parsed directive.
xxx_directives: A parsed format string. */
+/* Number of directly allocated directives (no malloc() needed). */
+#define N_DIRECT_ALLOC_DIRECTIVES 7
+
/* A parsed directive. */
typedef struct
{
@@ -71,6 +74,7 @@ typedef struct
char_directive *dir;
size_t max_width_length;
size_t max_precision_length;
+ char_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
}
char_directives;
@@ -100,6 +104,7 @@ typedef struct
u8_directive *dir;
size_t max_width_length;
size_t max_precision_length;
+ u8_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
}
u8_directives;
@@ -127,6 +132,7 @@ typedef struct
u16_directive *dir;
size_t max_width_length;
size_t max_precision_length;
+ u16_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
}
u16_directives;
@@ -154,6 +160,7 @@ typedef struct
u32_directive *dir;
size_t max_width_length;
size_t max_precision_length;
+ u32_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
}
u32_directives;
diff --git a/gl/progname.c b/gl/progname.c
index 1415e6a55f..2465748175 100644
--- a/gl/progname.c
+++ b/gl/progname.c
@@ -1,5 +1,5 @@
/* Program name management.
- Copyright (C) 2001-2003, 2005-2010 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2005-2011 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2001.
This program is free software: you can redistribute it and/or modify
diff --git a/gl/progname.h b/gl/progname.h
index 5ba303bd07..084406607d 100644
--- a/gl/progname.h
+++ b/gl/progname.h
@@ -1,5 +1,5 @@
/* Program name management.
- Copyright (C) 2001-2004, 2006, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006, 2009-2011 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2001.
This program is free software: you can redistribute it and/or modify
diff --git a/gl/read-file.c b/gl/read-file.c
index 8d70880e7d..bcbfbbb460 100644
--- a/gl/read-file.c
+++ b/gl/read-file.c
@@ -1,5 +1,5 @@
/* read-file.c -- read file contents into a string
- Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc.
Written by Simon Josefsson and Bruno Haible.
This program is free software; you can redistribute it and/or modify
@@ -39,12 +39,12 @@
and set *LENGTH to the length of the string. The string is
zero-terminated, but the terminating zero byte is not counted in
*LENGTH. On errors, *LENGTH is undefined, errno preserves the
- values set by system functions (if any), and NULL is returned. */
+ values set by system functions (if any), and NULL is returned. */
char *
-fread_file (FILE * stream, size_t * length)
+fread_file (FILE *stream, size_t *length)
{
char *buf = NULL;
- size_t alloc = 0;
+ size_t alloc = BUFSIZ;
/* For a regular file, allocate a buffer that has exactly the right
size. This avoids the need to do dynamic reallocations later. */
@@ -59,59 +59,31 @@ fread_file (FILE * stream, size_t * length)
{
off_t alloc_off = st.st_size - pos;
- if (SIZE_MAX <= alloc_off)
+ /* '1' below, accounts for the trailing NUL. */
+ if (SIZE_MAX - 1 < alloc_off)
{
errno = ENOMEM;
return NULL;
}
alloc = alloc_off + 1;
-
- buf = malloc (alloc);
- if (!buf)
- /* errno is ENOMEM. */
- return NULL;
}
}
}
+ if (!(buf = malloc (alloc)))
+ return NULL; /* errno is ENOMEM. */
+
{
size_t size = 0; /* number of bytes read so far */
int save_errno;
for (;;)
{
- size_t count;
- size_t requested;
-
- if (size + BUFSIZ + 1 > alloc)
- {
- char *new_buf;
- size_t new_alloc = alloc + alloc / 2;
-
- /* Check against overflow. */
- if (new_alloc < alloc)
- {
- save_errno = ENOMEM;
- break;
- }
-
- alloc = new_alloc;
- if (alloc < size + BUFSIZ + 1)
- alloc = size + BUFSIZ + 1;
-
- new_buf = realloc (buf, alloc);
- if (!new_buf)
- {
- save_errno = errno;
- break;
- }
-
- buf = new_buf;
- }
-
- requested = alloc - size - 1;
- count = fread (buf + size, 1, requested, stream);
+ /* This reads 1 more than the size of a regular file
+ so that we get eof immediately. */
+ size_t requested = alloc - size;
+ size_t count = fread (buf + size, 1, requested, stream);
size += count;
if (count != requested)
@@ -121,7 +93,7 @@ fread_file (FILE * stream, size_t * length)
break;
/* Shrink the allocated memory if possible. */
- if (size + 1 < alloc)
+ if (size < alloc - 1)
{
char *smaller_buf = realloc (buf, size + 1);
if (smaller_buf != NULL)
@@ -132,6 +104,29 @@ fread_file (FILE * stream, size_t * length)
*length = size;
return buf;
}
+
+ {
+ char *new_buf;
+
+ if (alloc == SIZE_MAX)
+ {
+ save_errno = ENOMEM;
+ break;
+ }
+
+ if (alloc < SIZE_MAX - alloc / 2)
+ alloc = alloc + alloc / 2;
+ else
+ alloc = SIZE_MAX;
+
+ if (!(new_buf = realloc (buf, alloc)))
+ {
+ save_errno = errno;
+ break;
+ }
+
+ buf = new_buf;
+ }
}
free (buf);
@@ -141,7 +136,7 @@ fread_file (FILE * stream, size_t * length)
}
static char *
-internal_read_file (const char *filename, size_t * length, const char *mode)
+internal_read_file (const char *filename, size_t *length, const char *mode)
{
FILE *stream = fopen (filename, mode);
char *out;
@@ -175,7 +170,7 @@ internal_read_file (const char *filename, size_t * length, const char *mode)
undefined, errno preserves the values set by system functions (if
any), and NULL is returned. */
char *
-read_file (const char *filename, size_t * length)
+read_file (const char *filename, size_t *length)
{
return internal_read_file (filename, length, "r");
}
@@ -188,7 +183,7 @@ read_file (const char *filename, size_t * length)
preserves the values set by system functions (if any), and NULL is
returned. */
char *
-read_binary_file (const char *filename, size_t * length)
+read_binary_file (const char *filename, size_t *length)
{
return internal_read_file (filename, length, "rb");
}
diff --git a/gl/read-file.h b/gl/read-file.h
index 8b6ae436cd..42663ef666 100644
--- a/gl/read-file.h
+++ b/gl/read-file.h
@@ -1,5 +1,5 @@
/* read-file.h -- read file contents into a string
- Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc.
Written by Simon Josefsson.
This program is free software; you can redistribute it and/or modify
diff --git a/gl/readline.c b/gl/readline.c
index d42f29669e..72a93c3ac0 100644
--- a/gl/readline.c
+++ b/gl/readline.c
@@ -1,5 +1,5 @@
/* readline.c --- Simple implementation of readline.
- Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2005-2007, 2009-2011 Free Software Foundation, Inc.
Written by Simon Josefsson
This program is free software: you can redistribute it and/or modify
diff --git a/gl/readline.h b/gl/readline.h
index 44ec014062..ac77b536bc 100644
--- a/gl/readline.h
+++ b/gl/readline.h
@@ -1,5 +1,5 @@
/* readline.h --- Simple implementation of readline.
- Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2009-2011 Free Software Foundation, Inc.
Written by Simon Josefsson
This program is free software: you can redistribute it and/or modify
diff --git a/gl/realloc.c b/gl/realloc.c
index 053208f375..6ef37e794f 100644
--- a/gl/realloc.c
+++ b/gl/realloc.c
@@ -1,6 +1,6 @@
/* realloc() function that is glibc compatible.
- Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2010 Free Software
+ Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2011 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
diff --git a/gl/recv.c b/gl/recv.c
index cd93cbc120..d99b7a40a1 100644
--- a/gl/recv.c
+++ b/gl/recv.c
@@ -1,6 +1,6 @@
/* recv.c --- wrappers for Windows recv function
- Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/select.c b/gl/select.c
index 2e99f96001..e4fb44553b 100644
--- a/gl/select.c
+++ b/gl/select.c
@@ -1,7 +1,7 @@
/* Emulation for select(2)
Contributed by Paolo Bonzini.
- Copyright 2008-2010 Free Software Foundation, Inc.
+ Copyright 2008-2011 Free Software Foundation, Inc.
This file is part of gnulib.
diff --git a/gl/send.c b/gl/send.c
index 6ab4b01265..d8a876ec3b 100644
--- a/gl/send.c
+++ b/gl/send.c
@@ -1,6 +1,6 @@
/* send.c --- wrappers for Windows send function
- Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/setsockopt.c b/gl/setsockopt.c
index 24a8d6e5bf..a31a10ee92 100644
--- a/gl/setsockopt.c
+++ b/gl/setsockopt.c
@@ -1,6 +1,6 @@
/* setsockopt.c --- wrappers for Windows setsockopt function
- Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/shutdown.c b/gl/shutdown.c
index 251c890180..26c49323ae 100644
--- a/gl/shutdown.c
+++ b/gl/shutdown.c
@@ -1,6 +1,6 @@
/* shutdown.c --- wrappers for Windows shutdown function
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/size_max.h b/gl/size_max.h
index 56d5a9b1c5..d5f31522c8 100644
--- a/gl/size_max.h
+++ b/gl/size_max.h
@@ -1,5 +1,5 @@
/* size_max.h -- declare SIZE_MAX through system headers
- Copyright (C) 2005-2006, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2011 Free Software Foundation, Inc.
Written by Simon Josefsson.
This program is free software; you can redistribute it and/or modify
diff --git a/gl/snprintf.c b/gl/snprintf.c
index 810ca14bc9..9db2379a88 100644
--- a/gl/snprintf.c
+++ b/gl/snprintf.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 2004, 2006-2010 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2006-2011 Free Software Foundation, Inc.
Written by Simon Josefsson and Paul Eggert.
This program is free software; you can redistribute it and/or modify
diff --git a/gl/socket.c b/gl/socket.c
index 63e0aaea6e..af6be25572 100644
--- a/gl/socket.c
+++ b/gl/socket.c
@@ -1,6 +1,6 @@
/* socket.c --- wrappers for Windows socket function
- Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/sockets.c b/gl/sockets.c
index b946c7e63d..4e905e1ddd 100644
--- a/gl/sockets.c
+++ b/gl/sockets.c
@@ -1,6 +1,6 @@
/* sockets.c --- wrappers for Windows socket functions
- Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/sockets.h b/gl/sockets.h
index 921bf6f793..93ae5d2800 100644
--- a/gl/sockets.h
+++ b/gl/sockets.h
@@ -1,6 +1,6 @@
/* sockets.h - wrappers for Windows socket functions
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/stdarg.in.h b/gl/stdarg.in.h
index 8b88449e2f..4469d54e4f 100644
--- a/gl/stdarg.in.h
+++ b/gl/stdarg.in.h
@@ -1,5 +1,5 @@
/* Substitute for and wrapper around <stdarg.h>.
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/stdbool.in.h b/gl/stdbool.in.h
index 574c281a8f..b64dc75b20 100644
--- a/gl/stdbool.in.h
+++ b/gl/stdbool.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2003, 2006-2010 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2003, 2006-2011 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
diff --git a/gl/stddef.in.h b/gl/stddef.in.h
index 6642d49e2a..62a91a7a6a 100644
--- a/gl/stddef.in.h
+++ b/gl/stddef.in.h
@@ -1,6 +1,6 @@
/* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/stdint.in.h b/gl/stdint.in.h
index 9909f57e4b..b32227bb04 100644
--- a/gl/stdint.in.h
+++ b/gl/stdint.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2002, 2004-2010 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2002, 2004-2011 Free Software Foundation, Inc.
Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
This file is part of gnulib.
@@ -108,6 +108,8 @@
warnings in the signed case. */ \
((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
+#if !GNULIB_defined_stdint_types
+
/* 7.18.1.1. Exact-width integer types */
/* Here we assume a standard architecture where the hardware integer
@@ -137,9 +139,10 @@ typedef unsigned int gl_uint32_t;
/* If the system defines INT64_MAX, assume int64_t works. That way,
if the underlying platform defines int64_t to be a 64-bit long long
int, the code below won't mistakenly define it to be a 64-bit long
- int, which would mess up C++ name mangling. */
+ int, which would mess up C++ name mangling. We must use #ifdef
+ rather than #if, to avoid an error with HP-UX 10.20 cc. */
-#if INT64_MAX
+#ifdef INT64_MAX
# define GL_INT64_T
#else
/* Do not undefine int64_t if gnulib is not being used with 64-bit
@@ -162,7 +165,7 @@ typedef long long int gl_int64_t;
# endif
#endif
-#if UINT64_MAX
+#ifdef UINT64_MAX
# define GL_UINT64_T
#else
# if ULONG_MAX >> 31 >> 31 >> 1 == 1
@@ -295,6 +298,9 @@ typedef unsigned long int gl_uintmax_t;
typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
? 1 : -1];
+#define GNULIB_defined_stdint_types 1
+#endif /* !GNULIB_defined_stdint_types */
+
/* 7.18.2. Limits of specified-width integer types */
#if ! defined __cplusplus || defined __STDC_LIMIT_MACROS
@@ -491,7 +497,12 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
sequence of nested includes
<wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
<stdint.h> and assumes its types are already defined. */
-#if ! (defined WCHAR_MIN && defined WCHAR_MAX)
+#if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX)
+ /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
# include <wchar.h>
# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
diff --git a/gl/stdio-impl.h b/gl/stdio-impl.h
index 0e67f66ef6..d41c32f4b7 100644
--- a/gl/stdio-impl.h
+++ b/gl/stdio-impl.h
@@ -1,5 +1,5 @@
/* Implementation details of FILE streams.
- Copyright (C) 2007-2008, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2008, 2010-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -75,6 +75,17 @@
/* SystemV derived implementations. */
+#ifdef __TANDEM /* NonStop Kernel */
+# ifndef _IOERR
+/* These values were determined by the program 'stdioext-flags' at
+ <http://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00165.html>. */
+# define _IOERR 0x40
+# define _IOREAD 0x80
+# define _IOWRT 0x4
+# define _IORW 0x100
+# endif
+#endif
+
#if defined _IOERR
# if defined __sun && defined _LP64 /* Solaris/{SPARC,AMD64} 64-bit */
diff --git a/gl/stdio-write.c b/gl/stdio-write.c
index a6a0eb143d..10fcfba9e3 100644
--- a/gl/stdio-write.c
+++ b/gl/stdio-write.c
@@ -1,5 +1,5 @@
/* POSIX compatible FILE stream write function.
- Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This program is free software: you can redistribute it and/or modify
diff --git a/gl/stdio.in.h b/gl/stdio.in.h
index 45eaa1c22b..b7f3b6f85b 100644
--- a/gl/stdio.in.h
+++ b/gl/stdio.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <stdio.h>.
- Copyright (C) 2004, 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2007-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,8 +21,14 @@
#endif
@PRAGMA_COLUMNS@
-#if defined __need_FILE || defined __need___FILE
-/* Special invocation convention inside glibc header files. */
+#if defined __need_FILE || defined __need___FILE || defined _GL_ALREADY_INCLUDING_STDIO_H
+/* Special invocation convention:
+ - Inside glibc header files.
+ - On OSF/1 5.1 we have a sequence of nested includes
+ <stdio.h> -> <getopt.h> -> <ctype.h> -> <sys/localedef.h> ->
+ <sys/lc_core.h> -> <nl_types.h> -> <mesg.h> -> <stdio.h>.
+ In this situation, the functions are not yet declared, therefore we cannot
+ provide the C++ aliases. */
#@INCLUDE_NEXT@ @NEXT_STDIO_H@
@@ -31,9 +37,13 @@
#ifndef _GL_STDIO_H
+#define _GL_ALREADY_INCLUDING_STDIO_H
+
/* The include_next requires a split double-inclusion guard. */
#@INCLUDE_NEXT@ @NEXT_STDIO_H@
+#undef _GL_ALREADY_INCLUDING_STDIO_H
+
#ifndef _GL_STDIO_H
#define _GL_STDIO_H
@@ -42,20 +52,23 @@
#include <stddef.h>
-/* Get off_t and ssize_t. Needed on many systems, including glibc 2.8. */
+/* Get off_t and ssize_t. Needed on many systems, including glibc 2.8
+ and eglibc 2.11.2. */
#include <sys/types.h>
-#ifndef __attribute__
/* The __attribute__ feature is available in gcc versions 2.5 and later.
The __-protected variants of the attributes 'format' and 'printf' are
accepted by gcc versions 2.6.4 (effectively 2.7) and later.
- We enable __attribute__ only if these are supported too, because
+ We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
gnulib and libintl do '#define printf __printf__' when they override
the 'printf' function. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-# define __attribute__(Spec) /* empty */
-# endif
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+#else
+# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
#endif
+#define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
+ _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
/* Solaris 10 declares renameat in <unistd.h>, not in <stdio.h>. */
/* But in any case avoid namespace pollution on glibc systems. */
@@ -82,13 +95,13 @@
# define dprintf rpl_dprintf
# endif
_GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *format, ...));
# else
# if !@HAVE_DPRINTF@
_GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *format, ...));
@@ -179,7 +192,7 @@ _GL_WARN_ON_USE (fopen, "fopen on Win32 platforms is not POSIX compatible - "
# endif
# define GNULIB_overrides_fprintf 1
_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (fprintf, int, (FILE *fp, const char *format, ...));
# else
@@ -345,7 +358,7 @@ _GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence));
# else
-# if ! @HAVE_FSEEKO@
+# if ! @HAVE_DECL_FSEEKO@
_GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)
_GL_ARG_NONNULL ((1)));
# endif
@@ -356,17 +369,20 @@ _GL_CXXALIASWARN (fseeko);
/* Provide an fseek function that is consistent with fseeko. */
/* In order to avoid that fseek gets defined as a macro here, the
developer can request the 'fseek' module. */
-# undef fseek
-# define fseek rpl_fseek
+# if !GNULIB_defined_fseek_function
+# undef fseek
+# define fseek rpl_fseek
static inline int _GL_ARG_NONNULL ((1))
rpl_fseek (FILE *fp, long offset, int whence)
{
-# if @REPLACE_FSEEKO@
+# if @REPLACE_FSEEKO@
return rpl_fseeko (fp, offset, whence);
-# else
+# else
return fseeko (fp, offset, whence);
-# endif
+# endif
}
+# define GNULIB_defined_fseek_function 1
+# endif
# endif
#elif defined GNULIB_POSIXCHECK
# define _GL_FSEEK_WARN /* Category 1, above. */
@@ -421,7 +437,7 @@ _GL_CXXALIASWARN (ftell);
_GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp));
# else
-# if ! @HAVE_FTELLO@
+# if ! @HAVE_DECL_FTELLO@
_GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
@@ -431,17 +447,20 @@ _GL_CXXALIASWARN (ftello);
/* Provide an ftell function that is consistent with ftello. */
/* In order to avoid that ftell gets defined as a macro here, the
developer can request the 'ftell' module. */
-# undef ftell
-# define ftell rpl_ftell
+# if !GNULIB_defined_ftell_function
+# undef ftell
+# define ftell rpl_ftell
static inline long _GL_ARG_NONNULL ((1))
rpl_ftell (FILE *f)
{
-# if @REPLACE_FTELLO@
+# if @REPLACE_FTELLO@
return rpl_ftello (f);
-# else
+# else
return ftello (f);
-# endif
+# endif
}
+# define GNULIB_defined_ftell_function 1
+# endif
# endif
#elif defined GNULIB_POSIXCHECK
# define _GL_FTELL_WARN /* Category 1, above. */
@@ -570,7 +589,7 @@ struct obstack;
# endif
_GL_FUNCDECL_RPL (obstack_printf, int,
(struct obstack *obs, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (obstack_printf, int,
(struct obstack *obs, const char *format, ...));
@@ -578,7 +597,7 @@ _GL_CXXALIAS_RPL (obstack_printf, int,
# if !@HAVE_DECL_OBSTACK_PRINTF@
_GL_FUNCDECL_SYS (obstack_printf, int,
(struct obstack *obs, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (obstack_printf, int,
@@ -591,7 +610,7 @@ _GL_CXXALIASWARN (obstack_printf);
# endif
_GL_FUNCDECL_RPL (obstack_vprintf, int,
(struct obstack *obs, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (obstack_vprintf, int,
(struct obstack *obs, const char *format, va_list args));
@@ -599,7 +618,7 @@ _GL_CXXALIAS_RPL (obstack_vprintf, int,
# if !@HAVE_DECL_OBSTACK_PRINTF@
_GL_FUNCDECL_SYS (obstack_vprintf, int,
(struct obstack *obs, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (obstack_vprintf, int,
@@ -662,13 +681,16 @@ _GL_FUNCDECL_RPL_1 (__printf__, int,
(const char *format, ...)
__asm__ (@ASM_SYMBOL_PREFIX@
_GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
- __attribute__ ((__format__ (__printf__, 1, 2)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
# else
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define printf rpl_printf
+# endif
_GL_FUNCDECL_RPL (printf, int,
(const char *format, ...)
- __attribute__ ((__format__ (__printf__, 1, 2)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (printf, int, (const char *format, ...));
# endif
@@ -808,7 +830,7 @@ _GL_WARN_ON_USE (renameat, "renameat is not portable - "
# endif
_GL_FUNCDECL_RPL (snprintf, int,
(char *str, size_t size, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 3, 4)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
_GL_ARG_NONNULL ((3)));
_GL_CXXALIAS_RPL (snprintf, int,
(char *str, size_t size, const char *format, ...));
@@ -816,7 +838,7 @@ _GL_CXXALIAS_RPL (snprintf, int,
# if !@HAVE_DECL_SNPRINTF@
_GL_FUNCDECL_SYS (snprintf, int,
(char *str, size_t size, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 3, 4)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
_GL_ARG_NONNULL ((3)));
# endif
_GL_CXXALIAS_SYS (snprintf, int,
@@ -846,7 +868,7 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
# define sprintf rpl_sprintf
# endif
_GL_FUNCDECL_RPL (sprintf, int, (char *str, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (sprintf, int, (char *str, const char *format, ...));
# else
@@ -891,7 +913,7 @@ _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
# endif
_GL_FUNCDECL_RPL (asprintf, int,
(char **result, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (asprintf, int,
(char **result, const char *format, ...));
@@ -899,7 +921,7 @@ _GL_CXXALIAS_RPL (asprintf, int,
# if !@HAVE_VASPRINTF@
_GL_FUNCDECL_SYS (asprintf, int,
(char **result, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (asprintf, int,
@@ -912,7 +934,7 @@ _GL_CXXALIASWARN (asprintf);
# endif
_GL_FUNCDECL_RPL (vasprintf, int,
(char **result, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (vasprintf, int,
(char **result, const char *format, va_list args));
@@ -920,7 +942,7 @@ _GL_CXXALIAS_RPL (vasprintf, int,
# if !@HAVE_VASPRINTF@
_GL_FUNCDECL_SYS (vasprintf, int,
(char **result, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (vasprintf, int,
@@ -935,13 +957,13 @@ _GL_CXXALIASWARN (vasprintf);
# define vdprintf rpl_vdprintf
# endif
_GL_FUNCDECL_RPL (vdprintf, int, (int fd, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (vdprintf, int, (int fd, const char *format, va_list args));
# else
# if !@HAVE_VDPRINTF@
_GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((2)));
# endif
/* Need to cast, because on Solaris, the third parameter will likely be
@@ -966,7 +988,7 @@ _GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
# endif
# define GNULIB_overrides_vfprintf 1
_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args));
# else
@@ -996,7 +1018,7 @@ _GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
# endif
# define GNULIB_overrides_vprintf 1
_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 1, 0)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (1, 0)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (vprintf, int, (const char *format, va_list args));
# else
@@ -1024,7 +1046,7 @@ _GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
# endif
_GL_FUNCDECL_RPL (vsnprintf, int,
(char *str, size_t size, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 3, 0)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
_GL_ARG_NONNULL ((3)));
_GL_CXXALIAS_RPL (vsnprintf, int,
(char *str, size_t size, const char *format, va_list args));
@@ -1032,7 +1054,7 @@ _GL_CXXALIAS_RPL (vsnprintf, int,
# if !@HAVE_DECL_VSNPRINTF@
_GL_FUNCDECL_SYS (vsnprintf, int,
(char *str, size_t size, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 3, 0)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
_GL_ARG_NONNULL ((3)));
# endif
_GL_CXXALIAS_SYS (vsnprintf, int,
@@ -1054,7 +1076,7 @@ _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
# endif
_GL_FUNCDECL_RPL (vsprintf, int,
(char *str, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (vsprintf, int,
(char *str, const char *format, va_list args));
diff --git a/gl/stdlib.in.h b/gl/stdlib.in.h
index e6dcdbc841..62d18c6281 100644
--- a/gl/stdlib.in.h
+++ b/gl/stdlib.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <stdlib.h>.
- Copyright (C) 1995, 2001-2004, 2006-2010 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2001-2004, 2006-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -49,21 +49,23 @@
# include <sys/loadavg.h>
#endif
+#if @GNULIB_RANDOM_R@
+
/* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
- from <stdlib.h> if _REENTRANT is defined. Include it always. */
-#if @HAVE_RANDOM_H@
-# include <random.h>
-#endif
+ from <stdlib.h> if _REENTRANT is defined. Include it whenever we need
+ 'struct random_data'. */
+# if @HAVE_RANDOM_H@
+# include <random.h>
+# endif
-#if !@HAVE_STRUCT_RANDOM_DATA@ || (@GNULIB_RANDOM_R@ && !@HAVE_RANDOM_R@) \
- || defined GNULIB_POSIXCHECK
-# include <stdint.h>
-#endif
+# if !@HAVE_STRUCT_RANDOM_DATA@ || !@HAVE_RANDOM_R@
+# include <stdint.h>
+# endif
-#if !@HAVE_STRUCT_RANDOM_DATA@
+# if !@HAVE_STRUCT_RANDOM_DATA@
/* Define 'struct random_data'.
But allow multiple gnulib generated <stdlib.h> replacements to coexist. */
-# if !GNULIB_defined_struct_random_data
+# if !GNULIB_defined_struct_random_data
struct random_data
{
int32_t *fptr; /* Front pointer. */
@@ -74,7 +76,8 @@ struct random_data
int rand_sep; /* Distance between front and rear. */
int32_t *end_ptr; /* Pointer behind state table. */
};
-# define GNULIB_defined_struct_random_data 1
+# define GNULIB_defined_struct_random_data 1
+# endif
# endif
#endif
@@ -85,10 +88,10 @@ struct random_data
# include <unistd.h>
#endif
-#ifndef __attribute__
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
-# define __attribute__(Spec) /* empty */
-# endif
+#if 3 <= __GNUC__ || __GNUC__ == 2 && 8 <= __GNUC_MINOR__
+# define _GL_ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
+#else
+# define _GL_ATTRIBUTE_NORETURN
#endif
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
@@ -116,7 +119,7 @@ struct random_data
/* Terminate the current process with the given return code, without running
the 'atexit' handlers. */
# if !@HAVE__EXIT@
-_GL_FUNCDECL_SYS (_Exit, void, (int status) __attribute__ ((__noreturn__)));
+_GL_FUNCDECL_SYS (_Exit, void, (int status) _GL_ATTRIBUTE_NORETURN);
# endif
_GL_CXXALIAS_SYS (_Exit, void, (int status));
_GL_CXXALIASWARN (_Exit);
@@ -584,7 +587,7 @@ _GL_FUNCDECL_RPL (setenv, int,
_GL_CXXALIAS_RPL (setenv, int,
(const char *name, const char *value, int replace));
# else
-# if !@HAVE_SETENV@
+# if !@HAVE_DECL_SETENV@
_GL_FUNCDECL_SYS (setenv, int,
(const char *name, const char *value, int replace)
_GL_ARG_NONNULL ((1)));
@@ -592,7 +595,9 @@ _GL_FUNCDECL_SYS (setenv, int,
_GL_CXXALIAS_SYS (setenv, int,
(const char *name, const char *value, int replace));
# endif
+# if !(@REPLACE_SETENV@ && !@HAVE_DECL_SETENV@)
_GL_CXXALIASWARN (setenv);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef setenv
# if HAVE_RAW_DECL_SETENV
@@ -702,12 +707,14 @@ _GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - "
_GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
# else
-# if !@HAVE_UNSETENV@
+# if !@HAVE_DECL_UNSETENV@
_GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
# endif
+# if !(@REPLACE_UNSETENV@ && !@HAVE_DECL_UNSETENV@)
_GL_CXXALIASWARN (unsetenv);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef unsetenv
# if HAVE_RAW_DECL_UNSETENV
diff --git a/gl/strerror.c b/gl/strerror.c
index 6e1c0b0ebb..5dae1111a2 100644
--- a/gl/strerror.c
+++ b/gl/strerror.c
@@ -1,6 +1,6 @@
/* strerror.c --- POSIX compatible system error routine
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/string.in.h b/gl/string.in.h
index b0c2ba1e1c..336e246517 100644
--- a/gl/string.in.h
+++ b/gl/string.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <string.h>.
- Copyright (C) 1995-1996, 2001-2010 Free Software Foundation, Inc.
+ Copyright (C) 1995-1996, 2001-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -37,13 +37,8 @@
# include <wchar.h>
#endif
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
-# define __attribute__(Spec) /* empty */
-# endif
-#endif
-/* The attribute __pure__ was added in gcc 2.96. */
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The attribute __pure__ was added in gcc 2.96. */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
#else
diff --git a/gl/sys_select.in.h b/gl/sys_select.in.h
index 49347b63f8..edff386250 100644
--- a/gl/sys_select.in.h
+++ b/gl/sys_select.in.h
@@ -1,5 +1,5 @@
/* Substitute for <sys/select.h>.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -44,6 +44,8 @@
/* On OSF/1 4.0, <sys/select.h> provides only a forward declaration
of 'struct timeval', and no definition of this type.
+ Also, MacOS X, AIX, HP-UX, IRIX, Solaris, Interix declare select()
+ in <sys/time.h>.
But avoid namespace pollution on glibc systems. */
# ifndef __GLIBC__
# include <sys/time.h>
@@ -65,8 +67,19 @@
#ifndef _GL_SYS_SELECT_H
#define _GL_SYS_SELECT_H
-#if !@HAVE_SYS_SELECT_H@ || @REPLACE_SELECT@
+#if !@HAVE_SYS_SELECT_H@
/* A platform that lacks <sys/select.h>. */
+/* Get the 'struct timeval' and 'fd_set' types and the FD_* macros
+ on most platforms. */
+# include <sys/time.h>
+/* On HP-UX 11, <sys/time.h> provides an FD_ZERO implementation
+ that relies on memset(), but without including <string.h>. */
+# if defined __hpux
+# include <string.h>
+# endif
+/* On native Windows platforms:
+ Get the 'fd_set' type. Also, gnulib's <sys/socket.h> redefines select
+ so as to hide the declaration from <winsock2.h>. */
# include <sys/socket.h>
#endif
diff --git a/gl/sys_socket.in.h b/gl/sys_socket.in.h
index 339cabb958..8e12044b1f 100644
--- a/gl/sys_socket.in.h
+++ b/gl/sys_socket.in.h
@@ -1,6 +1,6 @@
/* Provide a sys/socket header file for systems lacking it (read: MinGW)
and for systems where it is incomplete.
- Copyright (C) 2005-2010 Free Software Foundation, Inc.
+ Copyright (C) 2005-2011 Free Software Foundation, Inc.
Written by Simon Josefsson.
This program is free software; you can redistribute it and/or modify
@@ -67,7 +67,10 @@
/* The definition of _GL_WARN_ON_USE is copied here. */
#if !@HAVE_SA_FAMILY_T@
+# if !GNULIB_defined_sa_family_t
typedef unsigned short sa_family_t;
+# define GNULIB_defined_sa_family_t 1
+# endif
#endif
#if @HAVE_STRUCT_SOCKADDR_STORAGE@
@@ -89,12 +92,16 @@ typedef unsigned short sa_family_t;
: alignof (__ss_aligntype)) \
+ sizeof (__ss_aligntype)))
+# if !GNULIB_defined_struct_sockaddr_storage
struct sockaddr_storage
{
sa_family_t ss_family; /* Address family, etc. */
__ss_aligntype __ss_align; /* Force desired alignment. */
char __ss_padding[_SS_PADSIZE];
};
+# define GNULIB_defined_struct_sockaddr_storage 1
+# endif
+
#endif
#if @HAVE_SYS_SOCKET_H@
@@ -159,7 +166,10 @@ struct sockaddr_storage
# include <sys/types.h>
# include <io.h>
+# if !GNULIB_defined_socklen_t
typedef int socklen_t;
+# define GNULIB_defined_socklen_t 1
+# endif
# endif
@@ -167,6 +177,8 @@ typedef int socklen_t;
#if @HAVE_WINSOCK2_H@
+# if !GNULIB_defined_rpl_fd_isset
+
/* Re-define FD_ISSET to avoid a WSA call while we are not using
network sockets. */
static inline int
@@ -183,6 +195,9 @@ rpl_fd_isset (SOCKET fd, fd_set * set)
return 0;
}
+# define GNULIB_defined_rpl_fd_isset 1
+# endif
+
# undef FD_ISSET
# define FD_ISSET(fd, set) rpl_fd_isset(fd, set)
@@ -245,8 +260,11 @@ _GL_FUNCDECL_RPL (connect, int,
_GL_CXXALIAS_RPL (connect, int,
(int fd, const struct sockaddr *addr, socklen_t addrlen));
# else
-_GL_CXXALIAS_SYS (connect, int,
- (int fd, const struct sockaddr *addr, socklen_t addrlen));
+/* Need to cast, because on NonStop Kernel, the third parameter is
+ size_t addrlen. */
+_GL_CXXALIAS_SYS_CAST (connect, int,
+ (int fd,
+ const struct sockaddr *addr, socklen_t addrlen));
# endif
_GL_CXXALIASWARN (connect);
#elif @HAVE_WINSOCK2_H@
@@ -300,8 +318,11 @@ _GL_FUNCDECL_RPL (bind, int,
_GL_CXXALIAS_RPL (bind, int,
(int fd, const struct sockaddr *addr, socklen_t addrlen));
# else
-_GL_CXXALIAS_SYS (bind, int,
- (int fd, const struct sockaddr *addr, socklen_t addrlen));
+/* Need to cast, because on NonStop Kernel, the third parameter is
+ size_t addrlen. */
+_GL_CXXALIAS_SYS_CAST (bind, int,
+ (int fd,
+ const struct sockaddr *addr, socklen_t addrlen));
# endif
_GL_CXXALIASWARN (bind);
#elif @HAVE_WINSOCK2_H@
@@ -522,9 +543,11 @@ _GL_CXXALIAS_RPL (sendto, ssize_t,
(int fd, const void *buf, size_t len, int flags,
const struct sockaddr *to, socklen_t tolen));
# else
-_GL_CXXALIAS_SYS (sendto, ssize_t,
- (int fd, const void *buf, size_t len, int flags,
- const struct sockaddr *to, socklen_t tolen));
+/* Need to cast, because on NonStop Kernel, the sixth parameter is
+ size_t tolen. */
+_GL_CXXALIAS_SYS_CAST (sendto, ssize_t,
+ (int fd, const void *buf, size_t len, int flags,
+ const struct sockaddr *to, socklen_t tolen));
# endif
_GL_CXXALIASWARN (sendto);
#elif @HAVE_WINSOCK2_H@
@@ -550,8 +573,11 @@ _GL_FUNCDECL_RPL (setsockopt, int, (int fd, int level, int optname,
_GL_CXXALIAS_RPL (setsockopt, int, (int fd, int level, int optname,
const void * optval, socklen_t optlen));
# else
-_GL_CXXALIAS_SYS (setsockopt, int, (int fd, int level, int optname,
- const void * optval, socklen_t optlen));
+/* Need to cast, because on NonStop Kernel, the fifth parameter is
+ size_t optlen. */
+_GL_CXXALIAS_SYS_CAST (setsockopt, int,
+ (int fd, int level, int optname,
+ const void * optval, socklen_t optlen));
# endif
_GL_CXXALIASWARN (setsockopt);
#elif @HAVE_WINSOCK2_H@
diff --git a/gl/sys_stat.in.h b/gl/sys_stat.in.h
index f0c61c15c5..61cdcc5392 100644
--- a/gl/sys_stat.in.h
+++ b/gl/sys_stat.in.h
@@ -1,5 +1,5 @@
/* Provide a more complete sys/stat header file.
- Copyright (C) 2005-2010 Free Software Foundation, Inc.
+ Copyright (C) 2005-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -461,11 +461,14 @@ _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
which are included above. */
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if !GNULIB_defined_rpl_mkdir
static inline int
rpl_mkdir (char const *name, mode_t mode)
{
return _mkdir (name);
}
+# define GNULIB_defined_rpl_mkdir 1
+# endif
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mkdir rpl_mkdir
@@ -550,7 +553,8 @@ _GL_CXXALIAS_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev));
_GL_FUNCDECL_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev)
_GL_ARG_NONNULL ((1)));
# endif
-_GL_CXXALIAS_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev));
+/* Need to cast, because on OSF/1 5.1, the third parameter is '...'. */
+_GL_CXXALIAS_SYS_CAST (mknod, int, (char const *file, mode_t mode, dev_t dev));
# endif
_GL_CXXALIASWARN (mknod);
#elif defined GNULIB_POSIXCHECK
diff --git a/gl/sys_time.in.h b/gl/sys_time.in.h
index 0689bcb2e6..d4319d25ca 100644
--- a/gl/sys_time.in.h
+++ b/gl/sys_time.in.h
@@ -1,6 +1,6 @@
/* Provide a more complete sys/time.h.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -51,11 +51,16 @@ extern "C" {
# endif
# if ! @HAVE_STRUCT_TIMEVAL@
+
+# if !GNULIB_defined_struct_timeval
struct timeval
{
time_t tv_sec;
long int tv_usec;
};
+# define GNULIB_defined_struct_timeval 1
+# endif
+
# endif
# ifdef __cplusplus
diff --git a/gl/tests/Makefile.am b/gl/tests/Makefile.am
index acfc33e34c..33da277bfd 100644
--- a/gl/tests/Makefile.am
+++ b/gl/tests/Makefile.am
@@ -1,6 +1,6 @@
## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+# Copyright (C) 2002-2011 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
@@ -153,6 +153,47 @@ EXTRA_DIST += test-errno.c
## end gnulib module errno-tests
+## begin gnulib module fcntl-h
+
+BUILT_SOURCES += fcntl.h
+
+# We need the following in order to create <fcntl.h> when the system
+# doesn't have one that works with the given compiler.
+fcntl.h: fcntl.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
+ -e 's|@''GNULIB_FCNTL''@|$(GNULIB_FCNTL)|g' \
+ -e 's|@''GNULIB_OPEN''@|$(GNULIB_OPEN)|g' \
+ -e 's|@''GNULIB_OPENAT''@|$(GNULIB_OPENAT)|g' \
+ -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
+ -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
+ -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \
+ -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
+ -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ < $(srcdir)/fcntl.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += fcntl.h fcntl.h-t
+
+EXTRA_DIST += fcntl.in.h
+
+## end gnulib module fcntl-h
+
+## begin gnulib module fcntl-h-tests
+
+TESTS += test-fcntl-h
+check_PROGRAMS += test-fcntl-h
+EXTRA_DIST += test-fcntl-h.c
+
+## end gnulib module fcntl-h-tests
+
## begin gnulib module fseeko-tests
TESTS += test-fseeko.sh test-fseeko2.sh
@@ -282,6 +323,23 @@ EXTRA_DIST += signature.h test-perror.c test-perror.sh
## end gnulib module perror-tests
+## begin gnulib module pipe-posix
+
+
+EXTRA_DIST += pipe.c
+
+EXTRA_libtests_a_SOURCES += pipe.c
+
+## end gnulib module pipe-posix
+
+## begin gnulib module pipe-posix-tests
+
+TESTS += test-pipe
+check_PROGRAMS += test-pipe
+EXTRA_DIST += test-pipe.c signature.h macros.h
+
+## end gnulib module pipe-posix-tests
+
## begin gnulib module read-file-tests
TESTS += test-read-file
@@ -526,14 +584,6 @@ EXTRA_DIST += $(top_srcdir)/build-aux/warn-on-use.h
## end gnulib module warn-on-use
-## begin gnulib module wchar-tests
-
-TESTS += test-wchar
-check_PROGRAMS += test-wchar
-EXTRA_DIST += test-wchar.c
-
-## end gnulib module wchar-tests
-
## begin gnulib module dummy
libtests_a_SOURCES += dummy.c
diff --git a/gl/tests/binary-io.h b/gl/tests/binary-io.h
index 5451fd48f4..c09dbf5799 100644
--- a/gl/tests/binary-io.h
+++ b/gl/tests/binary-io.h
@@ -1,6 +1,5 @@
/* Binary mode I/O.
- Copyright (C) 2001, 2003, 2005, 2008, 2009, 2010 Free Software Foundation,
- Inc.
+ Copyright (C) 2001, 2003, 2005, 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,24 +18,13 @@
#define _BINARY_H
/* For systems that distinguish between text and binary I/O.
- O_BINARY is usually declared in <fcntl.h>. */
+ O_BINARY is guaranteed by the gnulib <fcntl.h>. */
#include <fcntl.h>
/* The MSVC7 <stdio.h> doesn't like to be included after '#define fileno ...',
so we include it here first. */
#include <stdio.h>
-#if !defined O_BINARY && defined _O_BINARY
- /* For MSC-compatible compilers. */
-# define O_BINARY _O_BINARY
-# define O_TEXT _O_TEXT
-#endif
-#if defined __BEOS__ || defined __HAIKU__
- /* BeOS 5 and Haiku have O_BINARY and O_TEXT, but they have no effect. */
-# undef O_BINARY
-# undef O_TEXT
-#endif
-
/* SET_BINARY (fd);
changes the file descriptor fd to perform binary I/O. */
#if O_BINARY
@@ -58,8 +46,6 @@
# endif
#else
/* On reasonable systems, binary I/O is the default. */
-# undef O_BINARY
-# define O_BINARY 0
# define SET_BINARY(fd) /* do nothing */ ((void) 0)
#endif
diff --git a/gl/tests/dummy.c b/gl/tests/dummy.c
index 0f9a277962..c958ea05d8 100644
--- a/gl/tests/dummy.c
+++ b/gl/tests/dummy.c
@@ -1,5 +1,5 @@
/* A dummy file, to prevent empty libraries from breaking builds.
- Copyright (C) 2004, 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/fcntl.in.h b/gl/tests/fcntl.in.h
new file mode 100644
index 0000000000..18cac454ab
--- /dev/null
+++ b/gl/tests/fcntl.in.h
@@ -0,0 +1,308 @@
+/* Like <fcntl.h>, but with non-working flags defined to 0.
+
+ Copyright (C) 2006-2011 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* written by Paul Eggert */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined __need_system_fcntl_h
+/* Special invocation convention. */
+
+#include <sys/types.h>
+/* On some systems other than glibc, <sys/stat.h> is a prerequisite of
+ <fcntl.h>. On glibc systems, we would like to avoid namespace pollution.
+ But on glibc systems, <fcntl.h> includes <sys/stat.h> inside an
+ extern "C" { ... } block, which leads to errors in C++ mode with the
+ overridden <sys/stat.h> from gnulib. These errors are known to be gone
+ with g++ version >= 4.3. */
+#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
+# include <sys/stat.h>
+#endif
+#@INCLUDE_NEXT@ @NEXT_FCNTL_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _GL_FCNTL_H
+
+#include <sys/types.h>
+/* On some systems other than glibc, <sys/stat.h> is a prerequisite of
+ <fcntl.h>. On glibc systems, we would like to avoid namespace pollution.
+ But on glibc systems, <fcntl.h> includes <sys/stat.h> inside an
+ extern "C" { ... } block, which leads to errors in C++ mode with the
+ overridden <sys/stat.h> from gnulib. These errors are known to be gone
+ with g++ version >= 4.3. */
+#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
+# include <sys/stat.h>
+#endif
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_FCNTL_H@
+
+#ifndef _GL_FCNTL_H
+#define _GL_FCNTL_H
+
+#ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems. */
+# include <unistd.h>
+#endif
+
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+/* Declare overridden functions. */
+
+#if @GNULIB_FCNTL@
+# if @REPLACE_FCNTL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fcntl
+# define fcntl rpl_fcntl
+# endif
+_GL_FUNCDECL_RPL (fcntl, int, (int fd, int action, ...));
+_GL_CXXALIAS_RPL (fcntl, int, (int fd, int action, ...));
+# else
+# if !@HAVE_FCNTL@
+_GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...));
+# endif
+_GL_CXXALIAS_SYS (fcntl, int, (int fd, int action, ...));
+# endif
+_GL_CXXALIASWARN (fcntl);
+#elif defined GNULIB_POSIXCHECK
+# undef fcntl
+# if HAVE_RAW_DECL_FCNTL
+_GL_WARN_ON_USE (fcntl, "fcntl is not always POSIX compliant - "
+ "use gnulib module fcntl for portability");
+# endif
+#endif
+
+#if @GNULIB_OPEN@
+# if @REPLACE_OPEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef open
+# define open rpl_open
+# endif
+_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
+# else
+_GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
+# endif
+/* On HP-UX 11, in C++ mode, open() is defined as an inline function with a
+ default argument. _GL_CXXALIASWARN does not work in this case. */
+# if !defined __hpux
+_GL_CXXALIASWARN (open);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef open
+/* Assume open is always declared. */
+_GL_WARN_ON_USE (open, "open is not always POSIX compliant - "
+ "use gnulib module open for portability");
+#endif
+
+#if @GNULIB_OPENAT@
+# if @REPLACE_OPENAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef openat
+# define openat rpl_openat
+# endif
+_GL_FUNCDECL_RPL (openat, int,
+ (int fd, char const *file, int flags, /* mode_t mode */ ...)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (openat, int,
+ (int fd, char const *file, int flags, /* mode_t mode */ ...));
+# else
+# if !@HAVE_OPENAT@
+_GL_FUNCDECL_SYS (openat, int,
+ (int fd, char const *file, int flags, /* mode_t mode */ ...)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (openat, int,
+ (int fd, char const *file, int flags, /* mode_t mode */ ...));
+# endif
+_GL_CXXALIASWARN (openat);
+#elif defined GNULIB_POSIXCHECK
+# undef openat
+# if HAVE_RAW_DECL_OPENAT
+_GL_WARN_ON_USE (openat, "openat is not portable - "
+ "use gnulib module openat for portability");
+# endif
+#endif
+
+
+/* Fix up the FD_* macros, only known to be missing on mingw. */
+
+#ifndef FD_CLOEXEC
+# define FD_CLOEXEC 1
+#endif
+
+/* Fix up the supported F_* macros. Intentionally leave other F_*
+ macros undefined. Only known to be missing on mingw. */
+
+#ifndef F_DUPFD_CLOEXEC
+# define F_DUPFD_CLOEXEC 0x40000000
+/* Witness variable: 1 if gnulib defined F_DUPFD_CLOEXEC, 0 otherwise. */
+# define GNULIB_defined_F_DUPFD_CLOEXEC 1
+#else
+# define GNULIB_defined_F_DUPFD_CLOEXEC 0
+#endif
+
+#ifndef F_DUPFD
+# define F_DUPFD 1
+#endif
+
+#ifndef F_GETFD
+# define F_GETFD 2
+#endif
+
+/* Fix up the O_* macros. */
+
+#if !defined O_DIRECT && defined O_DIRECTIO
+/* Tru64 spells it `O_DIRECTIO'. */
+# define O_DIRECT O_DIRECTIO
+#endif
+
+#if !defined O_CLOEXEC && defined O_NOINHERIT
+/* Mingw spells it `O_NOINHERIT'. Intentionally leave it
+ undefined if not available. */
+# define O_CLOEXEC O_NOINHERIT
+#endif
+
+#ifndef O_CLOEXEC
+# define O_CLOEXEC 0
+#endif
+
+#ifndef O_DIRECT
+# define O_DIRECT 0
+#endif
+
+#ifndef O_DIRECTORY
+# define O_DIRECTORY 0
+#endif
+
+#ifndef O_DSYNC
+# define O_DSYNC 0
+#endif
+
+#ifndef O_EXEC
+# define O_EXEC O_RDONLY /* This is often close enough in older systems. */
+#endif
+
+#ifndef O_NDELAY
+# define O_NDELAY 0
+#endif
+
+#ifndef O_NOATIME
+# define O_NOATIME 0
+#endif
+
+#ifndef O_NONBLOCK
+# define O_NONBLOCK O_NDELAY
+#endif
+
+#ifndef O_NOCTTY
+# define O_NOCTTY 0
+#endif
+
+#ifndef O_NOFOLLOW
+# define O_NOFOLLOW 0
+#endif
+
+#ifndef O_NOLINKS
+# define O_NOLINKS 0
+#endif
+
+#ifndef O_RSYNC
+# define O_RSYNC 0
+#endif
+
+#ifndef O_SEARCH
+# define O_SEARCH O_RDONLY /* This is often close enough in older systems. */
+#endif
+
+#ifndef O_SYNC
+# define O_SYNC 0
+#endif
+
+#ifndef O_TTY_INIT
+# define O_TTY_INIT 0
+#endif
+
+/* For systems that distinguish between text and binary I/O.
+ O_BINARY is usually declared in fcntl.h */
+#if !defined O_BINARY && defined _O_BINARY
+ /* For MSC-compatible compilers. */
+# define O_BINARY _O_BINARY
+# define O_TEXT _O_TEXT
+#endif
+
+#if defined __BEOS__ || defined __HAIKU__
+ /* BeOS 5 and Haiku have O_BINARY and O_TEXT, but they have no effect. */
+# undef O_BINARY
+# undef O_TEXT
+#endif
+
+#ifndef O_BINARY
+# define O_BINARY 0
+# define O_TEXT 0
+#endif
+
+/* Fix up the AT_* macros. */
+
+/* Work around a bug in Solaris 9 and 10: AT_FDCWD is positive. Its
+ value exceeds INT_MAX, so its use as an int doesn't conform to the
+ C standard, and GCC and Sun C complain in some cases. If the bug
+ is present, undef AT_FDCWD here, so it can be redefined below. */
+#if 0 < AT_FDCWD && AT_FDCWD == 0xffd19553
+# undef AT_FDCWD
+#endif
+
+/* Use the same bit pattern as Solaris 9, but with the proper
+ signedness. The bit pattern is important, in case this actually is
+ Solaris with the above workaround. */
+#ifndef AT_FDCWD
+# define AT_FDCWD (-3041965)
+#endif
+
+/* Use the same values as Solaris 9. This shouldn't matter, but
+ there's no real reason to differ. */
+#ifndef AT_SYMLINK_NOFOLLOW
+# define AT_SYMLINK_NOFOLLOW 4096
+#endif
+
+#ifndef AT_REMOVEDIR
+# define AT_REMOVEDIR 1
+#endif
+
+/* Solaris 9 lacks these two, so just pick unique values. */
+#ifndef AT_SYMLINK_FOLLOW
+# define AT_SYMLINK_FOLLOW 2
+#endif
+
+#ifndef AT_EACCESS
+# define AT_EACCESS 4
+#endif
+
+
+#endif /* _GL_FCNTL_H */
+#endif /* _GL_FCNTL_H */
+#endif
diff --git a/gl/tests/getpagesize.c b/gl/tests/getpagesize.c
index cc2526870f..d7c1ba807a 100644
--- a/gl/tests/getpagesize.c
+++ b/gl/tests/getpagesize.c
@@ -1,6 +1,6 @@
/* getpagesize emulation for systems where it cannot be done in a C macro.
- Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/init.sh b/gl/tests/init.sh
index 14f3b198d4..71c6516962 100644
--- a/gl/tests/init.sh
+++ b/gl/tests/init.sh
@@ -1,6 +1,6 @@
# source this file; set up for tests
-# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2009-2011 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -74,10 +74,10 @@ Exit () { set +e; (exit $1); exit $1; }
# the reason for skip/failure to console, rather than to the .log files.
: ${stderr_fileno_=2}
-warn_() { echo "$@" 1>&$stderr_fileno_; }
-fail_() { warn_ "$ME_: failed test: $@"; Exit 1; }
-skip_() { warn_ "$ME_: skipped test: $@"; Exit 77; }
-framework_failure_() { warn_ "$ME_: set-up failure: $@"; Exit 99; }
+warn_ () { echo "$@" 1>&$stderr_fileno_; }
+fail_ () { warn_ "$ME_: failed test: $@"; Exit 1; }
+skip_ () { warn_ "$ME_: skipped test: $@"; Exit 77; }
+framework_failure_ () { warn_ "$ME_: set-up failure: $@"; Exit 99; }
# Sanitize this shell to POSIX mode, if possible.
DUALCASE=1; export DUALCASE
@@ -111,7 +111,7 @@ fi
# Eval this code in a subshell to determine a shell's suitability.
# 10 - passes all tests; ok to use
-# 9 - ok, but enabling "set -x" corrupts application stderr; prefer higher score
+# 9 - ok, but enabling "set -x" corrupts app stderr; prefer higher score
# ? - not ok
gl_shell_test_script_='
test $(echo y) = y || exit 1
@@ -193,7 +193,7 @@ fi
test -n "$EXEEXT" && shopt -s expand_aliases
# Enable glibc's malloc-perturbing option.
-# This is cheap and useful for exposing code that depends on the fact that
+# This is useful for exposing code that depends on the fact that
# malloc-related functions often return memory that is mostly zeroed.
# If you have the time and cycles, use valgrind to do an even better job.
: ${MALLOC_PERTURB_=87}
@@ -202,22 +202,22 @@ export MALLOC_PERTURB_
# This is a stub function that is run upon trap (upon regular exit and
# interrupt). Override it with a per-test function, e.g., to unmount
# a partition, or to undo any other global state changes.
-cleanup_() { :; }
+cleanup_ () { :; }
if ( diff --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then
- compare() { diff -u "$@"; }
+ compare () { diff -u "$@"; }
elif ( cmp --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then
- compare() { cmp -s "$@"; }
+ compare () { cmp -s "$@"; }
else
- compare() { cmp "$@"; }
+ compare () { cmp "$@"; }
fi
# An arbitrary prefix to help distinguish test directories.
-testdir_prefix_() { printf gt; }
+testdir_prefix_ () { printf gt; }
# Run the user-overridable cleanup_ function, remove the temporary
# directory and exit with the incoming value of $?.
-remove_tmp_()
+remove_tmp_ ()
{
__st=$?
cleanup_
@@ -233,7 +233,7 @@ remove_tmp_()
# contains only the specified bytes (see the case stmt below), then print
# a space-separated list of those names and return 0. Otherwise, don't
# print anything and return 1. Naming constraints apply also to DIR.
-find_exe_basenames_()
+find_exe_basenames_ ()
{
feb_dir_=$1
feb_fail_=0
@@ -245,6 +245,9 @@ find_exe_basenames_()
# below, just skip it.
test "x$feb_file_" = "x$feb_dir_/*.exe" && test ! -f "$feb_file_" \
&& continue
+ # Exempt [.exe, since we can't create a function by that name, yet
+ # we can't invoke [ by PATH search anyways due to shell builtins.
+ test "x$feb_file_" = "x$feb_dir_/[.exe" && continue
case $feb_file_ in
*[!-a-zA-Z/0-9_.+]*) feb_fail_=1; break;;
*) # Remove leading file name components as well as the .exe suffix.
@@ -263,7 +266,7 @@ find_exe_basenames_()
# PROG that simply invokes PROG.exe, then return 0. If any selected
# file name or the directory name, $1, contains an unexpected character,
# define no alias and return 1.
-create_exe_shims_()
+create_exe_shims_ ()
{
case $EXEEXT in
'') return 0 ;;
@@ -272,7 +275,7 @@ create_exe_shims_()
esac
base_names_=`find_exe_basenames_ $1` \
- || { echo "$0 (exe_shim): skipping directory: $1" 1>&2; return 1; }
+ || { echo "$0 (exe_shim): skipping directory: $1" 1>&2; return 0; }
if test -n "$base_names_"; then
for base_ in $base_names_; do
@@ -285,7 +288,7 @@ create_exe_shims_()
# Use this function to prepend to PATH an absolute name for each
# specified, possibly-$initial_cwd_-relative, directory.
-path_prepend_()
+path_prepend_ ()
{
while test $# != 0; do
path_dir_=$1
@@ -308,7 +311,7 @@ path_prepend_()
export PATH
}
-setup_()
+setup_ ()
{
if test "$VERBOSE" = yes; then
# Test whether set -x may cause the selected shell to corrupt an
@@ -324,6 +327,7 @@ setup_()
fi
initial_cwd_=$PWD
+ fail=0
pfx_=`testdir_prefix_`
test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \
@@ -360,7 +364,7 @@ setup_()
# - make only $MAX_TRIES_ attempts
# Helper function. Print $N pseudo-random bytes from a-zA-Z0-9.
-rand_bytes_()
+rand_bytes_ ()
{
n_=$1
@@ -392,7 +396,7 @@ rand_bytes_()
| LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_
}
-mktempd_()
+mktempd_ ()
{
case $# in
2);;
@@ -413,11 +417,10 @@ mktempd_()
case $template_ in
*XXXX) ;;
- *) fail_ "invalid template: $template_ (must have a suffix of at least 4 X's)";;
+ *) fail_ \
+ "invalid template: $template_ (must have a suffix of at least 4 X's)";;
esac
- fail=0
-
# First, try to use mktemp.
d=`unset TMPDIR; mktemp -d -t -p "$destdir_" "$template_" 2>/dev/null` \
|| fail=1
diff --git a/gl/tests/ioctl.c b/gl/tests/ioctl.c
index 91eb3be1b9..72f9f37b18 100644
--- a/gl/tests/ioctl.c
+++ b/gl/tests/ioctl.c
@@ -1,6 +1,6 @@
/* ioctl.c --- wrappers for Windows ioctl function
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/macros.h b/gl/tests/macros.h
index 11db5a8af0..89226758ec 100644
--- a/gl/tests/macros.h
+++ b/gl/tests/macros.h
@@ -1,5 +1,5 @@
/* Common macros used by gnulib tests.
- Copyright (C) 2006-2010 Free Software Foundation, Inc.
+ Copyright (C) 2006-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/pipe.c b/gl/tests/pipe.c
new file mode 100644
index 0000000000..cfd8acbfc5
--- /dev/null
+++ b/gl/tests/pipe.c
@@ -0,0 +1,42 @@
+/* Create a pipe.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* Native Woe32 API. */
+
+/* Get _pipe(). */
+# include <io.h>
+
+/* Get _O_BINARY. */
+# include <fcntl.h>
+
+int
+pipe (int fd[2])
+{
+ return _pipe (fd, 4096, _O_BINARY);
+}
+
+#else
+
+# error "This platform lacks a pipe function, and Gnulib doesn't provide a replacement. This is a bug in Gnulib."
+
+#endif
diff --git a/gl/tests/signature.h b/gl/tests/signature.h
index 6e15c43a2a..8256989d0e 100644
--- a/gl/tests/signature.h
+++ b/gl/tests/signature.h
@@ -1,5 +1,5 @@
/* Macro for checking that a function declaration is compliant.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/sys_ioctl.in.h b/gl/tests/sys_ioctl.in.h
index 871b676981..77ca86d333 100644
--- a/gl/tests/sys_ioctl.in.h
+++ b/gl/tests/sys_ioctl.in.h
@@ -1,5 +1,5 @@
/* Substitute for and wrapper around <sys/ioctl.h>.
- Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-alignof.c b/gl/tests/test-alignof.c
index a8b6d18996..cc10bc1357 100644
--- a/gl/tests/test-alignof.c
+++ b/gl/tests/test-alignof.c
@@ -1,5 +1,5 @@
/* Test of <alignof.h>.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-alloca-opt.c b/gl/tests/test-alloca-opt.c
index cfbecafcb9..5aa16455d0 100644
--- a/gl/tests/test-alloca-opt.c
+++ b/gl/tests/test-alloca-opt.c
@@ -1,5 +1,5 @@
/* Test of optional automatic memory allocation.
- Copyright (C) 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-arpa_inet.c b/gl/tests/test-arpa_inet.c
index 262686ac47..ce7d19fab2 100644
--- a/gl/tests/test-arpa_inet.c
+++ b/gl/tests/test-arpa_inet.c
@@ -1,5 +1,5 @@
/* Test of <arpa/inet.h> substitute.
- Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-binary-io.c b/gl/tests/test-binary-io.c
index 125150b21f..8e5d193f69 100644
--- a/gl/tests/test-binary-io.c
+++ b/gl/tests/test-binary-io.c
@@ -1,5 +1,5 @@
/* Test of binary mode I/O.
- Copyright (C) 2005, 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-c-ctype.c b/gl/tests/test-c-ctype.c
index ebe594dd4f..9d748ffe88 100644
--- a/gl/tests/test-c-ctype.c
+++ b/gl/tests/test-c-ctype.c
@@ -1,5 +1,5 @@
/* Test of character handling in C locale.
- Copyright (C) 2005, 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-errno.c b/gl/tests/test-errno.c
index 129b236fe9..7851c22d0f 100644
--- a/gl/tests/test-errno.c
+++ b/gl/tests/test-errno.c
@@ -1,5 +1,5 @@
/* Test of <errno.h> substitute.
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-wchar.c b/gl/tests/test-fcntl-h.c
index 2a03d6b669..dd20fbb406 100644
--- a/lib/gl/tests/test-wchar.c
+++ b/gl/tests/test-fcntl-h.c
@@ -1,5 +1,5 @@
-/* Test of <wchar.h> substitute.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+/* Test of <fcntl.h> substitute.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -18,17 +18,18 @@
#include <config.h>
-#include <wchar.h>
+#include <fcntl.h>
-#include "verify.h"
+/* Check that the various O_* macros are defined. */
+int o = O_DIRECT | O_DIRECTORY | O_DSYNC | O_NDELAY | O_NOATIME | O_NONBLOCK
+ | O_NOCTTY | O_NOFOLLOW | O_NOLINKS | O_RSYNC | O_SYNC | O_TTY_INIT
+ | O_BINARY | O_TEXT;
-/* Check that the types wchar_t and wint_t are defined. */
-wchar_t a = 'c';
-wint_t b = 'x';
+/* Check that the various SEEK_* macros are defined. */
+int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
-/* Check that NULL can be passed through varargs as a pointer type,
- per POSIX 2008. */
-verify (sizeof NULL == sizeof (void *));
+/* Check that the FD_* macros are defined. */
+int fd = FD_CLOEXEC;
int
main (void)
diff --git a/gl/tests/test-fseeko.c b/gl/tests/test-fseeko.c
index be2a78dce1..ad5eec8de9 100644
--- a/gl/tests/test-fseeko.c
+++ b/gl/tests/test-fseeko.c
@@ -1,5 +1,5 @@
/* Test of fseeko() function.
- Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-ftello.c b/gl/tests/test-ftello.c
index 5fae570f28..636da81190 100644
--- a/gl/tests/test-ftello.c
+++ b/gl/tests/test-ftello.c
@@ -1,5 +1,5 @@
/* Test of ftello() function.
- Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-ftello3.c b/gl/tests/test-ftello3.c
index b07ba64610..50d4b882fd 100644
--- a/gl/tests/test-ftello3.c
+++ b/gl/tests/test-ftello3.c
@@ -1,5 +1,5 @@
/* Test of ftello() function.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-getaddrinfo.c b/gl/tests/test-getaddrinfo.c
index 15d6569b4a..482698937a 100644
--- a/gl/tests/test-getaddrinfo.c
+++ b/gl/tests/test-getaddrinfo.c
@@ -1,6 +1,6 @@
/* Test the getaddrinfo module.
- Copyright (C) 2006-2010 Free Software Foundation, Inc.
+ Copyright (C) 2006-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-getdelim.c b/gl/tests/test-getdelim.c
index a5df49f1dd..f4d1c9d506 100644
--- a/gl/tests/test-getdelim.c
+++ b/gl/tests/test-getdelim.c
@@ -1,5 +1,5 @@
/* Test of getdelim() function.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-getline.c b/gl/tests/test-getline.c
index 6a661ce530..bead4b6aad 100644
--- a/gl/tests/test-getline.c
+++ b/gl/tests/test-getline.c
@@ -1,5 +1,5 @@
/* Test of getline() function.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-gettimeofday.c b/gl/tests/test-gettimeofday.c
index ff2bc72b54..7d09fc3ad0 100644
--- a/gl/tests/test-gettimeofday.c
+++ b/gl/tests/test-gettimeofday.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
+ * Copyright (C) 2005, 2007, 2009-2011 Free Software Foundation, Inc.
* Written by Jim Meyering.
*
* This program is free software: you can redistribute it and/or modify
diff --git a/gl/tests/test-inet_ntop.c b/gl/tests/test-inet_ntop.c
index d3b045c353..ebb7c1c093 100644
--- a/gl/tests/test-inet_ntop.c
+++ b/gl/tests/test-inet_ntop.c
@@ -1,5 +1,5 @@
/* Test of inet_ntop function.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-inet_pton.c b/gl/tests/test-inet_pton.c
index 74afc0c07b..49c140cae6 100644
--- a/gl/tests/test-inet_pton.c
+++ b/gl/tests/test-inet_pton.c
@@ -1,5 +1,5 @@
/* Test of inet_pton function.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-lseek.c b/gl/tests/test-lseek.c
index 3d893a0d05..400d3d269b 100644
--- a/gl/tests/test-lseek.c
+++ b/gl/tests/test-lseek.c
@@ -1,5 +1,5 @@
/* Test of lseek() function.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-memchr.c b/gl/tests/test-memchr.c
index 05e1bfaed2..a11f6cdb97 100644
--- a/gl/tests/test-memchr.c
+++ b/gl/tests/test-memchr.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ * Copyright (C) 2008-2011 Free Software Foundation, Inc.
* Written by Eric Blake and Bruno Haible
*
* This program is free software: you can redistribute it and/or modify
diff --git a/gl/tests/test-netdb.c b/gl/tests/test-netdb.c
index 697bbc8dbf..13a8925fbe 100644
--- a/gl/tests/test-netdb.c
+++ b/gl/tests/test-netdb.c
@@ -1,5 +1,5 @@
/* Test of <netdb.h> substitute.
- Copyright (C) 2007-2008, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2008, 2010-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-netinet_in.c b/gl/tests/test-netinet_in.c
index af403ed323..b1edc66add 100644
--- a/gl/tests/test-netinet_in.c
+++ b/gl/tests/test-netinet_in.c
@@ -1,5 +1,5 @@
/* Test of <netinet/in.h> substitute.
- Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-perror.c b/gl/tests/test-perror.c
index 2b7640c06a..d3751d8976 100644
--- a/gl/tests/test-perror.c
+++ b/gl/tests/test-perror.c
@@ -1,5 +1,5 @@
/* Test of perror() function.
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-pipe.c b/gl/tests/test-pipe.c
new file mode 100644
index 0000000000..5302c3ecec
--- /dev/null
+++ b/gl/tests/test-pipe.c
@@ -0,0 +1,103 @@
+/* Test of pipe.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (pipe, int, (int[2]));
+
+#include <fcntl.h>
+#include <stdbool.h>
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* Get declarations of the Win32 API functions. */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#endif
+
+#include "binary-io.h"
+#include "macros.h"
+
+/* Return true if FD is open. */
+static bool
+is_open (int fd)
+{
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ /* On Win32, the initial state of unassigned standard file
+ descriptors is that they are open but point to an
+ INVALID_HANDLE_VALUE, and there is no fcntl. */
+ return (HANDLE) _get_osfhandle (fd) != INVALID_HANDLE_VALUE;
+#else
+# ifndef F_GETFL
+# error Please port fcntl to your platform
+# endif
+ return 0 <= fcntl (fd, F_GETFL);
+#endif
+}
+
+/* Return true if FD is not inherited to child processes. */
+static bool
+is_cloexec (int fd)
+{
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ HANDLE h = (HANDLE) _get_osfhandle (fd);
+ DWORD flags;
+ ASSERT (GetHandleInformation (h, &flags));
+ return (flags & HANDLE_FLAG_INHERIT) == 0;
+#else
+ int flags;
+ ASSERT ((flags = fcntl (fd, F_GETFD)) >= 0);
+ return (flags & FD_CLOEXEC) != 0;
+#endif
+}
+
+/* Return true if FD is in non-blocking mode. */
+static bool
+is_nonblocking (int fd)
+{
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ /* We don't use the non-blocking mode for sockets here. */
+ return 0;
+#else
+ int flags;
+ ASSERT ((flags = fcntl (fd, F_GETFL)) >= 0);
+ return (flags & O_NONBLOCK) != 0;
+#endif
+}
+
+int
+main ()
+{
+ int fd[2];
+
+ fd[0] = -1;
+ fd[1] = -1;
+ ASSERT (pipe (fd) >= 0);
+ ASSERT (fd[0] >= 0);
+ ASSERT (fd[1] >= 0);
+ ASSERT (fd[0] != fd[1]);
+ ASSERT (is_open (fd[0]));
+ ASSERT (is_open (fd[1]));
+ ASSERT (!is_cloexec (fd[0]));
+ ASSERT (!is_cloexec (fd[1]));
+ ASSERT (!is_nonblocking (fd[0]));
+ ASSERT (!is_nonblocking (fd[1]));
+
+ return 0;
+}
diff --git a/gl/tests/test-read-file.c b/gl/tests/test-read-file.c
index daa61668c6..de7a0bb9f3 100644
--- a/gl/tests/test-read-file.c
+++ b/gl/tests/test-read-file.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006-2007, 2010 Free Software Foundation, Inc.
+ * Copyright (C) 2006-2007, 2010-2011 Free Software Foundation, Inc.
* Written by Simon Josefsson
*
* This program is free software: you can redistribute it and/or modify
diff --git a/gl/tests/test-select-fd.c b/gl/tests/test-select-fd.c
index 4527a2fb49..de2f3e9c46 100644
--- a/gl/tests/test-select-fd.c
+++ b/gl/tests/test-select-fd.c
@@ -1,5 +1,5 @@
/* Test of select() substitute, reading or writing from a given file descriptor.
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-select-stdin.c b/gl/tests/test-select-stdin.c
index c88698cd3f..5a6f81a86a 100644
--- a/gl/tests/test-select-stdin.c
+++ b/gl/tests/test-select-stdin.c
@@ -1,5 +1,5 @@
/* Test of select() substitute, reading from stdin.
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-select.c b/gl/tests/test-select.c
index 9c895c3b21..5c1532015d 100644
--- a/gl/tests/test-select.c
+++ b/gl/tests/test-select.c
@@ -1,5 +1,5 @@
/* Test of select() substitute.
- Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -42,6 +42,7 @@ SIGNATURE_CHECK (FD_ZERO, void, (fd_set *));
#include <string.h>
#include <netinet/in.h>
#include <arpa/inet.h>
+#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdbool.h>
@@ -50,25 +51,16 @@ SIGNATURE_CHECK (FD_ZERO, void, (fd_set *));
#include "macros.h"
-enum { SEL_IN = 1, SEL_OUT = 2, SEL_EXC = 4 };
-
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
# define WIN32_NATIVE
#endif
-#ifdef WIN32_NATIVE
-#include <io.h>
-#define pipe(x) _pipe(x, 256, O_BINARY)
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
+# include <sys/wait.h>
#endif
#ifndef SO_REUSEPORT
-#define SO_REUSEPORT SO_REUSEADDR
+# define SO_REUSEPORT SO_REUSEADDR
#endif
#define TEST_PORT 12345
@@ -134,7 +126,7 @@ open_server_socket (void)
}
static int
-connect_to_socket (int blocking)
+connect_to_socket (bool blocking)
{
int s;
struct sockaddr_in ia;
@@ -171,10 +163,20 @@ connect_to_socket (int blocking)
}
-/* A slightly more convenient interface to select(2). */
+/* A slightly more convenient interface to select(2).
+ Waits until a specific event occurs on a file descriptor FD.
+ EV is a bit mask of events to look for:
+ SEL_IN - input can be polled without blocking,
+ SEL_OUT - output can be provided without blocking,
+ SEL_EXC - an exception occurred,
+ A maximum wait time is specified by TIMEOUT.
+ *TIMEOUT = { 0, 0 } means to return immediately,
+ TIMEOUT = NULL means to wait indefinitely. */
+
+enum { SEL_IN = 1, SEL_OUT = 2, SEL_EXC = 4 };
static int
-do_select (int fd, int ev, struct timeval *tv)
+do_select (int fd, int ev, struct timeval *timeout)
{
fd_set rfds, wfds, xfds;
int r, rev;
@@ -188,7 +190,7 @@ do_select (int fd, int ev, struct timeval *tv)
FD_SET (fd, &wfds);
if (ev & SEL_EXC)
FD_SET (fd, &xfds);
- r = select (fd + 1, &rfds, &wfds, &xfds, tv);
+ r = select (fd + 1, &rfds, &wfds, &xfds, timeout);
if (r < 0)
return r;
@@ -210,7 +212,9 @@ do_select (int fd, int ev, struct timeval *tv)
static int
do_select_nowait (int fd, int ev)
{
- static struct timeval tv0;
+ struct timeval tv0;
+ tv0.tv_sec = 0;
+ tv0.tv_usec = 0;
return do_select (fd, ev, &tv0);
}
@@ -221,7 +225,7 @@ do_select_wait (int fd, int ev)
}
-/* Test poll(2) for TTYs. */
+/* Test select(2) for TTYs. */
#ifdef INTERACTIVE
static void
@@ -242,7 +246,7 @@ test_tty (void)
#endif
-/* Test poll(2) for unconnected nonblocking sockets. */
+/* Test select(2) for unconnected nonblocking sockets. */
static void
test_connect_first (void)
@@ -271,7 +275,7 @@ test_connect_first (void)
}
-/* Test poll(2) for unconnected blocking sockets. */
+/* Test select(2) for unconnected blocking sockets. */
static void
test_accept_first (void)
@@ -310,7 +314,7 @@ test_accept_first (void)
failed ("cannot read data left in the socket by closed process");
ASSERT (read (c, buf, 3) == 3);
ASSERT (write (c, "foo", 3) == 3);
- ASSERT (close (c) == 0);
+ (void) close (c); /* may fail with errno = ECONNRESET */
}
#endif
}
@@ -337,7 +341,7 @@ test_pair (int rd, int wd)
}
-/* Test poll(2) on connected sockets. */
+/* Test select(2) on connected sockets. */
static void
test_socket_pair (void)
@@ -354,11 +358,11 @@ test_socket_pair (void)
test_pair (c1, c2);
ASSERT (close (c1) == 0);
ASSERT (write (c2, "foo", 3) == 3);
- ASSERT (close (c2) == 0);
+ (void) close (c2); /* may fail with errno = ECONNRESET */
}
-/* Test poll(2) on pipes. */
+/* Test select(2) on pipes. */
static void
test_pipe (void)
diff --git a/gl/tests/test-snprintf.c b/gl/tests/test-snprintf.c
index 62a411bf91..95a352dc5e 100644
--- a/gl/tests/test-snprintf.c
+++ b/gl/tests/test-snprintf.c
@@ -1,5 +1,5 @@
/* Test of snprintf() function.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -34,15 +34,16 @@ main (int argc, char *argv[])
int size;
int retval;
+ retval = snprintf (NULL, 0, "%d", 12345);
+ ASSERT (retval == 5);
+
for (size = 0; size <= 8; size++)
{
memcpy (buf, "DEADBEEF", 8);
retval = snprintf (buf, size, "%d", 12345);
+ ASSERT (retval == 5);
if (size < 6)
{
-#if CHECK_SNPRINTF_POSIX
- ASSERT (retval < 0 || retval >= size);
-#endif
if (size > 0)
{
ASSERT (memcmp (buf, "12345", size - 1) == 0);
@@ -55,7 +56,6 @@ main (int argc, char *argv[])
}
else
{
- ASSERT (retval == 5);
ASSERT (memcmp (buf, "12345\0EF", 8) == 0);
}
}
diff --git a/gl/tests/test-sockets.c b/gl/tests/test-sockets.c
index ab5460ad46..0170d3754d 100644
--- a/gl/tests/test-sockets.c
+++ b/gl/tests/test-sockets.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ * Copyright (C) 2008-2011 Free Software Foundation, Inc.
* Written by Simon Josefsson.
*
* This program is free software: you can redistribute it and/or modify
diff --git a/gl/tests/test-stdbool.c b/gl/tests/test-stdbool.c
index 2103d8bab9..e115ba2940 100644
--- a/gl/tests/test-stdbool.c
+++ b/gl/tests/test-stdbool.c
@@ -1,5 +1,5 @@
/* Test of <stdbool.h> substitute.
- Copyright (C) 2002-2007, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -52,23 +52,28 @@
/* Several tests cannot be guaranteed with gnulib's <stdbool.h>, at
least, not for all compilers and compiler options. */
-#if HAVE_STDBOOL_H || defined __GNUC__
+#if HAVE_STDBOOL_H || 3 <= __GNUC__
struct s { _Bool s: 1; _Bool t; } s;
#endif
char a[true == 1 ? 1 : -1];
char b[false == 0 ? 1 : -1];
char c[__bool_true_false_are_defined == 1 ? 1 : -1];
-#if HAVE_STDBOOL_H || defined __GNUC__ /* See above. */
+#if HAVE_STDBOOL_H || 3 <= __GNUC__ /* See above. */
char d[(bool) 0.5 == true ? 1 : -1];
-# ifdef ADDRESS_CHECK_OKAY
+# ifdef ADDRESS_CHECK_OKAY /* Avoid gcc warning. */
+/* C99 may plausibly be interpreted as not requiring support for a cast from
+ a variable's address to bool in a static initializer. So treat it like a
+ GCC extension. */
+# ifdef __GNUC__
bool e = &s;
+# endif
# endif
char f[(_Bool) 0.0 == false ? 1 : -1];
#endif
char g[true];
char h[sizeof (_Bool)];
-#if HAVE_STDBOOL_H || defined __GNUC__ /* See above. */
+#if HAVE_STDBOOL_H || 3 <= __GNUC__ /* See above. */
char i[sizeof s.t];
#endif
enum { j = false, k = true, l = false * true, m = true * 256 };
@@ -85,11 +90,29 @@ _Bool *pq = &q;
int
main ()
{
+ int error = 0;
+
+#if HAVE_STDBOOL_H || 3 <= __GNUC__ /* See above. */
+# ifdef ADDRESS_CHECK_OKAY /* Avoid gcc warning. */
+ /* A cast from a variable's address to bool is valid in expressions. */
+ {
+ bool e1 = &s;
+ if (!e1)
+ error = 1;
+ }
+# endif
+#endif
+
/* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
reported by James Lemley on 2005-10-05; see
http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
This is a runtime test, since a corresponding compile-time
test would rely on initializer extensions. */
- char digs[] = "0123456789";
- return &(digs + 5)[-2 + (bool) 1] != &digs[4];
+ {
+ char digs[] = "0123456789";
+ if (&(digs + 5)[-2 + (bool) 1] != &digs[4])
+ error = 1;
+ }
+
+ return error;
}
diff --git a/gl/tests/test-stddef.c b/gl/tests/test-stddef.c
index 2c392c7547..c929af837a 100644
--- a/gl/tests/test-stddef.c
+++ b/gl/tests/test-stddef.c
@@ -1,5 +1,5 @@
/* Test of <stddef.h> substitute.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-stdint.c b/gl/tests/test-stdint.c
index d64057a256..f606cc3e24 100644
--- a/gl/tests/test-stdint.c
+++ b/gl/tests/test-stdint.c
@@ -1,5 +1,5 @@
/* Test of <stdint.h> substitute.
- Copyright (C) 2006-2010 Free Software Foundation, Inc.
+ Copyright (C) 2006-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-stdio.c b/gl/tests/test-stdio.c
index 87100576f0..7e7a206b7c 100644
--- a/gl/tests/test-stdio.c
+++ b/gl/tests/test-stdio.c
@@ -1,5 +1,5 @@
/* Test of <stdio.h> substitute.
- Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-stdlib.c b/gl/tests/test-stdlib.c
index 1e7956b68c..210aab4055 100644
--- a/gl/tests/test-stdlib.c
+++ b/gl/tests/test-stdlib.c
@@ -1,5 +1,5 @@
/* Test of <stdlib.h> substitute.
- Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-strerror.c b/gl/tests/test-strerror.c
index 11ab7e3939..66dbe823d1 100644
--- a/gl/tests/test-strerror.c
+++ b/gl/tests/test-strerror.c
@@ -1,5 +1,5 @@
/* Test of strerror() function.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-string.c b/gl/tests/test-string.c
index 019a8174ac..54c49a9735 100644
--- a/gl/tests/test-string.c
+++ b/gl/tests/test-string.c
@@ -1,5 +1,5 @@
/* Test of <string.h> substitute.
- Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-sys_ioctl.c b/gl/tests/test-sys_ioctl.c
index 1f44d4a1ad..dd01b4aadd 100644
--- a/gl/tests/test-sys_ioctl.c
+++ b/gl/tests/test-sys_ioctl.c
@@ -1,5 +1,5 @@
/* Test of <sys/ioctl.h> substitute.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-sys_select.c b/gl/tests/test-sys_select.c
index 3a06c64828..0dfb8ef4b9 100644
--- a/gl/tests/test-sys_select.c
+++ b/gl/tests/test-sys_select.c
@@ -1,5 +1,5 @@
/* Test of <sys/select.h> substitute.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-sys_socket.c b/gl/tests/test-sys_socket.c
index e976ff6a7b..8f323ca1d9 100644
--- a/gl/tests/test-sys_socket.c
+++ b/gl/tests/test-sys_socket.c
@@ -1,5 +1,5 @@
/* Test of <sys/socket.h> substitute.
- Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-sys_stat.c b/gl/tests/test-sys_stat.c
index 5f1aacd1cc..cd07d86e87 100644
--- a/gl/tests/test-sys_stat.c
+++ b/gl/tests/test-sys_stat.c
@@ -1,5 +1,5 @@
/* Test of <sys/stat.h> substitute.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-sys_time.c b/gl/tests/test-sys_time.c
index 2ab849e927..da64b85c02 100644
--- a/gl/tests/test-sys_time.c
+++ b/gl/tests/test-sys_time.c
@@ -1,5 +1,5 @@
/* Test of <sys/time.h> substitute.
- Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-sys_wait.h b/gl/tests/test-sys_wait.h
index bb10450867..3c9b32293b 100644
--- a/gl/tests/test-sys_wait.h
+++ b/gl/tests/test-sys_wait.h
@@ -1,5 +1,5 @@
/* Test of macros shared between <sys/wait.h> and <stdlib.h>.
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-time.c b/gl/tests/test-time.c
index 8e250bd2d5..0c78f36c66 100644
--- a/gl/tests/test-time.c
+++ b/gl/tests/test-time.c
@@ -1,5 +1,5 @@
/* Test of <time.h> substitute.
- Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-unistd.c b/gl/tests/test-unistd.c
index ec02eeefca..be1ae06910 100644
--- a/gl/tests/test-unistd.c
+++ b/gl/tests/test-unistd.c
@@ -1,5 +1,5 @@
/* Test of <unistd.h> substitute.
- Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-update-copyright.sh b/gl/tests/test-update-copyright.sh
index ea700c902b..83275ade25 100755
--- a/gl/tests/test-update-copyright.sh
+++ b/gl/tests/test-update-copyright.sh
@@ -1,6 +1,6 @@
#!/bin/sh
# Test suite for update-copyright.
-# Copyright (C) 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2009-2011 Free Software Foundation, Inc.
# This file is part of the GNUlib Library.
#
# This program is free software: you can redistribute it and/or modify
@@ -107,8 +107,8 @@ UPDATE_COPYRIGHT_YEAR=2009 \
update-copyright $TMP.* 1> $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare - $TMP-stderr <<EOF || exit 1
-$TMP.4: warning: FSF copyright statement not found
-$TMP.5: warning: FSF copyright statement not found
+$TMP.4: warning: copyright statement not found
+$TMP.5: warning: copyright statement not found
EOF
compare - $TMP.1 <<EOF || exit 1
Copyright @copyright{} 1990-2005, 2007-2009 Free Software
@@ -150,8 +150,8 @@ UPDATE_COPYRIGHT_YEAR=2010 UPDATE_COPYRIGHT_USE_INTERVALS=1 \
update-copyright $TMP.* 1> $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare - $TMP-stderr <<EOF || exit 1
-$TMP.4: warning: FSF copyright statement not found
-$TMP.5: warning: FSF copyright statement not found
+$TMP.4: warning: copyright statement not found
+$TMP.5: warning: copyright statement not found
EOF
compare - $TMP.1 <<EOF || exit 1
Copyright @copyright{} 1990-2005, 2007-2010 Free Software Foundation,
@@ -189,8 +189,8 @@ UPDATE_COPYRIGHT_YEAR=2010 UPDATE_COPYRIGHT_FORCE=1 \
update-copyright $TMP.* 1> $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare - $TMP-stderr <<EOF || exit 1
-$TMP.4: warning: FSF copyright statement not found
-$TMP.5: warning: FSF copyright statement not found
+$TMP.4: warning: copyright statement not found
+$TMP.5: warning: copyright statement not found
EOF
compare - $TMP.1 <<EOF || exit 1
Copyright @copyright{} 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
@@ -326,7 +326,7 @@ UPDATE_COPYRIGHT_YEAR=2010 \
update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare - $TMP-stderr <<EOF || exit 1
-$TMP: warning: FSF copyright statement not found
+$TMP: warning: copyright statement not found
EOF
compare - $TMP <<EOF || exit 1
#### Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
@@ -355,7 +355,7 @@ UPDATE_COPYRIGHT_YEAR=2010 \
update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare - $TMP-stderr <<EOF || exit 1
-$TMP: warning: FSF copyright statement not found
+$TMP: warning: copyright statement not found
EOF
compare - $TMP <<EOF || exit 1
#Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
diff --git a/gl/tests/test-vasnprintf.c b/gl/tests/test-vasnprintf.c
index 15401eb4ca..6b2a0ff05a 100644
--- a/gl/tests/test-vasnprintf.c
+++ b/gl/tests/test-vasnprintf.c
@@ -1,5 +1,5 @@
/* Test of vasnprintf() and asnprintf() functions.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-vc-list-files-cvs.sh b/gl/tests/test-vc-list-files-cvs.sh
index 017b8d2460..531b2699ca 100755
--- a/gl/tests/test-vc-list-files-cvs.sh
+++ b/gl/tests/test-vc-list-files-cvs.sh
@@ -1,6 +1,6 @@
#!/bin/sh
# Unit tests for vc-list-files
-# Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2008-2011 Free Software Foundation, Inc.
# This file is part of the GNUlib Library.
#
# This program is free software: you can redistribute it and/or modify
diff --git a/gl/tests/test-vc-list-files-git.sh b/gl/tests/test-vc-list-files-git.sh
index 262d2ea3d2..523b2a9169 100755
--- a/gl/tests/test-vc-list-files-git.sh
+++ b/gl/tests/test-vc-list-files-git.sh
@@ -1,6 +1,6 @@
#!/bin/sh
# Unit tests for vc-list-files
-# Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2008-2011 Free Software Foundation, Inc.
# This file is part of the GNUlib Library.
#
# This program is free software: you can redistribute it and/or modify
diff --git a/gl/tests/test-verify.c b/gl/tests/test-verify.c
index 3f89ba9058..512c021b7d 100644
--- a/gl/tests/test-verify.c
+++ b/gl/tests/test-verify.c
@@ -1,6 +1,6 @@
/* Test the "verify" module.
- Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-version-etc.c b/gl/tests/test-version-etc.c
index fcc86218f8..00a5d7c6f9 100644
--- a/gl/tests/test-version-etc.c
+++ b/gl/tests/test-version-etc.c
@@ -1,5 +1,5 @@
/* Test suite for version-etc.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
This file is part of the GNUlib Library.
This program is free software: you can redistribute it and/or modify
diff --git a/gl/tests/test-version-etc.sh b/gl/tests/test-version-etc.sh
index 61d404684f..c1ed827e40 100755
--- a/gl/tests/test-version-etc.sh
+++ b/gl/tests/test-version-etc.sh
@@ -1,6 +1,6 @@
#! /bin/sh
# Test suite for version-etc.
-# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2009-2011 Free Software Foundation, Inc.
# This file is part of the GNUlib Library.
#
# This program is free software: you can redistribute it and/or modify
diff --git a/gl/tests/w32sock.h b/gl/tests/w32sock.h
index b472bd0501..651a76df6c 100644
--- a/gl/tests/w32sock.h
+++ b/gl/tests/w32sock.h
@@ -1,6 +1,6 @@
/* w32sock.h --- internal auxilliary functions for Windows socket functions
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/zerosize-ptr.h b/gl/tests/zerosize-ptr.h
index cfab200871..beeb3da3e0 100644
--- a/gl/tests/zerosize-ptr.h
+++ b/gl/tests/zerosize-ptr.h
@@ -1,5 +1,5 @@
/* Return a pointer to a zero-size object in memory.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/time.in.h b/gl/time.in.h
index 0f6adac43f..cb533a46e1 100644
--- a/gl/time.in.h
+++ b/gl/time.in.h
@@ -1,6 +1,6 @@
/* A more-standard <time.h>.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -69,13 +69,16 @@
extern "C" {
# endif
-# undef timespec
-# define timespec rpl_timespec
+# if !GNULIB_defined_struct_timespec
+# undef timespec
+# define timespec rpl_timespec
struct timespec
{
time_t tv_sec;
long int tv_nsec;
};
+# define GNULIB_defined_struct_timespec 1
+# endif
# ifdef __cplusplus
}
@@ -84,6 +87,7 @@ struct timespec
# endif
# endif
+# if !GNULIB_defined_struct_time_t_must_be_integral
/* Per http://austingroupbugs.net/view.php?id=327, POSIX requires
time_t to be an integer type, even though C99 permits floating
point. We don't know of any implementation that uses floating
@@ -92,6 +96,8 @@ struct timespec
struct __time_t_must_be_integral {
unsigned int __floating_time_t_unsupported : (time_t) 1;
};
+# define GNULIB_defined_struct_time_t_must_be_integral 1
+# endif
/* Sleep for at least RQTP seconds unless interrupted, If interrupted,
return -1 and store the remaining time into RMTP. See
@@ -147,7 +153,7 @@ _GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
_GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result));
# else
-# if ! @HAVE_LOCALTIME_R@
+# if ! @HAVE_DECL_LOCALTIME_R@
_GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result)
_GL_ARG_NONNULL ((1, 2)));
@@ -155,7 +161,9 @@ _GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
_GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result));
# endif
+# if @HAVE_DECL_LOCALTIME_R@
_GL_CXXALIASWARN (localtime_r);
+# endif
# if @REPLACE_LOCALTIME_R@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef gmtime_r
@@ -167,7 +175,7 @@ _GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
_GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result));
# else
-# if ! @HAVE_LOCALTIME_R@
+# if ! @HAVE_DECL_LOCALTIME_R@
_GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result)
_GL_ARG_NONNULL ((1, 2)));
@@ -175,7 +183,9 @@ _GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
_GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result));
# endif
+# if @HAVE_DECL_LOCALTIME_R@
_GL_CXXALIASWARN (gmtime_r);
+# endif
# endif
/* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store
diff --git a/gl/timespec.h b/gl/timespec.h
index 175de7f263..74d5749df6 100644
--- a/gl/timespec.h
+++ b/gl/timespec.h
@@ -1,6 +1,6 @@
/* timespec -- System time interface
- Copyright (C) 2000, 2002, 2004-2005, 2007, 2009-2010 Free Software
+ Copyright (C) 2000, 2002, 2004-2005, 2007, 2009-2011 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
diff --git a/gl/unistd.in.h b/gl/unistd.in.h
index fcf7c43904..15893d7eec 100644
--- a/gl/unistd.in.h
+++ b/gl/unistd.in.h
@@ -1,5 +1,5 @@
/* Substitute for and wrapper around <unistd.h>.
- Copyright (C) 2003-2010 Free Software Foundation, Inc.
+ Copyright (C) 2003-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -88,9 +88,11 @@
# include <io.h>
#endif
-/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>. */
+/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.
+ NonStop Kernel declares gethostname in <netdb.h>, not in <unistd.h>. */
/* But avoid namespace pollution on glibc systems. */
-#if @GNULIB_GETDOMAINNAME@ && (defined _AIX || defined __osf__) \
+#if ((@GNULIB_GETDOMAINNAME@ && (defined _AIX || defined __osf__)) \
+ || (@GNULIB_GETHOSTNAME@ && defined __TANDEM)) \
&& !defined __GLIBC__
# include <netdb.h>
#endif
@@ -435,6 +437,10 @@ _GL_EXTERN_C void _gl_unregister_fd (int fd);
_GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd);
_GL_EXTERN_C const char *_gl_directory_name (int fd);
+# else
+# if !@HAVE_DECL_FCHDIR@
+_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
+# endif
# endif
_GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/));
_GL_CXXALIASWARN (fchdir);
@@ -650,7 +656,8 @@ _GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len));
_GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len)
_GL_ARG_NONNULL ((1)));
# endif
-/* Need to cast, because on Solaris 10 systems, the second parameter is
+/* Need to cast, because on Solaris 10 and OSF/1 5.1 systems, the second
+ parameter is
int len. */
_GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len));
# endif
@@ -707,13 +714,22 @@ _GL_WARN_ON_USE (getlogin, "getlogin is unportable - "
${LOGNAME-$USER} on Unix platforms,
$USERNAME on native Windows platforms.
*/
-# if !@HAVE_DECL_GETLOGIN_R@
+# if @REPLACE_GETLOGIN_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define getlogin_r rpl_getlogin_r
+# endif
+_GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (getlogin_r, int, (char *name, size_t size));
+# else
+# if !@HAVE_DECL_GETLOGIN_R@
_GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size)
_GL_ARG_NONNULL ((1)));
-# endif
+# endif
/* Need to cast, because on Solaris 10 systems, the second argument is
int size. */
_GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size));
+# endif
_GL_CXXALIASWARN (getlogin_r);
#elif defined GNULIB_POSIXCHECK
# undef getlogin_r
@@ -780,11 +796,14 @@ _GL_CXXALIAS_RPL (getpagesize, int, (void));
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define getpagesize() _gl_getpagesize ()
# else
+# if !GNULIB_defined_getpagesize_function
static inline int
getpagesize ()
{
return _gl_getpagesize ();
}
+# define GNULIB_defined_getpagesize_function 1
+# endif
# endif
# endif
# endif
@@ -972,6 +991,24 @@ _GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some "
#endif
+#if @GNULIB_PIPE@
+/* Create a pipe, defaulting to O_BINARY mode.
+ Store the read-end as fd[0] and the write-end as fd[1].
+ Return 0 upon success, or -1 with errno set upon failure. */
+# if !@HAVE_PIPE@
+_GL_FUNCDECL_SYS (pipe, int, (int fd[2]) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pipe, int, (int fd[2]));
+_GL_CXXALIASWARN (pipe);
+#elif defined GNULIB_POSIXCHECK
+# undef pipe
+# if HAVE_RAW_DECL_PIPE
+_GL_WARN_ON_USE (pipe, "pipe is unportable - "
+ "use gnulib module pipe-posix for portability");
+# endif
+#endif
+
+
#if @GNULIB_PIPE2@
/* Create a pipe, applying the given flags when opening the read-end of the
pipe and the write-end of the pipe.
@@ -1226,7 +1263,7 @@ _GL_FUNCDECL_RPL (ttyname_r, int,
_GL_CXXALIAS_RPL (ttyname_r, int,
(int fd, char *buf, size_t buflen));
# else
-# if !@HAVE_TTYNAME_R@
+# if !@HAVE_DECL_TTYNAME_R@
_GL_FUNCDECL_SYS (ttyname_r, int,
(int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
# endif
diff --git a/gl/vasnprintf.c b/gl/vasnprintf.c
index 1e9cd431e6..83faadb1b1 100644
--- a/gl/vasnprintf.c
+++ b/gl/vasnprintf.c
@@ -1,5 +1,5 @@
/* vsprintf with automatic memory allocation.
- Copyright (C) 1999, 2002-2010 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1753,8 +1753,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
return NULL;
#define CLEANUP() \
- free (d.dir); \
- if (a.arg) \
+ if (d.dir != d.direct_alloc_dir) \
+ free (d.dir); \
+ if (a.arg != a.direct_alloc_arg) \
free (a.arg);
if (PRINTF_FETCHARGS (args, &a) < 0)
diff --git a/gl/vasnprintf.h b/gl/vasnprintf.h
index a689bad25a..c9f4c2195c 100644
--- a/gl/vasnprintf.h
+++ b/gl/vasnprintf.h
@@ -1,5 +1,5 @@
/* vsprintf with automatic memory allocation.
- Copyright (C) 2002-2004, 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2002-2004, 2007-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -24,16 +24,16 @@
/* Get size_t. */
#include <stddef.h>
-#ifndef __attribute__
/* The __attribute__ feature is available in gcc versions 2.5 and later.
The __-protected variants of the attributes 'format' and 'printf' are
accepted by gcc versions 2.6.4 (effectively 2.7) and later.
- We enable __attribute__ only if these are supported too, because
+ We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
gnulib and libintl do '#define printf __printf__' when they override
the 'printf' function. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-# define __attribute__(Spec) /* empty */
-# endif
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+#else
+# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
#endif
#ifdef __cplusplus
@@ -69,9 +69,9 @@ extern "C" {
# define vasnprintf rpl_vasnprintf
#endif
extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 3, 4)));
+ _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 4));
extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 3, 0)));
+ _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 0));
#ifdef __cplusplus
}
diff --git a/gl/verify.h b/gl/verify.h
index 4ad780c8fa..5e91abdbec 100644
--- a/gl/verify.h
+++ b/gl/verify.h
@@ -1,6 +1,6 @@
/* Compile-time assert-like macros.
- Copyright (C) 2005-2006, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/version-etc-fsf.c b/gl/version-etc-fsf.c
index fc837a895d..c82158302c 100644
--- a/gl/version-etc-fsf.c
+++ b/gl/version-etc-fsf.c
@@ -1,5 +1,5 @@
/* Variable with FSF copyright information, for version-etc.
- Copyright (C) 1999-2006, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 1999-2006, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/version-etc.c b/gl/version-etc.c
index 19c873d016..b8d4724b56 100644
--- a/gl/version-etc.c
+++ b/gl/version-etc.c
@@ -1,5 +1,5 @@
/* Print --version and bug-reporting information in a consistent format.
- Copyright (C) 1999-2010 Free Software Foundation, Inc.
+ Copyright (C) 1999-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -38,7 +38,7 @@
# define PACKAGE PACKAGE_TARNAME
#endif
-enum { COPYRIGHT_YEAR = 2010 };
+enum { COPYRIGHT_YEAR = 2011 };
/* The three functions below display the --version information the
standard way.
diff --git a/gl/version-etc.h b/gl/version-etc.h
index 629fe83013..a9b313d23a 100644
--- a/gl/version-etc.h
+++ b/gl/version-etc.h
@@ -1,5 +1,5 @@
/* Print --version and bug-reporting information in a consistent format.
- Copyright (C) 1999, 2003, 2005, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2003, 2005, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -23,11 +23,11 @@
# include <stdio.h>
/* The `sentinel' attribute was added in gcc 4.0. */
-#ifndef ATTRIBUTE_SENTINEL
+#ifndef _GL_ATTRIBUTE_SENTINEL
# if 4 <= __GNUC__
-# define ATTRIBUTE_SENTINEL __attribute__ ((__sentinel__))
+# define _GL_ATTRIBUTE_SENTINEL __attribute__ ((__sentinel__))
# else
-# define ATTRIBUTE_SENTINEL /* empty */
+# define _GL_ATTRIBUTE_SENTINEL /* empty */
# endif
#endif
@@ -70,7 +70,7 @@ extern void version_etc (FILE *stream,
const char *command_name, const char *package,
const char *version,
/* const char *author1, ..., NULL */ ...)
- ATTRIBUTE_SENTINEL;
+ _GL_ATTRIBUTE_SENTINEL;
/* Display the usual `Report bugs to' stanza */
extern void emit_bug_reporting_address (void);
diff --git a/gl/w32sock.h b/gl/w32sock.h
index b472bd0501..651a76df6c 100644
--- a/gl/w32sock.h
+++ b/gl/w32sock.h
@@ -1,6 +1,6 @@
/* w32sock.h --- internal auxilliary functions for Windows socket functions
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/wchar.in.h b/gl/wchar.in.h
deleted file mode 100644
index c22dc06a0b..0000000000
--- a/gl/wchar.in.h
+++ /dev/null
@@ -1,433 +0,0 @@
-/* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
-
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-/* Written by Eric Blake. */
-
-/*
- * ISO C 99 <wchar.h> for platforms that have issues.
- * <http://www.opengroup.org/susv3xbd/wchar.h.html>
- *
- * For now, this just ensures proper prerequisite inclusion order and
- * the declaration of wcwidth().
- */
-
-#if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-#endif
-@PRAGMA_COLUMNS@
-
-#if defined __need_mbstate_t || defined __need_wint_t || (defined __hpux && ((defined _INTTYPES_INCLUDED && !defined strtoimax) || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) || defined _GL_ALREADY_INCLUDING_WCHAR_H
-/* Special invocation convention:
- - Inside glibc and uClibc header files.
- - On HP-UX 11.00 we have a sequence of nested includes
- <wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>,
- once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h>
- and once directly. In both situations 'wint_t' is not yet defined,
- therefore we cannot provide the function overrides; instead include only
- the system's <wchar.h>.
- - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and
- the latter includes <wchar.h>. But here, we have no way to detect whether
- <wctype.h> is completely included or is still being included. */
-
-#@INCLUDE_NEXT@ @NEXT_WCHAR_H@
-
-#else
-/* Normal invocation convention. */
-
-#ifndef _GL_WCHAR_H
-
-#define _GL_ALREADY_INCLUDING_WCHAR_H
-
-#if @HAVE_FEATURES_H@
-# include <features.h> /* for __GLIBC__ */
-#endif
-
-/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
- <wchar.h>.
- BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
- included before <wchar.h>.
- But avoid namespace pollution on glibc systems. */
-#ifndef __GLIBC__
-# include <stddef.h>
-# include <stdio.h>
-# include <time.h>
-#endif
-
-/* Include the original <wchar.h> if it exists.
- Some builds of uClibc lack it. */
-/* The include_next requires a split double-inclusion guard. */
-#if @HAVE_WCHAR_H@
-# @INCLUDE_NEXT@ @NEXT_WCHAR_H@
-#endif
-
-#undef _GL_ALREADY_INCLUDING_WCHAR_H
-
-#ifndef _GL_WCHAR_H
-#define _GL_WCHAR_H
-
-/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
-
-/* The definition of _GL_ARG_NONNULL is copied here. */
-
-/* The definition of _GL_WARN_ON_USE is copied here. */
-
-
-/* Define wint_t and WEOF. (Also done in wctype.in.h.) */
-#if !@HAVE_WINT_T@ && !defined wint_t
-# define wint_t int
-# ifndef WEOF
-# define WEOF -1
-# endif
-#else
-# ifndef WEOF
-# define WEOF ((wint_t) -1)
-# endif
-#endif
-
-
-/* Override mbstate_t if it is too small.
- On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
- implementing mbrtowc for encodings like UTF-8. */
-#if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
-typedef int rpl_mbstate_t;
-# undef mbstate_t
-# define mbstate_t rpl_mbstate_t
-# define GNULIB_defined_mbstate_t 1
-#endif
-
-
-/* Convert a single-byte character to a wide character. */
-#if @GNULIB_BTOWC@
-# if @REPLACE_BTOWC@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef btowc
-# define btowc rpl_btowc
-# endif
-_GL_FUNCDECL_RPL (btowc, wint_t, (int c));
-_GL_CXXALIAS_RPL (btowc, wint_t, (int c));
-# else
-# if !@HAVE_BTOWC@
-_GL_FUNCDECL_SYS (btowc, wint_t, (int c));
-# endif
-_GL_CXXALIAS_SYS (btowc, wint_t, (int c));
-# endif
-_GL_CXXALIASWARN (btowc);
-#elif defined GNULIB_POSIXCHECK
-# undef btowc
-# if HAVE_RAW_DECL_BTOWC
-_GL_WARN_ON_USE (btowc, "btowc is unportable - "
- "use gnulib module btowc for portability");
-# endif
-#endif
-
-
-/* Convert a wide character to a single-byte character. */
-#if @GNULIB_WCTOB@
-# if @REPLACE_WCTOB@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef wctob
-# define wctob rpl_wctob
-# endif
-_GL_FUNCDECL_RPL (wctob, int, (wint_t wc));
-_GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
-# else
-# if !defined wctob && !@HAVE_DECL_WCTOB@
-/* wctob is provided by gnulib, or wctob exists but is not declared. */
-_GL_FUNCDECL_SYS (wctob, int, (wint_t wc));
-# endif
-_GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
-# endif
-_GL_CXXALIASWARN (wctob);
-#elif defined GNULIB_POSIXCHECK
-# undef wctob
-# if HAVE_RAW_DECL_WCTOB
-_GL_WARN_ON_USE (wctob, "wctob is unportable - "
- "use gnulib module wctob for portability");
-# endif
-#endif
-
-
-/* Test whether *PS is in the initial state. */
-#if @GNULIB_MBSINIT@
-# if @REPLACE_MBSINIT@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef mbsinit
-# define mbsinit rpl_mbsinit
-# endif
-_GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps));
-_GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
-# else
-# if !@HAVE_MBSINIT@
-_GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
-# endif
-_GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
-# endif
-_GL_CXXALIASWARN (mbsinit);
-#elif defined GNULIB_POSIXCHECK
-# undef mbsinit
-# if HAVE_RAW_DECL_MBSINIT
-_GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
- "use gnulib module mbsinit for portability");
-# endif
-#endif
-
-
-/* Convert a multibyte character to a wide character. */
-#if @GNULIB_MBRTOWC@
-# if @REPLACE_MBRTOWC@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef mbrtowc
-# define mbrtowc rpl_mbrtowc
-# endif
-_GL_FUNCDECL_RPL (mbrtowc, size_t,
- (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
-_GL_CXXALIAS_RPL (mbrtowc, size_t,
- (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
-# else
-# if !@HAVE_MBRTOWC@
-_GL_FUNCDECL_SYS (mbrtowc, size_t,
- (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
-# endif
-_GL_CXXALIAS_SYS (mbrtowc, size_t,
- (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
-# endif
-_GL_CXXALIASWARN (mbrtowc);
-#elif defined GNULIB_POSIXCHECK
-# undef mbrtowc
-# if HAVE_RAW_DECL_MBRTOWC
-_GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
- "use gnulib module mbrtowc for portability");
-# endif
-#endif
-
-
-/* Recognize a multibyte character. */
-#if @GNULIB_MBRLEN@
-# if @REPLACE_MBRLEN@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef mbrlen
-# define mbrlen rpl_mbrlen
-# endif
-_GL_FUNCDECL_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
-_GL_CXXALIAS_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
-# else
-# if !@HAVE_MBRLEN@
-_GL_FUNCDECL_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
-# endif
-_GL_CXXALIAS_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
-# endif
-_GL_CXXALIASWARN (mbrlen);
-#elif defined GNULIB_POSIXCHECK
-# undef mbrlen
-# if HAVE_RAW_DECL_MBRLEN
-_GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
- "use gnulib module mbrlen for portability");
-# endif
-#endif
-
-
-/* Convert a string to a wide string. */
-#if @GNULIB_MBSRTOWCS@
-# if @REPLACE_MBSRTOWCS@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef mbsrtowcs
-# define mbsrtowcs rpl_mbsrtowcs
-# endif
-_GL_FUNCDECL_RPL (mbsrtowcs, size_t,
- (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
- _GL_ARG_NONNULL ((2)));
-_GL_CXXALIAS_RPL (mbsrtowcs, size_t,
- (wchar_t *dest, const char **srcp, size_t len,
- mbstate_t *ps));
-# else
-# if !@HAVE_MBSRTOWCS@
-_GL_FUNCDECL_SYS (mbsrtowcs, size_t,
- (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
- _GL_ARG_NONNULL ((2)));
-# endif
-_GL_CXXALIAS_SYS (mbsrtowcs, size_t,
- (wchar_t *dest, const char **srcp, size_t len,
- mbstate_t *ps));
-# endif
-_GL_CXXALIASWARN (mbsrtowcs);
-#elif defined GNULIB_POSIXCHECK
-# undef mbsrtowcs
-# if HAVE_RAW_DECL_MBSRTOWCS
-_GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
- "use gnulib module mbsrtowcs for portability");
-# endif
-#endif
-
-
-/* Convert a string to a wide string. */
-#if @GNULIB_MBSNRTOWCS@
-# if @REPLACE_MBSNRTOWCS@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef mbsnrtowcs
-# define mbsnrtowcs rpl_mbsnrtowcs
-# endif
-_GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
- (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
- mbstate_t *ps)
- _GL_ARG_NONNULL ((2)));
-_GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
- (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
- mbstate_t *ps));
-# else
-# if !@HAVE_MBSNRTOWCS@
-_GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
- (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
- mbstate_t *ps)
- _GL_ARG_NONNULL ((2)));
-# endif
-_GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
- (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
- mbstate_t *ps));
-# endif
-_GL_CXXALIASWARN (mbsnrtowcs);
-#elif defined GNULIB_POSIXCHECK
-# undef mbsnrtowcs
-# if HAVE_RAW_DECL_MBSNRTOWCS
-_GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
- "use gnulib module mbsnrtowcs for portability");
-# endif
-#endif
-
-
-/* Convert a wide character to a multibyte character. */
-#if @GNULIB_WCRTOMB@
-# if @REPLACE_WCRTOMB@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef wcrtomb
-# define wcrtomb rpl_wcrtomb
-# endif
-_GL_FUNCDECL_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
-_GL_CXXALIAS_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
-# else
-# if !@HAVE_WCRTOMB@
-_GL_FUNCDECL_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
-# endif
-_GL_CXXALIAS_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
-# endif
-_GL_CXXALIASWARN (wcrtomb);
-#elif defined GNULIB_POSIXCHECK
-# undef wcrtomb
-# if HAVE_RAW_DECL_WCRTOMB
-_GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
- "use gnulib module wcrtomb for portability");
-# endif
-#endif
-
-
-/* Convert a wide string to a string. */
-#if @GNULIB_WCSRTOMBS@
-# if @REPLACE_WCSRTOMBS@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef wcsrtombs
-# define wcsrtombs rpl_wcsrtombs
-# endif
-_GL_FUNCDECL_RPL (wcsrtombs, size_t,
- (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
- _GL_ARG_NONNULL ((2)));
-_GL_CXXALIAS_RPL (wcsrtombs, size_t,
- (char *dest, const wchar_t **srcp, size_t len,
- mbstate_t *ps));
-# else
-# if !@HAVE_WCSRTOMBS@
-_GL_FUNCDECL_SYS (wcsrtombs, size_t,
- (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
- _GL_ARG_NONNULL ((2)));
-# endif
-_GL_CXXALIAS_SYS (wcsrtombs, size_t,
- (char *dest, const wchar_t **srcp, size_t len,
- mbstate_t *ps));
-# endif
-_GL_CXXALIASWARN (wcsrtombs);
-#elif defined GNULIB_POSIXCHECK
-# undef wcsrtombs
-# if HAVE_RAW_DECL_WCSRTOMBS
-_GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
- "use gnulib module wcsrtombs for portability");
-# endif
-#endif
-
-
-/* Convert a wide string to a string. */
-#if @GNULIB_WCSNRTOMBS@
-# if @REPLACE_WCSNRTOMBS@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef wcsnrtombs
-# define wcsnrtombs rpl_wcsnrtombs
-# endif
-_GL_FUNCDECL_RPL (wcsnrtombs, size_t,
- (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
- mbstate_t *ps)
- _GL_ARG_NONNULL ((2)));
-_GL_CXXALIAS_RPL (wcsnrtombs, size_t,
- (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
- mbstate_t *ps));
-# else
-# if !@HAVE_WCSNRTOMBS@
-_GL_FUNCDECL_SYS (wcsnrtombs, size_t,
- (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
- mbstate_t *ps)
- _GL_ARG_NONNULL ((2)));
-# endif
-_GL_CXXALIAS_SYS (wcsnrtombs, size_t,
- (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
- mbstate_t *ps));
-# endif
-_GL_CXXALIASWARN (wcsnrtombs);
-#elif defined GNULIB_POSIXCHECK
-# undef wcsnrtombs
-# if HAVE_RAW_DECL_WCSNRTOMBS
-_GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
- "use gnulib module wcsnrtombs for portability");
-# endif
-#endif
-
-
-/* Return the number of screen columns needed for WC. */
-#if @GNULIB_WCWIDTH@
-# if @REPLACE_WCWIDTH@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef wcwidth
-# define wcwidth rpl_wcwidth
-# endif
-_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t));
-_GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
-# else
-# if !@HAVE_DECL_WCWIDTH@
-/* wcwidth exists but is not declared. */
-_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t));
-# endif
-_GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
-# endif
-_GL_CXXALIASWARN (wcwidth);
-#elif defined GNULIB_POSIXCHECK
-# undef wcwidth
-# if HAVE_RAW_DECL_WCWIDTH
-_GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
- "use gnulib module wcwidth for portability");
-# endif
-#endif
-
-
-#endif /* _GL_WCHAR_H */
-#endif /* _GL_WCHAR_H */
-#endif
diff --git a/gl/xsize.h b/gl/xsize.h
index fbd63290d6..6505c42e9d 100644
--- a/gl/xsize.h
+++ b/gl/xsize.h
@@ -1,6 +1,6 @@
/* xsize.h -- Checked size_t computations.
- Copyright (C) 2003, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2008-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/build-aux/arg-nonnull.h b/lib/build-aux/arg-nonnull.h
index 7e3e2db82e..6c2f1e82d0 100644
--- a/lib/build-aux/arg-nonnull.h
+++ b/lib/build-aux/arg-nonnull.h
@@ -1,5 +1,5 @@
/* A C macro for declaring that specific arguments must not be NULL.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
@@ -9,7 +9,7 @@
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+ General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
diff --git a/lib/build-aux/c++defs.h b/lib/build-aux/c++defs.h
index 0c2fad7a21..b6821a64ac 100644
--- a/lib/build-aux/c++defs.h
+++ b/lib/build-aux/c++defs.h
@@ -1,5 +1,5 @@
/* C++ compatible function declaration macros.
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
@@ -9,7 +9,7 @@
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+ General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
diff --git a/lib/build-aux/config.rpath b/lib/build-aux/config.rpath
index 17298f2348..8bd7f5d726 100755
--- a/lib/build-aux/config.rpath
+++ b/lib/build-aux/config.rpath
@@ -2,7 +2,7 @@
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
-# Copyright 1996-2010 Free Software Foundation, Inc.
+# Copyright 1996-2011 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
@@ -57,13 +57,6 @@ else
aix*)
wl='-Wl,'
;;
- darwin*)
- case $cc_basename in
- xlc*)
- wl='-Wl,'
- ;;
- esac
- ;;
mingw* | cygwin* | pw32* | os2* | cegcc*)
;;
hpux9* | hpux10* | hpux11*)
@@ -72,9 +65,7 @@ else
irix5* | irix6* | nonstopux*)
wl='-Wl,'
;;
- newsos6)
- ;;
- linux* | k*bsd*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
ecc*)
wl='-Wl,'
@@ -85,17 +76,26 @@ else
lf95*)
wl='-Wl,'
;;
- pgcc | pgf77 | pgf90)
+ nagfor*)
+ wl='-Wl,-Wl,,'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
wl='-Wl,'
;;
ccc*)
wl='-Wl,'
;;
+ xl* | bgxl* | bgf* | mpixl*)
+ wl='-Wl,'
+ ;;
como)
wl='-lopt='
;;
*)
case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ F* | *Sun*Fortran*)
+ wl=
+ ;;
*Sun\ C*)
wl='-Wl,'
;;
@@ -103,13 +103,24 @@ else
;;
esac
;;
+ newsos6)
+ ;;
+ *nto* | *qnx*)
+ ;;
osf3* | osf4* | osf5*)
wl='-Wl,'
;;
rdos*)
;;
solaris*)
- wl='-Wl,'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ wl='-Qoption ld '
+ ;;
+ *)
+ wl='-Wl,'
+ ;;
+ esac
;;
sunos4*)
wl='-Qoption ld '
@@ -171,15 +182,14 @@ if test "$with_gnu_ld" = yes; then
fi
;;
amigaos*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we cannot use
- # them.
- ld_shlibs=no
+ case "$host_cpu" in
+ powerpc)
+ ;;
+ m68k)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
;;
beos*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
@@ -198,11 +208,13 @@ if test "$with_gnu_ld" = yes; then
ld_shlibs=no
fi
;;
+ haiku*)
+ ;;
interix[3-9]*)
hardcode_direct=no
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
- gnu* | linux* | k*bsd*-gnu)
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
@@ -325,10 +337,14 @@ else
fi
;;
amigaos*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs=no
+ case "$host_cpu" in
+ powerpc)
+ ;;
+ m68k)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
;;
bsdi[45]*)
;;
@@ -342,24 +358,15 @@ else
;;
darwin* | rhapsody*)
hardcode_direct=no
- if test "$GCC" = yes ; then
+ if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
:
else
- case $cc_basename in
- xlc*)
- ;;
- *)
- ld_shlibs=no
- ;;
- esac
+ ld_shlibs=no
fi
;;
dgux*)
hardcode_libdir_flag_spec='-L$libdir'
;;
- freebsd1*)
- ld_shlibs=no
- ;;
freebsd2.2*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
@@ -420,6 +427,8 @@ else
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
+ *nto* | *qnx*)
+ ;;
openbsd*)
if test -f /usr/libexec/ld.so; then
hardcode_direct=yes
@@ -515,7 +524,12 @@ case "$host_os" in
library_names_spec='$libname$shrext'
;;
amigaos*)
- library_names_spec='$libname.a'
+ case "$host_cpu" in
+ powerpc*)
+ library_names_spec='$libname$shrext' ;;
+ m68k)
+ library_names_spec='$libname.a' ;;
+ esac
;;
beos*)
library_names_spec='$libname$shrext'
@@ -534,8 +548,6 @@ case "$host_os" in
dgux*)
library_names_spec='$libname$shrext'
;;
- freebsd1*)
- ;;
freebsd* | dragonfly*)
case "$host_os" in
freebsd[123]*)
@@ -547,6 +559,9 @@ case "$host_os" in
gnu*)
library_names_spec='$libname$shrext'
;;
+ haiku*)
+ library_names_spec='$libname$shrext'
+ ;;
hpux9* | hpux10* | hpux11*)
case $host_cpu in
ia64*)
@@ -582,7 +597,7 @@ case "$host_os" in
;;
linux*oldld* | linux*aout* | linux*coff*)
;;
- linux* | k*bsd*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
library_names_spec='$libname$shrext'
;;
knetbsd*-gnu)
@@ -594,7 +609,7 @@ case "$host_os" in
newsos6)
library_names_spec='$libname$shrext'
;;
- nto-qnx*)
+ *nto* | *qnx*)
library_names_spec='$libname$shrext'
;;
openbsd*)
@@ -625,6 +640,9 @@ case "$host_os" in
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
library_names_spec='$libname$shrext'
;;
+ tpf*)
+ library_names_spec='$libname$shrext'
+ ;;
uts4*)
library_names_spec='$libname$shrext'
;;
diff --git a/lib/build-aux/warn-on-use.h b/lib/build-aux/warn-on-use.h
index 171e599163..2cdeec3e66 100644
--- a/lib/build-aux/warn-on-use.h
+++ b/lib/build-aux/warn-on-use.h
@@ -1,5 +1,5 @@
/* A C macro for emitting warnings if a function is used.
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
@@ -9,7 +9,7 @@
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+ General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
diff --git a/lib/gl/Makefile.am b/lib/gl/Makefile.am
index 210ceccd67..037f3c601f 100644
--- a/lib/gl/Makefile.am
+++ b/lib/gl/Makefile.am
@@ -1,6 +1,6 @@
## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+# Copyright (C) 2002-2011 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
@@ -418,6 +418,7 @@ stdint.h: stdint.in.h
-e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
-e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
-e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
+ -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
-e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
-e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
-e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
@@ -499,6 +500,8 @@ stdio.h: stdio.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
< $(srcdir)/stdio.in.h | \
sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
+ -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
+ -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
-e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
-e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
-e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
@@ -593,7 +596,8 @@ stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''GNULIB_SYSTEM_POSIX''@|$(GNULIB_SYSTEM_POSIX)|g' \
-e 's|@''GNULIB_UNLOCKPT''@|$(GNULIB_UNLOCKPT)|g' \
-e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \
- -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
+ < $(srcdir)/stdlib.in.h | \
+ sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
-e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
-e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \
-e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
@@ -609,14 +613,14 @@ stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
-e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \
-e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
- -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \
+ -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \
-e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
-e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
-e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \
-e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \
-e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
-e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \
- -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \
+ -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \
-e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \
-e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
-e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \
@@ -629,8 +633,7 @@ stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
- -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
- < $(srcdir)/stdlib.in.h; \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += stdlib.h stdlib.h-t
@@ -904,7 +907,7 @@ time.h: time.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''GNULIB_STRPTIME''@|$(GNULIB_STRPTIME)|g' \
-e 's|@''GNULIB_TIMEGM''@|$(GNULIB_TIMEGM)|g' \
-e 's|@''GNULIB_TIME_R''@|$(GNULIB_TIME_R)|g' \
- -e 's|@''HAVE_LOCALTIME_R''@|$(HAVE_LOCALTIME_R)|g' \
+ -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \
-e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
-e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
-e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
@@ -974,6 +977,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \
-e 's|@''GNULIB_LINKAT''@|$(GNULIB_LINKAT)|g' \
-e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
+ -e 's|@''GNULIB_PIPE''@|$(GNULIB_PIPE)|g' \
-e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \
-e 's|@''GNULIB_PREAD''@|$(GNULIB_PREAD)|g' \
-e 's|@''GNULIB_PWRITE''@|$(GNULIB_PWRITE)|g' \
@@ -1008,6 +1012,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
-e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
-e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \
+ -e 's|@''HAVE_PIPE''@|$(HAVE_PIPE)|g' \
-e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \
-e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \
-e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \
@@ -1016,23 +1021,26 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
-e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \
-e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \
- -e 's|@''HAVE_TTYNAME_R''@|$(HAVE_TTYNAME_R)|g' \
-e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
-e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
-e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
+ -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \
-e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \
-e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
-e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \
-e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \
+ -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \
-e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
-e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
- -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
+ | \
+ sed -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
-e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
-e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
-e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
-e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
-e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
-e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
+ -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
-e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
-e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
-e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
@@ -1115,68 +1123,6 @@ EXTRA_DIST += $(top_srcdir)/build-aux/warn-on-use.h
## end gnulib module warn-on-use
-## begin gnulib module wchar
-
-BUILT_SOURCES += wchar.h
-
-# We need the following in order to create <wchar.h> when the system
-# version does not work standalone.
-wchar.h: wchar.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
- $(AM_V_GEN)rm -f $@-t $@ && \
- { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
- sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
- -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
- -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
- -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
- -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
- -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \
- -e 's|@''GNULIB_BTOWC''@|$(GNULIB_BTOWC)|g' \
- -e 's|@''GNULIB_WCTOB''@|$(GNULIB_WCTOB)|g' \
- -e 's|@''GNULIB_MBSINIT''@|$(GNULIB_MBSINIT)|g' \
- -e 's|@''GNULIB_MBRTOWC''@|$(GNULIB_MBRTOWC)|g' \
- -e 's|@''GNULIB_MBRLEN''@|$(GNULIB_MBRLEN)|g' \
- -e 's|@''GNULIB_MBSRTOWCS''@|$(GNULIB_MBSRTOWCS)|g' \
- -e 's|@''GNULIB_MBSNRTOWCS''@|$(GNULIB_MBSNRTOWCS)|g' \
- -e 's|@''GNULIB_WCRTOMB''@|$(GNULIB_WCRTOMB)|g' \
- -e 's|@''GNULIB_WCSRTOMBS''@|$(GNULIB_WCSRTOMBS)|g' \
- -e 's|@''GNULIB_WCSNRTOMBS''@|$(GNULIB_WCSNRTOMBS)|g' \
- -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \
- -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
- -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
- -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \
- -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \
- -e 's|@''HAVE_MBRLEN''@|$(HAVE_MBRLEN)|g' \
- -e 's|@''HAVE_MBSRTOWCS''@|$(HAVE_MBSRTOWCS)|g' \
- -e 's|@''HAVE_MBSNRTOWCS''@|$(HAVE_MBSNRTOWCS)|g' \
- -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \
- -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \
- -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \
- -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \
- -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
- -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
- -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \
- -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \
- -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \
- -e 's|@''REPLACE_MBRTOWC''@|$(REPLACE_MBRTOWC)|g' \
- -e 's|@''REPLACE_MBRLEN''@|$(REPLACE_MBRLEN)|g' \
- -e 's|@''REPLACE_MBSRTOWCS''@|$(REPLACE_MBSRTOWCS)|g' \
- -e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \
- -e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \
- -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \
- -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \
- -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
- -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
- -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
- -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
- < $(srcdir)/wchar.in.h; \
- } > $@-t && \
- mv $@-t $@
-MOSTLYCLEANFILES += wchar.h wchar.h-t
-
-EXTRA_DIST += wchar.in.h
-
-## end gnulib module wchar
-
## begin gnulib module xsize
liblgnu_la_SOURCES += xsize.h
diff --git a/lib/gl/alignof.h b/lib/gl/alignof.h
index d65dd648b2..7cb9b616a5 100644
--- a/lib/gl/alignof.h
+++ b/lib/gl/alignof.h
@@ -1,5 +1,5 @@
/* Determine alignment of types.
- Copyright (C) 2003-2004, 2006, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 2003-2004, 2006, 2009-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/lib/gl/alloca.in.h b/lib/gl/alloca.in.h
index cdb7366cdf..8012ce987d 100644
--- a/lib/gl/alloca.in.h
+++ b/lib/gl/alloca.in.h
@@ -1,6 +1,6 @@
/* Memory allocation on the stack.
- Copyright (C) 1995, 1999, 2001-2004, 2006-2010 Free Software Foundation,
+ Copyright (C) 1995, 1999, 2001-2004, 2006-2011 Free Software Foundation,
Inc.
This program is free software; you can redistribute it and/or modify it
@@ -11,7 +11,7 @@
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
+ Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
diff --git a/lib/gl/asnprintf.c b/lib/gl/asnprintf.c
index 75f519bc34..0239f4a4d9 100644
--- a/lib/gl/asnprintf.c
+++ b/lib/gl/asnprintf.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 1999, 2002, 2006, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2006, 2009-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/lib/gl/asprintf.c b/lib/gl/asprintf.c
index 5e74dd0daa..84728b186f 100644
--- a/lib/gl/asprintf.c
+++ b/lib/gl/asprintf.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 1999, 2002, 2006-2007, 2009-2010 Free Software Foundation,
+ Copyright (C) 1999, 2002, 2006-2007, 2009-2011 Free Software Foundation,
Inc.
This program is free software; you can redistribute it and/or modify
diff --git a/lib/gl/byteswap.in.h b/lib/gl/byteswap.in.h
index f245fbdc49..d2b84c4a49 100644
--- a/lib/gl/byteswap.in.h
+++ b/lib/gl/byteswap.in.h
@@ -1,5 +1,5 @@
/* byteswap.h - Byte swapping
- Copyright (C) 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2007, 2009-2011 Free Software Foundation, Inc.
Written by Oskar Liljeblad <oskar@osk.mine.nu>, 2005.
This program is free software: you can redistribute it and/or modify
diff --git a/lib/gl/c-ctype.c b/lib/gl/c-ctype.c
index 9da8e58131..a5e01dcac3 100644
--- a/lib/gl/c-ctype.c
+++ b/lib/gl/c-ctype.c
@@ -1,6 +1,6 @@
/* Character handling in C locale.
- Copyright 2000-2003, 2006, 2009-2010 Free Software Foundation, Inc.
+ Copyright 2000-2003, 2006, 2009-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/lib/gl/c-ctype.h b/lib/gl/c-ctype.h
index 5ac5dd25e7..f8e8357836 100644
--- a/lib/gl/c-ctype.h
+++ b/lib/gl/c-ctype.h
@@ -5,7 +5,7 @@
<ctype.h> functions' behaviour depends on the current locale set via
setlocale.
- Copyright (C) 2000-2003, 2006, 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2000-2003, 2006, 2008-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/lib/gl/close-hook.c b/lib/gl/close-hook.c
index 34ef8763db..d18ed432f5 100644
--- a/lib/gl/close-hook.c
+++ b/lib/gl/close-hook.c
@@ -1,5 +1,5 @@
/* Hook for making the close() function extensible.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2009.
This program is free software: you can redistribute it and/or modify it
diff --git a/lib/gl/close-hook.h b/lib/gl/close-hook.h
index cda7742ee0..2c5a1af478 100644
--- a/lib/gl/close-hook.h
+++ b/lib/gl/close-hook.h
@@ -1,5 +1,5 @@
/* Hook for making the close() function extensible.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
diff --git a/lib/gl/errno.in.h b/lib/gl/errno.in.h
index 4994ebfa48..2f9ac4591d 100644
--- a/lib/gl/errno.in.h
+++ b/lib/gl/errno.in.h
@@ -1,6 +1,6 @@
/* A POSIX-like <errno.h>.
- Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/lib/gl/float+.h b/lib/gl/float+.h
index bc35df8957..f40544f9a4 100644
--- a/lib/gl/float+.h
+++ b/lib/gl/float+.h
@@ -1,5 +1,5 @@
/* Supplemental information about the floating-point formats.
- Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2007.
This program is free software; you can redistribute it and/or modify
diff --git a/lib/gl/float.in.h b/lib/gl/float.in.h
index c0ddaa518a..f77a5ef8b6 100644
--- a/lib/gl/float.in.h
+++ b/lib/gl/float.in.h
@@ -1,6 +1,6 @@
/* A correct <float.h>.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/lib/gl/fseeko.c b/lib/gl/fseeko.c
index 8e492c54be..2b171ddbcc 100644
--- a/lib/gl/fseeko.c
+++ b/lib/gl/fseeko.c
@@ -1,5 +1,5 @@
/* An fseeko() function that, together with fflush(), is POSIX compliant.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -69,7 +69,7 @@ fseeko (FILE *fp, off_t offset, int whence)
&& fp->_rcount == 0
&& fp->_wcount == 0
&& fp->_ungetc_count == 0)
-#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
+#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */
if (fp_->_ptr == fp_->_base
&& (fp_->_ptr == NULL || fp_->_cnt == 0))
#elif defined __UCLIBC__ /* uClibc */
@@ -131,7 +131,7 @@ fseeko (FILE *fp, off_t offset, int whence)
fp_->_flags &= ~__SEOF;
#elif defined __EMX__ /* emx+gcc */
fp->_flags &= ~_IOEOF;
-#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
+#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */
fp->_flag &= ~_IOEOF;
#elif defined __MINT__ /* Atari FreeMiNT */
fp->__offset = pos;
diff --git a/lib/gl/ftello.c b/lib/gl/ftello.c
index f4beeea881..36901facf6 100644
--- a/lib/gl/ftello.c
+++ b/lib/gl/ftello.c
@@ -1,5 +1,5 @@
/* An ftello() function that works around platform bugs.
- Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -50,7 +50,7 @@ ftello (FILE *fp)
ftello (fp);
/* Compute the file position ourselves. */
- pos = llseek (fileno (fp), (off_t) 0, SEEK_CUR);
+ pos = lseek (fileno (fp), (off_t) 0, SEEK_CUR);
if (pos >= 0)
{
if ((fp_->_flag & _IONBF) == 0 && fp_->_base != NULL)
diff --git a/lib/gl/gettext.h b/lib/gl/gettext.h
index d743a2ba98..202f1019ae 100644
--- a/lib/gl/gettext.h
+++ b/lib/gl/gettext.h
@@ -1,5 +1,5 @@
/* Convenience header for conditional use of GNU <libintl.h>.
- Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2010 Free Software
+ Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2011 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -93,6 +93,12 @@
#endif
+/* Prefer gnulib's setlocale override over libintl's setlocale override. */
+#ifdef GNULIB_defined_setlocale
+# undef setlocale
+# define setlocale rpl_setlocale
+#endif
+
/* A pseudo function call that serves as a marker for the automated
extraction of messages, but does not call gettext(). The run-time
translation is done at a different place in the code.
diff --git a/lib/gl/lseek.c b/lib/gl/lseek.c
index 601efa357f..bcaffe20f2 100644
--- a/lib/gl/lseek.c
+++ b/lib/gl/lseek.c
@@ -1,5 +1,5 @@
/* An lseek() function that detects pipes.
- Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/lib/gl/m4/00gnulib.m4 b/lib/gl/m4/00gnulib.m4
index 301469b31c..7feed46694 100644
--- a/lib/gl/m4/00gnulib.m4
+++ b/lib/gl/m4/00gnulib.m4
@@ -1,5 +1,5 @@
# 00gnulib.m4 serial 2
-dnl Copyright (C) 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2011 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.
diff --git a/lib/gl/m4/alloca.m4 b/lib/gl/m4/alloca.m4
index 80d67aad77..e2e8a05a6e 100644
--- a/lib/gl/m4/alloca.m4
+++ b/lib/gl/m4/alloca.m4
@@ -1,5 +1,5 @@
# alloca.m4 serial 10
-dnl Copyright (C) 2002-2004, 2006-2007, 2009-2010 Free Software Foundation,
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2011 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/lib/gl/m4/asm-underscore.m4 b/lib/gl/m4/asm-underscore.m4
index 1736cc432a..15c89cca91 100644
--- a/lib/gl/m4/asm-underscore.m4
+++ b/lib/gl/m4/asm-underscore.m4
@@ -1,5 +1,5 @@
# asm-underscore.m4 serial 1
-dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2011 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.
diff --git a/lib/gl/m4/byteswap.m4 b/lib/gl/m4/byteswap.m4
index 2afd6a2a4e..a033acd8da 100644
--- a/lib/gl/m4/byteswap.m4
+++ b/lib/gl/m4/byteswap.m4
@@ -1,5 +1,5 @@
# byteswap.m4 serial 3
-dnl Copyright (C) 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2007, 2009-2011 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.
diff --git a/lib/gl/m4/codeset.m4 b/lib/gl/m4/codeset.m4
index f722b2e86a..da73552231 100644
--- a/lib/gl/m4/codeset.m4
+++ b/lib/gl/m4/codeset.m4
@@ -1,5 +1,5 @@
# codeset.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2000-2002, 2006, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-2002, 2006, 2008-2011 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.
diff --git a/lib/gl/m4/errno_h.m4 b/lib/gl/m4/errno_h.m4
index e4325ac660..687bafff2d 100644
--- a/lib/gl/m4/errno_h.m4
+++ b/lib/gl/m4/errno_h.m4
@@ -1,5 +1,5 @@
-# errno_h.m4 serial 7
-dnl Copyright (C) 2004, 2006, 2008-2010 Free Software Foundation, Inc.
+# errno_h.m4 serial 8
+dnl Copyright (C) 2004, 2006, 2008-2011 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.
@@ -50,7 +50,7 @@ booboo
if test $gl_cv_header_errno_h_complete = yes; then
ERRNO_H=''
else
- gl_CHECK_NEXT_HEADERS([errno.h])
+ gl_NEXT_HEADERS([errno.h])
ERRNO_H='errno.h'
fi
AC_SUBST([ERRNO_H])
diff --git a/lib/gl/m4/extensions.m4 b/lib/gl/m4/extensions.m4
index 7d9458a8d6..1330503f0d 100644
--- a/lib/gl/m4/extensions.m4
+++ b/lib/gl/m4/extensions.m4
@@ -1,7 +1,7 @@
# serial 9 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
-# Copyright (C) 2003, 2006-2010 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2011 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/lib/gl/m4/fcntl-o.m4 b/lib/gl/m4/fcntl-o.m4
index 46fad47021..88db07ec73 100644
--- a/lib/gl/m4/fcntl-o.m4
+++ b/lib/gl/m4/fcntl-o.m4
@@ -1,5 +1,5 @@
# fcntl-o.m4 serial 3
-dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2009-2011 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.
diff --git a/lib/gl/m4/fcntl_h.m4 b/lib/gl/m4/fcntl_h.m4
new file mode 100644
index 0000000000..1ef4f455b7
--- /dev/null
+++ b/lib/gl/m4/fcntl_h.m4
@@ -0,0 +1,43 @@
+# serial 13
+# Configure fcntl.h.
+dnl Copyright (C) 2006-2007, 2009-2011 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.
+
+dnl Written by Paul Eggert.
+
+AC_DEFUN([gl_FCNTL_H],
+[
+ AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+ AC_REQUIRE([gl_FCNTL_O_FLAGS])
+ gl_NEXT_HEADERS([fcntl.h])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use, if it is not common
+ dnl enough to be declared everywhere.
+ gl_WARN_ON_USE_PREPARE([[#include <fcntl.h>
+ ]], [fcntl openat])
+])
+
+AC_DEFUN([gl_FCNTL_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_FCNTL_H_DEFAULTS],
+[
+ GNULIB_FCNTL=0; AC_SUBST([GNULIB_FCNTL])
+ GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN])
+ GNULIB_OPENAT=0; AC_SUBST([GNULIB_OPENAT])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL])
+ HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT])
+ REPLACE_FCNTL=0; AC_SUBST([REPLACE_FCNTL])
+ REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN])
+ REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT])
+])
diff --git a/lib/gl/m4/float_h.m4 b/lib/gl/m4/float_h.m4
index f6099db405..265a4c1a6e 100644
--- a/lib/gl/m4/float_h.m4
+++ b/lib/gl/m4/float_h.m4
@@ -1,5 +1,5 @@
-# float_h.m4 serial 4
-dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+# float_h.m4 serial 5
+dnl Copyright (C) 2007, 2009-2011 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.
@@ -12,7 +12,7 @@ AC_DEFUN([gl_FLOAT_H],
case "$host_os" in
beos* | openbsd* | mirbsd*)
FLOAT_H=float.h
- gl_CHECK_NEXT_HEADERS([float.h])
+ gl_NEXT_HEADERS([float.h])
;;
esac
AC_SUBST([FLOAT_H])
diff --git a/lib/gl/m4/fseeko.m4 b/lib/gl/m4/fseeko.m4
index b97df53377..4a672606a7 100644
--- a/lib/gl/m4/fseeko.m4
+++ b/lib/gl/m4/fseeko.m4
@@ -1,5 +1,5 @@
-# fseeko.m4 serial 9
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# fseeko.m4 serial 10
+dnl Copyright (C) 2007-2011 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.
@@ -10,6 +10,11 @@ AC_DEFUN([gl_FUNC_FSEEKO],
AC_REQUIRE([gl_HAVE_FSEEKO])
AC_REQUIRE([gl_STDIN_LARGE_OFFSET])
+ AC_CHECK_DECLS_ONCE([fseeko])
+ if test $ac_cv_have_decl_fseeko = no; then
+ HAVE_DECL_FSEEKO=0
+ fi
+
if test $gl_cv_func_fseeko = no; then
HAVE_FSEEKO=0
gl_REPLACE_FSEEKO
diff --git a/lib/gl/m4/ftello.m4 b/lib/gl/m4/ftello.m4
index 33201a0107..599f8f2047 100644
--- a/lib/gl/m4/ftello.m4
+++ b/lib/gl/m4/ftello.m4
@@ -1,5 +1,5 @@
-# ftello.m4 serial 8
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# ftello.m4 serial 9
+dnl Copyright (C) 2007-2011 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.
@@ -13,6 +13,11 @@ AC_DEFUN([gl_FUNC_FTELLO],
dnl Persuade glibc <stdio.h> to declare ftello().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_DECLS_ONCE([ftello])
+ if test $ac_cv_have_decl_ftello = no; then
+ HAVE_DECL_FTELLO=0
+ fi
+
AC_CACHE_CHECK([for ftello], [gl_cv_func_ftello],
[
AC_LINK_IFELSE(
diff --git a/lib/gl/m4/func.m4 b/lib/gl/m4/func.m4
index 698c5281da..dcd2d4f0d1 100644
--- a/lib/gl/m4/func.m4
+++ b/lib/gl/m4/func.m4
@@ -1,5 +1,5 @@
# func.m4 serial 2
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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.
diff --git a/lib/gl/m4/getpagesize.m4 b/lib/gl/m4/getpagesize.m4
index 313ad7fa26..79dfbbe493 100644
--- a/lib/gl/m4/getpagesize.m4
+++ b/lib/gl/m4/getpagesize.m4
@@ -1,5 +1,5 @@
# getpagesize.m4 serial 8
-dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2010 Free Software Foundation,
+dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2011 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/lib/gl/m4/gettext.m4 b/lib/gl/m4/gettext.m4
index 979c52c196..cab4dfc81a 100644
--- a/lib/gl/m4/gettext.m4
+++ b/lib/gl/m4/gettext.m4
@@ -1,5 +1,5 @@
# gettext.m4 serial 64 (gettext-0.18.2)
-dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 1995-2011 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.
diff --git a/lib/gl/m4/glibc2.m4 b/lib/gl/m4/glibc2.m4
index b92208a1c6..a5fe3cfc07 100644
--- a/lib/gl/m4/glibc2.m4
+++ b/lib/gl/m4/glibc2.m4
@@ -1,5 +1,6 @@
# glibc2.m4 serial 3
-dnl Copyright (C) 2000-2002, 2004, 2008, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2011 Free Software Foundation,
+dnl 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.
diff --git a/lib/gl/m4/glibc21.m4 b/lib/gl/m4/glibc21.m4
index bd08b381e8..bc81c110b8 100644
--- a/lib/gl/m4/glibc21.m4
+++ b/lib/gl/m4/glibc21.m4
@@ -1,5 +1,6 @@
# glibc21.m4 serial 5
-dnl Copyright (C) 2000-2002, 2004, 2008, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2011 Free Software Foundation,
+dnl 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.
diff --git a/lib/gl/m4/gnulib-cache.m4 b/lib/gl/m4/gnulib-cache.m4
index 24590151e2..64066354b0 100644
--- a/lib/gl/m4/gnulib-cache.m4
+++ b/lib/gl/m4/gnulib-cache.m4
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+# Copyright (C) 2002-2011 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
diff --git a/lib/gl/m4/gnulib-common.m4 b/lib/gl/m4/gnulib-common.m4
index d0c8b66287..ecbf33694e 100644
--- a/lib/gl/m4/gnulib-common.m4
+++ b/lib/gl/m4/gnulib-common.m4
@@ -1,5 +1,5 @@
-# gnulib-common.m4 serial 21
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# gnulib-common.m4 serial 23
+dnl Copyright (C) 2007-2011 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.
@@ -102,6 +102,26 @@ AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS],
[Define to 1 when the gnulib module $1 should be tested.])
])
+# gl_ASSERT_NO_GNULIB_POSIXCHECK
+# asserts that there will never be a need to #define GNULIB_POSIXCHECK.
+# and thereby enables an optimization of configure and config.h.
+# Used by Emacs.
+AC_DEFUN([gl_ASSERT_NO_GNULIB_POSIXCHECK],
+[
+ dnl Override gl_WARN_ON_USE_PREPARE.
+ AC_DEFUN([gl_WARN_ON_USE_PREPARE], [])
+])
+
+# gl_ASSERT_NO_GNULIB_TESTS
+# asserts that there will be no gnulib tests in the scope of the configure.ac
+# and thereby enables an optimization of config.h.
+# Used by Emacs.
+AC_DEFUN([gl_ASSERT_NO_GNULIB_TESTS],
+[
+ dnl Override gl_MODULE_INDICATOR_FOR_TESTS.
+ AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], [])
+])
+
# Test whether <features.h> exists.
# Set HAVE_FEATURES_H.
AC_DEFUN([gl_FEATURES_H],
diff --git a/lib/gl/m4/gnulib-comp.m4 b/lib/gl/m4/gnulib-comp.m4
index 58358c567a..b4053d9c52 100644
--- a/lib/gl/m4/gnulib-comp.m4
+++ b/lib/gl/m4/gnulib-comp.m4
@@ -1,5 +1,5 @@
# DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+# Copyright (C) 2002-2011 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
@@ -42,6 +42,8 @@ AC_DEFUN([lgl_EARLY],
# Code from module errno-tests:
# Code from module extensions:
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ # Code from module fcntl-h:
+ # Code from module fcntl-h-tests:
# Code from module float:
# Code from module fseeko:
AC_REQUIRE([AC_FUNC_FSEEKO])
@@ -113,8 +115,6 @@ AC_DEFUN([lgl_EARLY],
# Code from module vsnprintf:
# Code from module vsnprintf-tests:
# Code from module warn-on-use:
- # Code from module wchar:
- # Code from module wchar-tests:
# Code from module xsize:
])
@@ -194,6 +194,7 @@ AC_DEFUN([lgl_INIT],
# Code from module snprintf:
gl_FUNC_SNPRINTF
gl_STDIO_MODULE_INDICATOR([snprintf])
+ gl_MODULE_INDICATOR([snprintf])
# Code from module socketlib:
gl_SOCKETLIB
# Code from module sockets:
@@ -245,8 +246,6 @@ AC_DEFUN([lgl_INIT],
gl_FUNC_VSNPRINTF
gl_STDIO_MODULE_INDICATOR([vsnprintf])
# Code from module warn-on-use:
- # Code from module wchar:
- gl_WCHAR_H
# Code from module xsize:
gl_XSIZE
# End of code from modules
@@ -295,6 +294,7 @@ changequote([, ])dnl
AC_SUBST([lgltests_WITNESS])
gl_module_indicator_condition=$lgltests_WITNESS
m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition])
+ gl_FCNTL_H
gl_FUNC_UNGETC_WORKS
gl_FUNC_UNGETC_WORKS
gl_FUNC_GETPAGESIZE
@@ -459,7 +459,6 @@ AC_DEFUN([lgl_FILE_LIST], [
lib/verify.h
lib/vsnprintf.c
lib/w32sock.h
- lib/wchar.in.h
lib/xsize.h
m4/00gnulib.m4
m4/alloca.m4
@@ -469,6 +468,7 @@ AC_DEFUN([lgl_FILE_LIST], [
m4/errno_h.m4
m4/extensions.m4
m4/fcntl-o.m4
+ m4/fcntl_h.m4
m4/float_h.m4
m4/fseeko.m4
m4/ftello.m4
@@ -540,7 +540,6 @@ AC_DEFUN([lgl_FILE_LIST], [
m4/visibility.m4
m4/vsnprintf.m4
m4/warn-on-use.m4
- m4/wchar_h.m4
m4/wchar_t.m4
m4/wint_t.m4
m4/xsize.m4
@@ -553,6 +552,7 @@ AC_DEFUN([lgl_FILE_LIST], [
tests/test-byteswap.c
tests/test-c-ctype.c
tests/test-errno.c
+ tests/test-fcntl-h.c
tests/test-fseeko.c
tests/test-fseeko.sh
tests/test-fseeko2.sh
@@ -584,10 +584,10 @@ AC_DEFUN([lgl_FILE_LIST], [
tests/test-verify.c
tests/test-verify.sh
tests/test-vsnprintf.c
- tests/test-wchar.c
tests/zerosize-ptr.h
tests=lib/binary-io.h
tests=lib/dummy.c
+ tests=lib/fcntl.in.h
tests=lib/getpagesize.c
tests=lib/intprops.h
])
diff --git a/lib/gl/m4/gnulib-tool.m4 b/lib/gl/m4/gnulib-tool.m4
index 69e7733b99..ed41e9d415 100644
--- a/lib/gl/m4/gnulib-tool.m4
+++ b/lib/gl/m4/gnulib-tool.m4
@@ -1,5 +1,5 @@
# gnulib-tool.m4 serial 2
-dnl Copyright (C) 2004-2005, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2005, 2009-2011 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.
diff --git a/lib/gl/m4/iconv.m4 b/lib/gl/m4/iconv.m4
index 006c90780a..085cd068f5 100644
--- a/lib/gl/m4/iconv.m4
+++ b/lib/gl/m4/iconv.m4
@@ -1,5 +1,5 @@
# iconv.m4 serial 17 (gettext-0.18.2)
-dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-2002, 2007-2011 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.
diff --git a/lib/gl/m4/include_next.m4 b/lib/gl/m4/include_next.m4
index e37eb0567d..b3c7849185 100644
--- a/lib/gl/m4/include_next.m4
+++ b/lib/gl/m4/include_next.m4
@@ -1,5 +1,5 @@
-# include_next.m4 serial 16
-dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
+# include_next.m4 serial 18
+dnl Copyright (C) 2006-2011 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.
@@ -147,11 +147,33 @@ choke me
# Note: This macro assumes that the header file is not empty after
# preprocessing, i.e. it does not only define preprocessor macros but also
# provides some type/enum definitions or function/variable declarations.
+#
+# This macro also checks whether each header exists, by invoking
+# AC_CHECK_HEADERS_ONCE or AC_CHECK_HEADERS on each argument.
AC_DEFUN([gl_CHECK_NEXT_HEADERS],
[
+ gl_NEXT_HEADERS_INTERNAL([$1], [check])
+])
+
+# gl_NEXT_HEADERS(HEADER1 HEADER2 ...)
+# ------------------------------------
+# Like gl_CHECK_NEXT_HEADERS, except do not check whether the headers exist.
+# This is suitable for headers like <stddef.h> that are standardized by C89
+# and therefore can be assumed to exist.
+AC_DEFUN([gl_NEXT_HEADERS],
+[
+ gl_NEXT_HEADERS_INTERNAL([$1], [assume])
+])
+
+# The guts of gl_CHECK_NEXT_HEADERS and gl_NEXT_HEADERS.
+AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
+[
AC_REQUIRE([gl_INCLUDE_NEXT])
AC_REQUIRE([AC_CANONICAL_HOST])
- AC_CHECK_HEADERS_ONCE([$1])
+
+ m4_if([$2], [check],
+ [AC_CHECK_HEADERS_ONCE([$1])
+ ])
m4_foreach_w([gl_HEADER_NAME], [$1],
[AS_VAR_PUSHDEF([gl_next_header],
@@ -162,39 +184,44 @@ AC_DEFUN([gl_CHECK_NEXT_HEADERS],
AC_CACHE_CHECK(
[absolute name of <]m4_defn([gl_HEADER_NAME])[>],
m4_defn([gl_next_header]),
- [AS_VAR_PUSHDEF([gl_header_exists],
- [ac_cv_header_]m4_defn([gl_HEADER_NAME]))
- if test AS_VAR_GET(gl_header_exists) = yes; then
- AC_LANG_CONFTEST(
- [AC_LANG_SOURCE(
- [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
- )])
- dnl AIX "xlc -E" and "cc -E" omit #line directives for header files
- dnl that contain only a #include of other header files and no
- dnl non-comment tokens of their own. This leads to a failure to
- dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
- dnl and others. The workaround is to force preservation of comments
- dnl through option -C. This ensures all necessary #line directives
- dnl are present. GCC supports option -C as well.
- case "$host_os" in
- aix*) gl_absname_cpp="$ac_cpp -C" ;;
- *) gl_absname_cpp="$ac_cpp" ;;
- esac
- dnl eval is necessary to expand gl_absname_cpp.
- dnl Ultrix and Pyramid sh refuse to redirect output of eval,
- dnl so use subshell.
- AS_VAR_SET([gl_next_header],
- ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
- sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
- s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
- s#^/[^/]#//&#
- p
- q
- }'`'"'])
- else
- AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
- fi
- AS_VAR_POPDEF([gl_header_exists])])
+ [m4_if([$2], [check],
+ [AS_VAR_PUSHDEF([gl_header_exists],
+ [ac_cv_header_]m4_defn([gl_HEADER_NAME]))
+ if test AS_VAR_GET(gl_header_exists) = yes; then
+ AS_VAR_POPDEF([gl_header_exists])
+ ])
+ AC_LANG_CONFTEST(
+ [AC_LANG_SOURCE(
+ [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
+ )])
+ dnl AIX "xlc -E" and "cc -E" omit #line directives for header
+ dnl files that contain only a #include of other header files and
+ dnl no non-comment tokens of their own. This leads to a failure
+ dnl to detect the absolute name of <dirent.h>, <signal.h>,
+ dnl <poll.h> and others. The workaround is to force preservation
+ dnl of comments through option -C. This ensures all necessary
+ dnl #line directives are present. GCC supports option -C as well.
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+ dnl eval is necessary to expand gl_absname_cpp.
+ dnl Ultrix and Pyramid sh refuse to redirect output of eval,
+ dnl so use subshell.
+ AS_VAR_SET([gl_next_header],
+ ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+ sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
+ s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
+ s#^/[^/]#//&#
+ p
+ q
+ }'`'"'])
+ m4_if([$2], [check],
+ [else
+ AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+ fi
+ ])
+ ])
fi
AC_SUBST(
AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
diff --git a/lib/gl/m4/intdiv0.m4 b/lib/gl/m4/intdiv0.m4
index 562882defe..58e8a732bb 100644
--- a/lib/gl/m4/intdiv0.m4
+++ b/lib/gl/m4/intdiv0.m4
@@ -1,5 +1,5 @@
# intdiv0.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2002, 2007-2008, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2007-2008, 2010-2011 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.
diff --git a/lib/gl/m4/intl.m4 b/lib/gl/m4/intl.m4
index d84bc4a9b4..96031eb952 100644
--- a/lib/gl/m4/intl.m4
+++ b/lib/gl/m4/intl.m4
@@ -1,5 +1,5 @@
# intl.m4 serial 17b
-dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 1995-2011 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.
diff --git a/lib/gl/m4/intldir.m4 b/lib/gl/m4/intldir.m4
index ebae76d361..31507d1520 100644
--- a/lib/gl/m4/intldir.m4
+++ b/lib/gl/m4/intldir.m4
@@ -1,5 +1,5 @@
# intldir.m4 serial 2 (gettext-0.18)
-dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2009-2011 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.
diff --git a/lib/gl/m4/intlmacosx.m4 b/lib/gl/m4/intlmacosx.m4
index f0f7c98726..51f8547771 100644
--- a/lib/gl/m4/intlmacosx.m4
+++ b/lib/gl/m4/intlmacosx.m4
@@ -1,5 +1,5 @@
# intlmacosx.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2004-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2011 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.
diff --git a/lib/gl/m4/intmax.m4 b/lib/gl/m4/intmax.m4
index 2c0f2afe59..9d28921d66 100644
--- a/lib/gl/m4/intmax.m4
+++ b/lib/gl/m4/intmax.m4
@@ -1,5 +1,5 @@
# intmax.m4 serial 6 (gettext-0.18.2)
-dnl Copyright (C) 2002-2005, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2005, 2008-2011 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.
diff --git a/lib/gl/m4/intmax_t.m4 b/lib/gl/m4/intmax_t.m4
index 493e4a9328..7341054b6f 100644
--- a/lib/gl/m4/intmax_t.m4
+++ b/lib/gl/m4/intmax_t.m4
@@ -1,5 +1,5 @@
# intmax_t.m4 serial 8
-dnl Copyright (C) 1997-2004, 2006-2007, 2009-2010 Free Software Foundation,
+dnl Copyright (C) 1997-2004, 2006-2007, 2009-2011 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/lib/gl/m4/inttypes-pri.m4 b/lib/gl/m4/inttypes-pri.m4
index ee96bcd978..e252b27e8c 100644
--- a/lib/gl/m4/inttypes-pri.m4
+++ b/lib/gl/m4/inttypes-pri.m4
@@ -1,5 +1,5 @@
# inttypes-pri.m4 serial 7 (gettext-0.18.2)
-dnl Copyright (C) 1997-2002, 2006, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2002, 2006, 2008-2011 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.
diff --git a/lib/gl/m4/inttypes_h.m4 b/lib/gl/m4/inttypes_h.m4
index 9d8f926926..f10fd54f63 100644
--- a/lib/gl/m4/inttypes_h.m4
+++ b/lib/gl/m4/inttypes_h.m4
@@ -1,5 +1,5 @@
# inttypes_h.m4 serial 10
-dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2011 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.
diff --git a/lib/gl/m4/lcmessage.m4 b/lib/gl/m4/lcmessage.m4
index 232da73b69..baf41c5fda 100644
--- a/lib/gl/m4/lcmessage.m4
+++ b/lib/gl/m4/lcmessage.m4
@@ -1,5 +1,5 @@
# lcmessage.m4 serial 7 (gettext-0.18.2)
-dnl Copyright (C) 1995-2002, 2004-2005, 2008-2010 Free Software Foundation,
+dnl Copyright (C) 1995-2002, 2004-2005, 2008-2011 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/lib/gl/m4/ld-output-def.m4 b/lib/gl/m4/ld-output-def.m4
index 2dc6bf5205..2169f51510 100644
--- a/lib/gl/m4/ld-output-def.m4
+++ b/lib/gl/m4/ld-output-def.m4
@@ -1,5 +1,5 @@
# ld-output-def.m4 serial 2
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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.
diff --git a/lib/gl/m4/ld-version-script.m4 b/lib/gl/m4/ld-version-script.m4
index 8fd8c8995c..aec2f41c1e 100644
--- a/lib/gl/m4/ld-version-script.m4
+++ b/lib/gl/m4/ld-version-script.m4
@@ -1,5 +1,5 @@
# ld-version-script.m4 serial 2
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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.
diff --git a/lib/gl/m4/lib-ld.m4 b/lib/gl/m4/lib-ld.m4
index 294db72e13..ae003f7c59 100644
--- a/lib/gl/m4/lib-ld.m4
+++ b/lib/gl/m4/lib-ld.m4
@@ -1,5 +1,5 @@
# lib-ld.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 1996-2003, 2009-2011 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.
diff --git a/lib/gl/m4/lib-link.m4 b/lib/gl/m4/lib-link.m4
index 2ea9d6d073..e7c9ba9d3d 100644
--- a/lib/gl/m4/lib-link.m4
+++ b/lib/gl/m4/lib-link.m4
@@ -1,5 +1,5 @@
-# lib-link.m4 serial 25 (gettext-0.18.2)
-dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
+# lib-link.m4 serial 26 (gettext-0.18.2)
+dnl Copyright (C) 2001-2011 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.
@@ -116,6 +116,8 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
dnl Determine the platform dependent parameters needed to use rpath:
dnl acl_libext,
dnl acl_shlibext,
+dnl acl_libname_spec,
+dnl acl_library_names_spec,
dnl acl_hardcode_libdir_flag_spec,
dnl acl_hardcode_libdir_separator,
dnl acl_hardcode_direct,
diff --git a/lib/gl/m4/lib-prefix.m4 b/lib/gl/m4/lib-prefix.m4
index 1601ceaefd..7e5f0bde03 100644
--- a/lib/gl/m4/lib-prefix.m4
+++ b/lib/gl/m4/lib-prefix.m4
@@ -1,5 +1,5 @@
# lib-prefix.m4 serial 7 (gettext-0.18)
-dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2005, 2008-2011 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.
diff --git a/lib/gl/m4/lock.m4 b/lib/gl/m4/lock.m4
index f71c66459e..96869454ca 100644
--- a/lib/gl/m4/lock.m4
+++ b/lib/gl/m4/lock.m4
@@ -1,5 +1,5 @@
# lock.m4 serial 11 (gettext-0.18.2)
-dnl Copyright (C) 2005-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2011 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.
diff --git a/lib/gl/m4/longlong.m4 b/lib/gl/m4/longlong.m4
index cca3c1a90f..aed816cfa5 100644
--- a/lib/gl/m4/longlong.m4
+++ b/lib/gl/m4/longlong.m4
@@ -1,5 +1,5 @@
-# longlong.m4 serial 14
-dnl Copyright (C) 1999-2007, 2009-2010 Free Software Foundation, Inc.
+# longlong.m4 serial 16
+dnl Copyright (C) 1999-2007, 2009-2011 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.
@@ -7,8 +7,8 @@ dnl with or without modifications, as long as this notice is preserved.
dnl From Paul Eggert.
# Define HAVE_LONG_LONG_INT if 'long long int' works.
-# This fixes a bug in Autoconf 2.61, but can be removed once we
-# assume 2.62 everywhere.
+# This fixes a bug in Autoconf 2.61, and can be faster
+# than what's in Autoconf 2.62 through 2.68.
# Note: If the type 'long long int' exists but is only 32 bits large
# (as on some very old compilers), HAVE_LONG_LONG_INT will not be
@@ -16,35 +16,39 @@ dnl From Paul Eggert.
AC_DEFUN([AC_TYPE_LONG_LONG_INT],
[
+ AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
- [AC_LINK_IFELSE(
- [_AC_TYPE_LONG_LONG_SNIPPET],
- [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
- dnl If cross compiling, assume the bug isn't important, since
- dnl nobody cross compiles for this platform as far as we know.
- AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[@%:@include <limits.h>
- @%:@ifndef LLONG_MAX
- @%:@ define HALF \
- (1LL << (sizeof (long long int) * CHAR_BIT - 2))
- @%:@ define LLONG_MAX (HALF - 1 + HALF)
- @%:@endif]],
- [[long long int n = 1;
- int i;
- for (i = 0; ; i++)
- {
- long long int m = n << i;
- if (m >> i != n)
- return 1;
- if (LLONG_MAX / 2 < m)
- break;
- }
- return 0;]])],
- [ac_cv_type_long_long_int=yes],
- [ac_cv_type_long_long_int=no],
- [ac_cv_type_long_long_int=yes])],
- [ac_cv_type_long_long_int=no])])
+ [ac_cv_type_long_long_int=yes
+ if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+ ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
+ if test $ac_cv_type_long_long_int = yes; then
+ dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
+ dnl If cross compiling, assume the bug is not important, since
+ dnl nobody cross compiles for this platform as far as we know.
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[@%:@include <limits.h>
+ @%:@ifndef LLONG_MAX
+ @%:@ define HALF \
+ (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+ @%:@ define LLONG_MAX (HALF - 1 + HALF)
+ @%:@endif]],
+ [[long long int n = 1;
+ int i;
+ for (i = 0; ; i++)
+ {
+ long long int m = n << i;
+ if (m >> i != n)
+ return 1;
+ if (LLONG_MAX / 2 < m)
+ break;
+ }
+ return 0;]])],
+ [],
+ [ac_cv_type_long_long_int=no],
+ [:])
+ fi
+ fi])
if test $ac_cv_type_long_long_int = yes; then
AC_DEFINE([HAVE_LONG_LONG_INT], [1],
[Define to 1 if the system has the type `long long int'.])
@@ -52,8 +56,8 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT],
])
# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
-# This fixes a bug in Autoconf 2.61, but can be removed once we
-# assume 2.62 everywhere.
+# This fixes a bug in Autoconf 2.61, and can be faster
+# than what's in Autoconf 2.62 through 2.68.
# Note: If the type 'unsigned long long int' exists but is only 32 bits
# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
@@ -64,10 +68,13 @@ AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
[
AC_CACHE_CHECK([for unsigned long long int],
[ac_cv_type_unsigned_long_long_int],
- [AC_LINK_IFELSE(
- [_AC_TYPE_LONG_LONG_SNIPPET],
- [ac_cv_type_unsigned_long_long_int=yes],
- [ac_cv_type_unsigned_long_long_int=no])])
+ [ac_cv_type_unsigned_long_long_int=yes
+ if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+ AC_LINK_IFELSE(
+ [_AC_TYPE_LONG_LONG_SNIPPET],
+ [],
+ [ac_cv_type_unsigned_long_long_int=no])
+ fi])
if test $ac_cv_type_unsigned_long_long_int = yes; then
AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
[Define to 1 if the system has the type `unsigned long long int'.])
diff --git a/lib/gl/m4/lseek.m4 b/lib/gl/m4/lseek.m4
index b0612c7e17..f6452f6f20 100644
--- a/lib/gl/m4/lseek.m4
+++ b/lib/gl/m4/lseek.m4
@@ -1,5 +1,5 @@
# lseek.m4 serial 6
-dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2011 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.
diff --git a/lib/gl/m4/malloc.m4 b/lib/gl/m4/malloc.m4
index 7a749254a1..8094444507 100644
--- a/lib/gl/m4/malloc.m4
+++ b/lib/gl/m4/malloc.m4
@@ -1,5 +1,5 @@
# malloc.m4 serial 12
-dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2011 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.
diff --git a/lib/gl/m4/memchr.m4 b/lib/gl/m4/memchr.m4
index 46db9fb654..3c2b313916 100644
--- a/lib/gl/m4/memchr.m4
+++ b/lib/gl/m4/memchr.m4
@@ -1,5 +1,5 @@
# memchr.m4 serial 10
-dnl Copyright (C) 2002-2004, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2009-2011 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.
diff --git a/lib/gl/m4/memmem.m4 b/lib/gl/m4/memmem.m4
index 7df132e102..dae71a968c 100644
--- a/lib/gl/m4/memmem.m4
+++ b/lib/gl/m4/memmem.m4
@@ -1,11 +1,10 @@
-# memmem.m4 serial 20
-dnl Copyright (C) 2002, 2003, 2004, 2007, 2008, 2009, 2010 Free Software
-dnl Foundation, Inc.
+# memmem.m4 serial 22
+dnl Copyright (C) 2002-2004, 2007-2011 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.
-dnl Check that memmem is present.
+dnl Check that memmem is present and functional.
AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE],
[
dnl Persuade glibc <string.h> to declare memmem().
@@ -18,6 +17,7 @@ AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE],
HAVE_DECL_MEMMEM=0
else
dnl Detect http://sourceware.org/bugzilla/show_bug.cgi?id=12092.
+ dnl Also check that we handle empty needles correctly.
AC_CACHE_CHECK([whether memmem works],
[gl_cv_func_memmem_works_always],
[AC_RUN_IFELSE([AC_LANG_PROGRAM([[
@@ -25,18 +25,32 @@ AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE],
#define P "_EF_BF_BD"
#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
#define NEEDLE P P P P P
-]], [[return !!memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE));
+]], [[
+ int result = 0;
+ if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE)))
+ result |= 1;
+ /* Check for empty needle behavior. */
+ {
+ const char *haystack = "AAA";
+ if (memmem (haystack, 3, NULL, 0) != haystack)
+ result |= 2;
+ }
+ return result;
]])],
[gl_cv_func_memmem_works_always=yes],
[gl_cv_func_memmem_works_always=no],
- [dnl glibc 2.12 and cygwin 1.7.7 have a known bug. Assume that it
- dnl works on all other platforms, even if it is not linear.
+ [dnl glibc 2.9..2.12 and cygwin 1.7.7 have issue #12092 above.
+ dnl Also empty needles work on glibc >= 2.1 and cygwin >= 1.7.0.
+ dnl uClibc is not affected, since it uses different source code.
+ dnl Assume that it works on all other platforms (even if not linear).
AC_EGREP_CPP([Lucky user],
[
#ifdef __GNU_LIBRARY__
#include <features.h>
- #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
- && !defined __UCLIBC__
+ #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \
+ || __GLIBC_MINOR__ > 12)) \
+ || (__GLIBC__ > 2)) \
+ || defined __UCLIBC__
Lucky user
#endif
#elif defined __CYGWIN__
@@ -60,7 +74,7 @@ AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE],
gl_PREREQ_MEMMEM
]) # gl_FUNC_MEMMEM_SIMPLE
-dnl Additionally, check that memmem is efficient and handles empty needles.
+dnl Additionally, check that memmem has linear performance characteristics
AC_DEFUN([gl_FUNC_MEMMEM],
[
AC_REQUIRE([gl_FUNC_MEMMEM_SIMPLE])
@@ -92,26 +106,23 @@ static void quit (int sig) { exit (sig + 128); }
if (!memmem (haystack, 2 * m + 1, needle, m + 1))
result |= 1;
}
- /* Check for empty needle behavior. */
- if (!memmem ("a", 1, 0, 0))
- result |= 2;
return result;
]])],
[gl_cv_func_memmem_works_fast=yes], [gl_cv_func_memmem_works_fast=no],
- [dnl Only glibc > 2.12 and cygwin > 1.7.7 are known to have a
- dnl bug-free memmem that works in linear time.
+ [dnl Only glibc >= 2.9 and cygwin > 1.7.0 are known to have a
+ dnl memmem that works in linear time.
AC_EGREP_CPP([Lucky user],
[
#include <features.h>
#ifdef __GNU_LIBRARY__
- #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9) || (__GLIBC__ > 2)) \
&& !defined __UCLIBC__
Lucky user
#endif
#endif
#ifdef __CYGWIN__
#include <cygwin/version.h>
- #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
+ #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 0)
Lucky user
#endif
#endif
diff --git a/lib/gl/m4/minmax.m4 b/lib/gl/m4/minmax.m4
index a5c42dea0f..beb9cb1782 100644
--- a/lib/gl/m4/minmax.m4
+++ b/lib/gl/m4/minmax.m4
@@ -1,5 +1,5 @@
# minmax.m4 serial 4
-dnl Copyright (C) 2005, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2009-2011 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.
diff --git a/lib/gl/m4/mmap-anon.m4 b/lib/gl/m4/mmap-anon.m4
index e20fc3c670..7ba7fd26b6 100644
--- a/lib/gl/m4/mmap-anon.m4
+++ b/lib/gl/m4/mmap-anon.m4
@@ -1,5 +1,5 @@
# mmap-anon.m4 serial 9
-dnl Copyright (C) 2005, 2007, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2007, 2009-2011 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.
diff --git a/lib/gl/m4/multiarch.m4 b/lib/gl/m4/multiarch.m4
index 389bd2bbaa..691d89270b 100644
--- a/lib/gl/m4/multiarch.m4
+++ b/lib/gl/m4/multiarch.m4
@@ -1,5 +1,5 @@
-# multiarch.m4 serial 5
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+# multiarch.m4 serial 6
+dnl Copyright (C) 2008-2011 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.
@@ -16,8 +16,7 @@ dnl with or without modifications, as long as this notice is preserved.
# CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
# CPP="gcc -E" CXXCPP="g++ -E"
#
-# Detect this situation and set the macro AA_APPLE_UNIVERSAL_BUILD at the
-# beginning of config.h and set APPLE_UNIVERSAL_BUILD accordingly.
+# Detect this situation and set APPLE_UNIVERSAL_BUILD accordingly.
AC_DEFUN_ONCE([gl_MULTIARCH],
[
@@ -55,8 +54,6 @@ AC_DEFUN_ONCE([gl_MULTIARCH],
done
])
if test $gl_cv_c_multiarch = yes; then
- AC_DEFINE([AA_APPLE_UNIVERSAL_BUILD], [1],
- [Define if the compiler is building for multiple architectures of Apple platforms at once.])
APPLE_UNIVERSAL_BUILD=1
else
APPLE_UNIVERSAL_BUILD=0
diff --git a/lib/gl/m4/netdb_h.m4 b/lib/gl/m4/netdb_h.m4
index c870fb61b9..9a01cd6a76 100644
--- a/lib/gl/m4/netdb_h.m4
+++ b/lib/gl/m4/netdb_h.m4
@@ -1,5 +1,5 @@
-# netdb_h.m4 serial 9
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+# netdb_h.m4 serial 10
+dnl Copyright (C) 2008-2011 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.
@@ -7,7 +7,6 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_HEADER_NETDB],
[
AC_REQUIRE([gl_NETDB_H_DEFAULTS])
- AC_CHECK_HEADERS_ONCE([netdb.h])
gl_CHECK_NEXT_HEADERS([netdb.h])
if test $ac_cv_header_netdb_h = yes; then
HAVE_NETDB_H=1
diff --git a/lib/gl/m4/nls.m4 b/lib/gl/m4/nls.m4
index 003704c4b9..6a21216d22 100644
--- a/lib/gl/m4/nls.m4
+++ b/lib/gl/m4/nls.m4
@@ -1,5 +1,5 @@
# nls.m4 serial 5 (gettext-0.18)
-dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
+dnl Copyright (C) 1995-2003, 2005-2006, 2008-2011 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/lib/gl/m4/po.m4 b/lib/gl/m4/po.m4
index 47f36a41a0..a3e99d6e72 100644
--- a/lib/gl/m4/po.m4
+++ b/lib/gl/m4/po.m4
@@ -1,5 +1,5 @@
# po.m4 serial 17 (gettext-0.18)
-dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 1995-2011 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.
diff --git a/lib/gl/m4/printf-posix.m4 b/lib/gl/m4/printf-posix.m4
index 2dc52a4862..a9b91f7005 100644
--- a/lib/gl/m4/printf-posix.m4
+++ b/lib/gl/m4/printf-posix.m4
@@ -1,5 +1,5 @@
# printf-posix.m4 serial 6 (gettext-0.18.2)
-dnl Copyright (C) 2003, 2007, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007, 2009-2011 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.
diff --git a/lib/gl/m4/printf.m4 b/lib/gl/m4/printf.m4
index 6d1cbfe209..9c2ed1ef2f 100644
--- a/lib/gl/m4/printf.m4
+++ b/lib/gl/m4/printf.m4
@@ -1,5 +1,5 @@
-# printf.m4 serial 40
-dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
+# printf.m4 serial 42
+dnl Copyright (C) 2003, 2007-2011 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.
@@ -71,8 +71,8 @@ changequote(,)dnl
gl_cv_func_printf_sizes_c99="guessing no";;
openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
# Guess yes on Solaris >= 2.10.
- solaris2.[0-9]*) gl_cv_func_printf_sizes_c99="guessing no";;
- solaris*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ solaris*) gl_cv_func_printf_sizes_c99="guessing no";;
# Guess yes on NetBSD >= 3.
netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
gl_cv_func_printf_sizes_c99="guessing no";;
@@ -591,8 +591,8 @@ changequote(,)dnl
darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";;
darwin*) gl_cv_func_printf_directive_f="guessing yes";;
# Guess yes on Solaris >= 2.10.
- solaris2.[0-9]*) gl_cv_func_printf_directive_f="guessing no";;
- solaris*) gl_cv_func_printf_directive_f="guessing yes";;
+ solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ solaris*) gl_cv_func_printf_sizes_c99="guessing no";;
# If we don't know, assume the worst.
*) gl_cv_func_printf_directive_f="guessing no";;
esac
@@ -890,8 +890,9 @@ changequote([,])dnl
dnl Test whether the *printf family of functions supports large precisions.
dnl On mingw, precisions larger than 512 are treated like 512, in integer,
dnl floating-point or pointer output. On Solaris 10/x86, precisions larger
-dnl than 510 in floating-point output crash the program. On BeOS, precisions
-dnl larger than 1044 crash the program.
+dnl than 510 in floating-point output crash the program. On Solaris 10/SPARC,
+dnl precisions larger than 510 in floating-point output yield wrong results.
+dnl On BeOS, precisions larger than 1044 crash the program.
dnl Result is gl_cv_func_printf_precision.
AC_DEFUN([gl_PRINTF_PRECISION],
@@ -917,6 +918,9 @@ int main ()
result |= 1;
if (sprintf (buf, "%.4000f %d", 1.0, 33, 44) < 4000 + 5)
result |= 2;
+ if (sprintf (buf, "%.511f %d", 1.0, 33, 44) < 511 + 5
+ || buf[0] != '1')
+ result |= 4;
return result;
}]])],
[gl_cv_func_printf_precision=yes],
@@ -1102,7 +1106,8 @@ changequote(,)dnl
gl_cv_func_snprintf_truncation_c99="guessing no";;
openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
# Guess yes on Solaris >= 2.6.
- solaris2.[0-5]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ solaris2.[0-5] | solaris2.[0-5].*)
+ gl_cv_func_snprintf_truncation_c99="guessing no";;
solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
# Guess yes on AIX >= 4.
aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
@@ -1161,6 +1166,10 @@ int main ()
strcpy (buf, "ABCDEF");
if (snprintf (buf, 3, "%d %d", 4567, 89) != 7)
return 1;
+ if (snprintf (buf, 0, "%d %d", 4567, 89) != 7)
+ return 2;
+ if (snprintf (NULL, 0, "%d %d", 4567, 89) != 7)
+ return 3;
return 0;
}]])],
[gl_cv_func_snprintf_retval_c99=yes],
@@ -1180,9 +1189,9 @@ changequote(,)dnl
openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
gl_cv_func_snprintf_retval_c99="guessing no";;
openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
- # Guess yes on Solaris >= 2.6.
- solaris2.[0-5]*) gl_cv_func_snprintf_retval_c99="guessing no";;
- solaris*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on Solaris >= 2.10.
+ solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ solaris*) gl_cv_func_printf_sizes_c99="guessing no";;
# Guess yes on AIX >= 4.
aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";;
aix*) gl_cv_func_snprintf_retval_c99="guessing yes";;
@@ -1243,7 +1252,8 @@ changequote(,)dnl
darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";;
darwin*) gl_cv_func_snprintf_directive_n="guessing yes";;
# Guess yes on Solaris >= 2.6.
- solaris2.[0-5]*) gl_cv_func_snprintf_directive_n="guessing no";;
+ solaris2.[0-5] | solaris2.[0-5].*)
+ gl_cv_func_snprintf_directive_n="guessing no";;
solaris*) gl_cv_func_snprintf_directive_n="guessing yes";;
# Guess yes on AIX >= 4.
aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";;
@@ -1371,7 +1381,8 @@ changequote(,)dnl
# Guess yes on Cygwin.
cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
# Guess yes on Solaris >= 2.6.
- solaris2.[0-5]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+ solaris2.[0-5] | solaris2.[0-5].*)
+ gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
# Guess yes on AIX >= 4.
aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
@@ -1452,10 +1463,10 @@ dnl Cygwin 1.5.25 (2008) . . . # # . . # . . . . . # .
dnl Cygwin 1.5.19 (2006) # . . # # # . # . # . # # # . . . . . .
dnl Solaris 11 2010-11 . . # # # . . # . . . # . . . . . . . .
dnl Solaris 10 . . # # # . . # . . . # # . . . . . . .
-dnl Solaris 2.6 ... 9 # . # # # # . # . . . # . . . . . . . .
+dnl Solaris 2.6 ... 9 # . # # # # . # . . . # # . . . # . . .
dnl Solaris 2.5.1 # . # # # # . # . . . # . . # # # # # #
dnl AIX 5.2, 7.1 . . # # # . . . . . . # . . . . . . . .
-dnl AIX 4.3.2, 5.1 # . # # # # . . . . . # . . . . . . . .
+dnl AIX 4.3.2, 5.1 # . # # # # . . . . . # . . . . # . . .
dnl HP-UX 11.31 . . . . # . . . . . . # . . . . # # . .
dnl HP-UX 11.{00,11,23} # . . . # # . . . . . # . . . . # # . #
dnl HP-UX 10.20 # . # . # # . ? . . # # . . . . # # ? #
@@ -1465,6 +1476,6 @@ dnl OSF/1 4.0d # . # # # # . . . . . # . . #
dnl NetBSD 5.0 . . . # # . . . . . . # . # . . . . . .
dnl NetBSD 4.0 . ? ? ? ? ? . ? . ? ? ? ? ? . . . ? ? ?
dnl NetBSD 3.0 . . . . # # . ? # # ? # . # . . . . . .
-dnl Haiku . . . # # # . # . . . . . ? . . . . . .
-dnl BeOS # # . # # # . ? # . ? . # ? . . . . . .
+dnl Haiku . . . # # # . # . . . . . ? . . ? . . .
+dnl BeOS # # . # # # . ? # . ? . # ? . . ? . . .
dnl mingw # # # # # # . . # # . # # ? . # # # . .
diff --git a/lib/gl/m4/progtest.m4 b/lib/gl/m4/progtest.m4
index 9ffa5c0202..5130d56a7b 100644
--- a/lib/gl/m4/progtest.m4
+++ b/lib/gl/m4/progtest.m4
@@ -1,5 +1,5 @@
# progtest.m4 serial 7 (gettext-0.18.2)
-dnl Copyright (C) 1996-2003, 2005, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 1996-2003, 2005, 2008-2011 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.
diff --git a/lib/gl/m4/read-file.m4 b/lib/gl/m4/read-file.m4
index 35a3a4817f..60d03600a8 100644
--- a/lib/gl/m4/read-file.m4
+++ b/lib/gl/m4/read-file.m4
@@ -1,6 +1,5 @@
# read-file.m4 serial 2
-dnl Copyright (C) 2002, 2003, 2004, 2005, 2006, 2009, 2010 Free Software
-dnl Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2011 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.
diff --git a/lib/gl/m4/realloc.m4 b/lib/gl/m4/realloc.m4
index 01c1234f7e..a403d9fb32 100644
--- a/lib/gl/m4/realloc.m4
+++ b/lib/gl/m4/realloc.m4
@@ -1,5 +1,5 @@
# realloc.m4 serial 11
-dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2011 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.
diff --git a/lib/gl/m4/size_max.m4 b/lib/gl/m4/size_max.m4
index f3b1a9dfb2..e8070981a8 100644
--- a/lib/gl/m4/size_max.m4
+++ b/lib/gl/m4/size_max.m4
@@ -1,5 +1,5 @@
# size_max.m4 serial 10
-dnl Copyright (C) 2003, 2005-2006, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2006, 2008-2011 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.
diff --git a/lib/gl/m4/snprintf.m4 b/lib/gl/m4/snprintf.m4
index 522b107b12..8aa5dbe598 100644
--- a/lib/gl/m4/snprintf.m4
+++ b/lib/gl/m4/snprintf.m4
@@ -1,5 +1,5 @@
# snprintf.m4 serial 5
-dnl Copyright (C) 2002-2004, 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2007-2011 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.
@@ -13,7 +13,12 @@ AC_DEFUN([gl_FUNC_SNPRINTF],
gl_SNPRINTF_SIZE1
case "$gl_cv_func_snprintf_size1" in
*yes)
- gl_cv_func_snprintf_usable=yes
+ gl_SNPRINTF_RETVAL_C99
+ case "$gl_cv_func_snprintf_retval_c99" in
+ *yes)
+ gl_cv_func_snprintf_usable=yes
+ ;;
+ esac
;;
esac
fi
diff --git a/lib/gl/m4/socketlib.m4 b/lib/gl/m4/socketlib.m4
index 7bf02b5aee..2aa972dd88 100644
--- a/lib/gl/m4/socketlib.m4
+++ b/lib/gl/m4/socketlib.m4
@@ -1,5 +1,5 @@
# socketlib.m4 serial 1
-dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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.
diff --git a/lib/gl/m4/sockets.m4 b/lib/gl/m4/sockets.m4
index ba9a563d8e..cbe754f8d5 100644
--- a/lib/gl/m4/sockets.m4
+++ b/lib/gl/m4/sockets.m4
@@ -1,5 +1,5 @@
# sockets.m4 serial 7
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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.
diff --git a/lib/gl/m4/socklen.m4 b/lib/gl/m4/socklen.m4
index d0d6baab55..5e4c69ed79 100644
--- a/lib/gl/m4/socklen.m4
+++ b/lib/gl/m4/socklen.m4
@@ -1,5 +1,5 @@
# socklen.m4 serial 8
-dnl Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2007, 2009-2011 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.
diff --git a/lib/gl/m4/sockpfaf.m4 b/lib/gl/m4/sockpfaf.m4
index 8806705ae2..27899aa59b 100644
--- a/lib/gl/m4/sockpfaf.m4
+++ b/lib/gl/m4/sockpfaf.m4
@@ -1,5 +1,5 @@
# sockpfaf.m4 serial 7
-dnl Copyright (C) 2004, 2006, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2006, 2009-2011 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.
diff --git a/lib/gl/m4/stdbool.m4 b/lib/gl/m4/stdbool.m4
index 1efe59ea1c..838cf0f467 100644
--- a/lib/gl/m4/stdbool.m4
+++ b/lib/gl/m4/stdbool.m4
@@ -1,17 +1,17 @@
# Check for stdbool.h that conforms to C99.
-dnl Copyright (C) 2002-2006, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2011 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.
-#serial 3
+#serial 4
# Prepare for substituting <stdbool.h> if it is not supported.
AC_DEFUN([AM_STDBOOL_H],
[
- AC_REQUIRE([AC_HEADER_STDBOOL])
+ AC_REQUIRE([AC_CHECK_HEADER_STDBOOL])
# Define two additional variables used in the Makefile substitution.
@@ -33,11 +33,9 @@ AC_DEFUN([AM_STDBOOL_H],
# AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future.
AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H])
-# This version of the macro is needed in autoconf <= 2.67. Autoconf has
-# it built in since 2.60, but we want the tweaks from the 2.68 version
-# to avoid rejecting xlc and clang due to relying on extensions.
+# This version of the macro is needed in autoconf <= 2.68.
-AC_DEFUN([AC_HEADER_STDBOOL],
+AC_DEFUN([AC_CHECK_HEADER_STDBOOL],
[AC_CACHE_CHECK([for stdbool.h that conforms to C99],
[ac_cv_header_stdbool_h],
[AC_COMPILE_IFELSE(
@@ -98,6 +96,4 @@ AC_DEFUN([AC_HEADER_STDBOOL],
[ac_cv_header_stdbool_h=yes],
[ac_cv_header_stdbool_h=no])])
AC_CHECK_TYPES([_Bool])
- if test $ac_cv_header_stdbool_h = yes; then
- AC_DEFINE([HAVE_STDBOOL_H], [1], [Define to 1 if stdbool.h conforms to C99.])
- fi])
+])
diff --git a/lib/gl/m4/stddef_h.m4 b/lib/gl/m4/stddef_h.m4
index c3ae569431..1942b6aa0d 100644
--- a/lib/gl/m4/stddef_h.m4
+++ b/lib/gl/m4/stddef_h.m4
@@ -1,6 +1,6 @@
dnl A placeholder for POSIX 2008 <stddef.h>, for platforms that have issues.
-# stddef_h.m4 serial 2
-dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+# stddef_h.m4 serial 3
+dnl Copyright (C) 2009-2011 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.
@@ -25,7 +25,7 @@ AC_DEFUN([gl_STDDEF_H],
STDDEF_H=stddef.h
fi
if test -n "$STDDEF_H"; then
- gl_CHECK_NEXT_HEADERS([stddef.h])
+ gl_NEXT_HEADERS([stddef.h])
fi
])
diff --git a/lib/gl/m4/stdint.m4 b/lib/gl/m4/stdint.m4
index 7fe28362fc..e7d0d0765a 100644
--- a/lib/gl/m4/stdint.m4
+++ b/lib/gl/m4/stdint.m4
@@ -1,5 +1,5 @@
-# stdint.m4 serial 36
-dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
+# stdint.m4 serial 39
+dnl Copyright (C) 2001-2011 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.
@@ -27,6 +27,15 @@ AC_DEFUN([gl_STDINT_H],
fi
AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT])
+ dnl Check for <wchar.h>, in the same way as gl_WCHAR_H does.
+ AC_CHECK_HEADERS_ONCE([wchar.h])
+ if test $ac_cv_header_wchar_h = yes; then
+ HAVE_WCHAR_H=1
+ else
+ HAVE_WCHAR_H=0
+ fi
+ AC_SUBST([HAVE_WCHAR_H])
+
dnl Check for <inttypes.h>.
dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h.
if test $ac_cv_header_inttypes_h = yes; then
@@ -145,9 +154,11 @@ uintmax_t j = UINTMAX_MAX;
#include <limits.h> /* for CHAR_BIT */
#define TYPE_MINIMUM(t) \
- ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
+ ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
#define TYPE_MAXIMUM(t) \
- ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
+ ((t) ((t) 0 < (t) -1 \
+ ? (t) -1 \
+ : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
struct s {
int check_PTRDIFF:
PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
@@ -290,10 +301,6 @@ static const char *macro_values[] =
fi
AC_SUBST([HAVE_SYS_BITYPES_H])
- dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
- dnl character support).
- AC_CHECK_HEADERS_ONCE([wchar.h])
-
gl_STDINT_TYPE_PROPERTIES
STDINT_H=stdint.h
fi
diff --git a/lib/gl/m4/stdint_h.m4 b/lib/gl/m4/stdint_h.m4
index 670c0cc2bf..356b14e120 100644
--- a/lib/gl/m4/stdint_h.m4
+++ b/lib/gl/m4/stdint_h.m4
@@ -1,5 +1,5 @@
# stdint_h.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2011 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.
diff --git a/lib/gl/m4/stdio_h.m4 b/lib/gl/m4/stdio_h.m4
index f5650cdeab..b6163d6806 100644
--- a/lib/gl/m4/stdio_h.m4
+++ b/lib/gl/m4/stdio_h.m4
@@ -1,5 +1,5 @@
-# stdio_h.m4 serial 31
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# stdio_h.m4 serial 32
+dnl Copyright (C) 2007-2011 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.
@@ -9,7 +9,7 @@ AC_DEFUN([gl_STDIO_H],
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
AC_REQUIRE([AC_C_INLINE])
AC_REQUIRE([gl_ASM_SYMBOL_PREFIX])
- gl_CHECK_NEXT_HEADERS([stdio.h])
+ gl_NEXT_HEADERS([stdio.h])
dnl No need to create extra modules for these functions. Everyone who uses
dnl <stdio.h> likely needs them.
GNULIB_FPRINTF=1
@@ -95,6 +95,8 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_DECL_FPURGE=1; AC_SUBST([HAVE_DECL_FPURGE])
+ HAVE_DECL_FSEEKO=1; AC_SUBST([HAVE_DECL_FSEEKO])
+ HAVE_DECL_FTELLO=1; AC_SUBST([HAVE_DECL_FTELLO])
HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM])
HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE])
HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF])
diff --git a/lib/gl/m4/stdlib_h.m4 b/lib/gl/m4/stdlib_h.m4
index e4697ce213..d28b552e90 100644
--- a/lib/gl/m4/stdlib_h.m4
+++ b/lib/gl/m4/stdlib_h.m4
@@ -1,5 +1,5 @@
-# stdlib_h.m4 serial 31
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# stdlib_h.m4 serial 36
+dnl Copyright (C) 2007-2011 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.
@@ -7,21 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_STDLIB_H],
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
- gl_CHECK_NEXT_HEADERS([stdlib.h])
- AC_CHECK_HEADERS([random.h], [], [], [AC_INCLUDES_DEFAULT])
- if test $ac_cv_header_random_h = yes; then
- HAVE_RANDOM_H=1
- else
- HAVE_RANDOM_H=0
- fi
- AC_SUBST([HAVE_RANDOM_H])
- AC_CHECK_TYPES([struct random_data],
- [], [HAVE_STRUCT_RANDOM_DATA=0],
- [[#include <stdlib.h>
- #if HAVE_RANDOM_H
- # include <random.h>
- #endif
- ]])
+ gl_NEXT_HEADERS([stdlib.h])
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use, and which is not
@@ -89,17 +75,19 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
HAVE_MKSTEMP=1; AC_SUBST([HAVE_MKSTEMP])
HAVE_MKSTEMPS=1; AC_SUBST([HAVE_MKSTEMPS])
HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME])
+ HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H])
HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R])
HAVE_REALPATH=1; AC_SUBST([HAVE_REALPATH])
HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH])
HAVE_SETENV=1; AC_SUBST([HAVE_SETENV])
+ HAVE_DECL_SETENV=1; AC_SUBST([HAVE_DECL_SETENV])
HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD])
HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL])
HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL])
HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA])
HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H])
HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT])
- HAVE_UNSETENV=1; AC_SUBST([HAVE_UNSETENV])
+ HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV])
REPLACE_CALLOC=0; AC_SUBST([REPLACE_CALLOC])
REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME])
REPLACE_MALLOC=0; AC_SUBST([REPLACE_MALLOC])
diff --git a/lib/gl/m4/strcase.m4 b/lib/gl/m4/strcase.m4
index 33de423a02..1c553ff210 100644
--- a/lib/gl/m4/strcase.m4
+++ b/lib/gl/m4/strcase.m4
@@ -1,5 +1,5 @@
# strcase.m4 serial 10
-dnl Copyright (C) 2002, 2005-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005-2011 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.
diff --git a/lib/gl/m4/string_h.m4 b/lib/gl/m4/string_h.m4
index 5844b2d660..30ddfbc3a4 100644
--- a/lib/gl/m4/string_h.m4
+++ b/lib/gl/m4/string_h.m4
@@ -1,11 +1,11 @@
# Configure a GNU-like replacement for <string.h>.
-# Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# Copyright (C) 2007-2011 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 18
+# serial 19
# Written by Paul Eggert.
@@ -20,7 +20,7 @@ AC_DEFUN([gl_HEADER_STRING_H_BODY],
[
AC_REQUIRE([AC_C_RESTRICT])
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
- gl_CHECK_NEXT_HEADERS([string.h])
+ gl_NEXT_HEADERS([string.h])
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use, and which is not
diff --git a/lib/gl/m4/strings_h.m4 b/lib/gl/m4/strings_h.m4
index 4374c7cbe3..71d284b633 100644
--- a/lib/gl/m4/strings_h.m4
+++ b/lib/gl/m4/strings_h.m4
@@ -1,7 +1,7 @@
# Configure a replacement for <string.h>.
# serial 3
-# Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/lib/gl/m4/strverscmp.m4 b/lib/gl/m4/strverscmp.m4
index 59e0950f18..5d1a9bab12 100644
--- a/lib/gl/m4/strverscmp.m4
+++ b/lib/gl/m4/strverscmp.m4
@@ -1,5 +1,5 @@
# strverscmp.m4 serial 7
-dnl Copyright (C) 2002, 2005-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005-2011 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.
diff --git a/lib/gl/m4/sys_socket_h.m4 b/lib/gl/m4/sys_socket_h.m4
index c7627cb94e..12dc05d42b 100644
--- a/lib/gl/m4/sys_socket_h.m4
+++ b/lib/gl/m4/sys_socket_h.m4
@@ -1,5 +1,5 @@
-# sys_socket_h.m4 serial 20
-dnl Copyright (C) 2005-2010 Free Software Foundation, Inc.
+# sys_socket_h.m4 serial 21
+dnl Copyright (C) 2005-2011 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.
@@ -9,8 +9,20 @@ dnl From Simon Josefsson.
AC_DEFUN([gl_HEADER_SYS_SOCKET],
[
AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_C_INLINE])
+ dnl On OSF/1, the functions recv(), send(), recvfrom(), sendto() have
+ dnl old-style declarations (with return type 'int' instead of 'ssize_t')
+ dnl unless _POSIX_PII_SOCKET is defined.
+ case "$host_os" in
+ osf*)
+ AC_DEFINE([_POSIX_PII_SOCKET], [1],
+ [Define to 1 in order to get the POSIX compatible declarations
+ of socket functions.])
+ ;;
+ esac
+
AC_CACHE_CHECK([whether <sys/socket.h> is self-contained],
[gl_cv_header_sys_socket_h_selfcontained],
[
diff --git a/lib/gl/m4/sys_stat_h.m4 b/lib/gl/m4/sys_stat_h.m4
index 7181c253b9..fc419129e9 100644
--- a/lib/gl/m4/sys_stat_h.m4
+++ b/lib/gl/m4/sys_stat_h.m4
@@ -1,5 +1,5 @@
# sys_stat_h.m4 serial 24 -*- Autoconf -*-
-dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2011 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.
diff --git a/lib/gl/m4/threadlib.m4 b/lib/gl/m4/threadlib.m4
index 423c17c768..8a621fd04d 100644
--- a/lib/gl/m4/threadlib.m4
+++ b/lib/gl/m4/threadlib.m4
@@ -1,5 +1,5 @@
# threadlib.m4 serial 8 (gettext-0.18.2)
-dnl Copyright (C) 2005-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2011 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.
diff --git a/lib/gl/m4/time_h.m4 b/lib/gl/m4/time_h.m4
index a45a10a9ee..615da1cfd3 100644
--- a/lib/gl/m4/time_h.m4
+++ b/lib/gl/m4/time_h.m4
@@ -1,8 +1,8 @@
# Configure a more-standard replacement for <time.h>.
-# Copyright (C) 2000-2001, 2003-2007, 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2011 Free Software Foundation, Inc.
-# serial 2
+# serial 4
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -21,7 +21,7 @@ AC_DEFUN([gl_HEADER_TIME_H_BODY],
[
AC_REQUIRE([AC_C_RESTRICT])
AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
- gl_CHECK_NEXT_HEADERS([time.h])
+ gl_NEXT_HEADERS([time.h])
AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
])
@@ -95,7 +95,7 @@ AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS],
GNULIB_TIMEGM=0; AC_SUBST([GNULIB_TIMEGM])
GNULIB_TIME_R=0; AC_SUBST([GNULIB_TIME_R])
dnl Assume proper GNU behavior unless another module says otherwise.
- HAVE_LOCALTIME_R=1; AC_SUBST([HAVE_LOCALTIME_R])
+ HAVE_DECL_LOCALTIME_R=1; AC_SUBST([HAVE_DECL_LOCALTIME_R])
HAVE_NANOSLEEP=1; AC_SUBST([HAVE_NANOSLEEP])
HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME])
HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM])
diff --git a/lib/gl/m4/time_r.m4 b/lib/gl/m4/time_r.m4
index 9e82d39ffb..9bb28005fc 100644
--- a/lib/gl/m4/time_r.m4
+++ b/lib/gl/m4/time_r.m4
@@ -1,6 +1,6 @@
dnl Reentrant time functions: localtime_r, gmtime_r.
-dnl Copyright (C) 2003, 2006-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2006-2011 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.
@@ -15,8 +15,16 @@ AC_DEFUN([gl_TIME_R],
AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
AC_REQUIRE([AC_C_RESTRICT])
+ dnl Some systems don't declare localtime_r() and gmtime_r() if _REENTRANT is
+ dnl not defined.
+ AC_CHECK_DECLS_ONCE([localtime_r])
+ if test $ac_cv_have_decl_localtime_r = no; then
+ HAVE_DECL_LOCALTIME_R=0
+ fi
+
AC_CHECK_FUNCS_ONCE([localtime_r])
if test $ac_cv_func_localtime_r = yes; then
+ HAVE_LOCALTIME_R=1
AC_CACHE_CHECK([whether localtime_r is compatible with its POSIX signature],
[gl_cv_time_r_posix],
[AC_COMPILE_IFELSE(
diff --git a/lib/gl/m4/uintmax_t.m4 b/lib/gl/m4/uintmax_t.m4
index 03b51bcfe3..c1f954ee7e 100644
--- a/lib/gl/m4/uintmax_t.m4
+++ b/lib/gl/m4/uintmax_t.m4
@@ -1,5 +1,5 @@
# uintmax_t.m4 serial 12
-dnl Copyright (C) 1997-2004, 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2007-2011 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.
diff --git a/lib/gl/m4/ungetc.m4 b/lib/gl/m4/ungetc.m4
index 68ccf88349..749f6bd5dc 100644
--- a/lib/gl/m4/ungetc.m4
+++ b/lib/gl/m4/ungetc.m4
@@ -1,5 +1,5 @@
# ungetc.m4 serial 2
-dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2011 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.
diff --git a/lib/gl/m4/unistd_h.m4 b/lib/gl/m4/unistd_h.m4
index e2f7f2bf45..c81a1138e9 100644
--- a/lib/gl/m4/unistd_h.m4
+++ b/lib/gl/m4/unistd_h.m4
@@ -1,5 +1,5 @@
-# unistd_h.m4 serial 48
-dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
+# unistd_h.m4 serial 53
+dnl Copyright (C) 2006-2011 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.
@@ -14,8 +14,6 @@ AC_DEFUN([gl_UNISTD_H],
AC_REQUIRE([AC_C_INLINE])
gl_CHECK_NEXT_HEADERS([unistd.h])
-
- AC_CHECK_HEADERS_ONCE([unistd.h])
if test $ac_cv_header_unistd_h = yes; then
HAVE_UNISTD_H=1
else
@@ -38,7 +36,7 @@ AC_DEFUN([gl_UNISTD_H],
]], [chown dup2 dup3 environ euidaccess faccessat fchdir fchownat
fsync ftruncate getcwd getdomainname getdtablesize getgroups
gethostname getlogin getlogin_r getpagesize getusershell setusershell
- endusershell lchown link linkat lseek pipe2 pread pwrite readlink
+ endusershell lchown link linkat lseek pipe pipe2 pread pwrite readlink
readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat
usleep])
])
@@ -78,6 +76,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
GNULIB_LINK=0; AC_SUBST([GNULIB_LINK])
GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT])
GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK])
+ GNULIB_PIPE=0; AC_SUBST([GNULIB_PIPE])
GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2])
GNULIB_PREAD=0; AC_SUBST([GNULIB_PREAD])
GNULIB_PWRITE=0; AC_SUBST([GNULIB_PWRITE])
@@ -112,6 +111,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN])
HAVE_LINK=1; AC_SUBST([HAVE_LINK])
HAVE_LINKAT=1; AC_SUBST([HAVE_LINKAT])
+ HAVE_PIPE=1; AC_SUBST([HAVE_PIPE])
HAVE_PIPE2=1; AC_SUBST([HAVE_PIPE2])
HAVE_PREAD=1; AC_SUBST([HAVE_PREAD])
HAVE_PWRITE=1; AC_SUBST([HAVE_PWRITE])
@@ -120,14 +120,15 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP])
HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK])
HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT])
- HAVE_TTYNAME_R=1; AC_SUBST([HAVE_TTYNAME_R])
HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT])
HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP])
HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON])
+ HAVE_DECL_FCHDIR=1; AC_SUBST([HAVE_DECL_FCHDIR])
HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME])
HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE])
HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL])
+ HAVE_DECL_TTYNAME_R=1; AC_SUBST([HAVE_DECL_TTYNAME_R])
HAVE_OS_H=0; AC_SUBST([HAVE_OS_H])
HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H])
REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN])
@@ -137,6 +138,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT])
REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD])
REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME])
+ REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R])
REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS])
REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE])
REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN])
diff --git a/lib/gl/m4/vasnprintf.m4 b/lib/gl/m4/vasnprintf.m4
index 9c04520242..32ea985b3f 100644
--- a/lib/gl/m4/vasnprintf.m4
+++ b/lib/gl/m4/vasnprintf.m4
@@ -1,5 +1,5 @@
# vasnprintf.m4 serial 32
-dnl Copyright (C) 2002-2004, 2006-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2006-2011 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.
diff --git a/lib/gl/m4/vasprintf.m4 b/lib/gl/m4/vasprintf.m4
index b142bc0ff1..6db52b18b1 100644
--- a/lib/gl/m4/vasprintf.m4
+++ b/lib/gl/m4/vasprintf.m4
@@ -1,5 +1,5 @@
# vasprintf.m4 serial 6
-dnl Copyright (C) 2002-2003, 2006-2007, 2009-2010 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2006-2007, 2009-2011 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/lib/gl/m4/visibility.m4 b/lib/gl/m4/visibility.m4
index 19cd8f3d3e..75c34b6e15 100644
--- a/lib/gl/m4/visibility.m4
+++ b/lib/gl/m4/visibility.m4
@@ -1,5 +1,5 @@
# visibility.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2005, 2008, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2008, 2010-2011 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.
diff --git a/lib/gl/m4/vsnprintf.m4 b/lib/gl/m4/vsnprintf.m4
index ed189c2388..e4725e453f 100644
--- a/lib/gl/m4/vsnprintf.m4
+++ b/lib/gl/m4/vsnprintf.m4
@@ -1,5 +1,5 @@
# vsnprintf.m4 serial 5
-dnl Copyright (C) 2002-2004, 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2007-2011 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.
@@ -13,7 +13,12 @@ AC_DEFUN([gl_FUNC_VSNPRINTF],
gl_SNPRINTF_SIZE1
case "$gl_cv_func_snprintf_size1" in
*yes)
- gl_cv_func_vsnprintf_usable=yes
+ gl_SNPRINTF_RETVAL_C99
+ case "$gl_cv_func_snprintf_retval_c99" in
+ *yes)
+ gl_cv_func_vsnprintf_usable=yes
+ ;;
+ esac
;;
esac
fi
diff --git a/lib/gl/m4/warn-on-use.m4 b/lib/gl/m4/warn-on-use.m4
index 42daae87b8..e0d0f27640 100644
--- a/lib/gl/m4/warn-on-use.m4
+++ b/lib/gl/m4/warn-on-use.m4
@@ -1,5 +1,5 @@
# warn-on-use.m4 serial 2
-dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2011 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.
diff --git a/lib/gl/m4/wchar_h.m4 b/lib/gl/m4/wchar_h.m4
deleted file mode 100644
index 8c8fad96df..0000000000
--- a/lib/gl/m4/wchar_h.m4
+++ /dev/null
@@ -1,154 +0,0 @@
-dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
-
-dnl Copyright (C) 2007-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.
-
-dnl Written by Eric Blake.
-
-# wchar_h.m4 serial 35
-
-AC_DEFUN([gl_WCHAR_H],
-[
- AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
- AC_REQUIRE([gl_WCHAR_H_INLINE_OK])
- dnl Prepare for creating substitute <wchar.h>.
- dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
- dnl character support).
- dnl <wchar.h> is always overridden, because of GNULIB_POSIXCHECK.
- AC_CHECK_HEADERS_ONCE([wchar.h])
- gl_CHECK_NEXT_HEADERS([wchar.h])
- if test $ac_cv_header_wchar_h = yes; then
- HAVE_WCHAR_H=1
- else
- HAVE_WCHAR_H=0
- fi
- AC_SUBST([HAVE_WCHAR_H])
-
- AC_REQUIRE([gl_FEATURES_H])
-
- AC_REQUIRE([gt_TYPE_WINT_T])
- if test $gt_cv_c_wint_t = yes; then
- HAVE_WINT_T=1
- else
- HAVE_WINT_T=0
- fi
- AC_SUBST([HAVE_WINT_T])
-
- dnl Check for declarations of anything we want to poison if the
- dnl corresponding gnulib module is not in use.
- gl_WARN_ON_USE_PREPARE([[
-/* Some systems require additional headers. */
-#if !(defined __GLIBC__ && !defined __UCLIBC__)
-# include <stddef.h>
-# include <stdio.h>
-# include <time.h>
-#endif
-#include <wchar.h>
- ]], [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb
- wcsrtombs wcsnrtombs wcwidth])
-])
-
-dnl Check whether <wchar.h> is usable at all.
-AC_DEFUN([gl_WCHAR_H_INLINE_OK],
-[
- dnl Test whether <wchar.h> suffers due to the transition from '__inline' to
- dnl 'gnu_inline'. See <http://sourceware.org/bugzilla/show_bug.cgi?id=4022>
- dnl and <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>. In summary,
- dnl glibc version 2.5 or older, together with gcc version 4.3 or newer and
- dnl the option -std=c99 or -std=gnu99, leads to a broken <wchar.h>.
- AC_CACHE_CHECK([whether <wchar.h> uses 'inline' correctly],
- [gl_cv_header_wchar_h_correct_inline],
- [gl_cv_header_wchar_h_correct_inline=yes
- AC_LANG_CONFTEST([
- AC_LANG_SOURCE([[#define wcstod renamed_wcstod
-#include <wchar.h>
-extern int zero (void);
-int main () { return zero(); }
-]])])
- if AC_TRY_EVAL([ac_compile]); then
- mv conftest.$ac_objext conftest1.$ac_objext
- AC_LANG_CONFTEST([
- AC_LANG_SOURCE([[#define wcstod renamed_wcstod
-#include <wchar.h>
-int zero (void) { return 0; }
-]])])
- if AC_TRY_EVAL([ac_compile]); then
- mv conftest.$ac_objext conftest2.$ac_objext
- if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then
- :
- else
- gl_cv_header_wchar_h_correct_inline=no
- fi
- fi
- fi
- rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext
- ])
- if test $gl_cv_header_wchar_h_correct_inline = no; then
- AC_MSG_ERROR([<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
-This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
-C99 mode. You have four options:
- - Add the flag -fgnu89-inline to CC and reconfigure, or
- - Fix your include files, using parts of
- <http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
- - Use a gcc version older than 4.3, or
- - Don't use the flags -std=c99 or -std=gnu99.
-Configuration aborted.])
- fi
-])
-
-dnl Unconditionally enables the replacement of <wchar.h>.
-AC_DEFUN([gl_REPLACE_WCHAR_H],
-[
- dnl This is a no-op, because <wchar.h> is always overridden.
- :
-])
-
-AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
-[
- dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
- AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
- gl_MODULE_INDICATOR_SET_VARIABLE([$1])
- dnl Define it also as a C macro, for the benefit of the unit tests.
- gl_MODULE_INDICATOR_FOR_TESTS([$1])
-])
-
-AC_DEFUN([gl_WCHAR_H_DEFAULTS],
-[
- GNULIB_BTOWC=0; AC_SUBST([GNULIB_BTOWC])
- GNULIB_WCTOB=0; AC_SUBST([GNULIB_WCTOB])
- GNULIB_MBSINIT=0; AC_SUBST([GNULIB_MBSINIT])
- GNULIB_MBRTOWC=0; AC_SUBST([GNULIB_MBRTOWC])
- GNULIB_MBRLEN=0; AC_SUBST([GNULIB_MBRLEN])
- GNULIB_MBSRTOWCS=0; AC_SUBST([GNULIB_MBSRTOWCS])
- GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS])
- GNULIB_WCRTOMB=0; AC_SUBST([GNULIB_WCRTOMB])
- GNULIB_WCSRTOMBS=0; AC_SUBST([GNULIB_WCSRTOMBS])
- GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS])
- GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH])
- dnl Assume proper GNU behavior unless another module says otherwise.
- HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC])
- HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT])
- HAVE_MBRTOWC=1; AC_SUBST([HAVE_MBRTOWC])
- HAVE_MBRLEN=1; AC_SUBST([HAVE_MBRLEN])
- HAVE_MBSRTOWCS=1; AC_SUBST([HAVE_MBSRTOWCS])
- HAVE_MBSNRTOWCS=1; AC_SUBST([HAVE_MBSNRTOWCS])
- HAVE_WCRTOMB=1; AC_SUBST([HAVE_WCRTOMB])
- HAVE_WCSRTOMBS=1; AC_SUBST([HAVE_WCSRTOMBS])
- HAVE_WCSNRTOMBS=1; AC_SUBST([HAVE_WCSNRTOMBS])
- HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB])
- HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH])
- REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T])
- REPLACE_BTOWC=0; AC_SUBST([REPLACE_BTOWC])
- REPLACE_WCTOB=0; AC_SUBST([REPLACE_WCTOB])
- REPLACE_MBSINIT=0; AC_SUBST([REPLACE_MBSINIT])
- REPLACE_MBRTOWC=0; AC_SUBST([REPLACE_MBRTOWC])
- REPLACE_MBRLEN=0; AC_SUBST([REPLACE_MBRLEN])
- REPLACE_MBSRTOWCS=0; AC_SUBST([REPLACE_MBSRTOWCS])
- REPLACE_MBSNRTOWCS=0; AC_SUBST([REPLACE_MBSNRTOWCS])
- REPLACE_WCRTOMB=0; AC_SUBST([REPLACE_WCRTOMB])
- REPLACE_WCSRTOMBS=0; AC_SUBST([REPLACE_WCSRTOMBS])
- REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS])
- REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH])
-])
diff --git a/lib/gl/m4/wchar_t.m4 b/lib/gl/m4/wchar_t.m4
index a133e6ad58..d2c03c42d2 100644
--- a/lib/gl/m4/wchar_t.m4
+++ b/lib/gl/m4/wchar_t.m4
@@ -1,5 +1,5 @@
# wchar_t.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2002-2003, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2008-2011 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.
diff --git a/lib/gl/m4/wint_t.m4 b/lib/gl/m4/wint_t.m4
index 58ef865565..da1ce3df60 100644
--- a/lib/gl/m4/wint_t.m4
+++ b/lib/gl/m4/wint_t.m4
@@ -1,5 +1,5 @@
# wint_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007-2011 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.
diff --git a/lib/gl/m4/xsize.m4 b/lib/gl/m4/xsize.m4
index b653693a30..8c693bc633 100644
--- a/lib/gl/m4/xsize.m4
+++ b/lib/gl/m4/xsize.m4
@@ -1,5 +1,5 @@
# xsize.m4 serial 4
-dnl Copyright (C) 2003-2004, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2004, 2008-2011 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.
diff --git a/lib/gl/malloc.c b/lib/gl/malloc.c
index 02ca9f7c84..bc84c41ca7 100644
--- a/lib/gl/malloc.c
+++ b/lib/gl/malloc.c
@@ -1,6 +1,6 @@
/* malloc() function that is glibc compatible.
- Copyright (C) 1997-1998, 2006-2007, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 1997-1998, 2006-2007, 2009-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/lib/gl/memchr.c b/lib/gl/memchr.c
index b0af681bae..05cf97f656 100644
--- a/lib/gl/memchr.c
+++ b/lib/gl/memchr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2010
+/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2011
Free Software Foundation, Inc.
Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
diff --git a/lib/gl/memmem.c b/lib/gl/memmem.c
index 544ed45551..4239662786 100644
--- a/lib/gl/memmem.c
+++ b/lib/gl/memmem.c
@@ -1,5 +1,5 @@
-/* Copyright (C) 1991, 1992, 1993, 1994, 1996, 1997, 1998, 2000, 2004, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2011 Free Software
+ Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
diff --git a/lib/gl/minmax.h b/lib/gl/minmax.h
index 76a683daa5..e1a59da638 100644
--- a/lib/gl/minmax.h
+++ b/lib/gl/minmax.h
@@ -1,5 +1,5 @@
/* MIN, MAX macros.
- Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009, 2010 Free Software
+ Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2011 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
diff --git a/lib/gl/netdb.in.h b/lib/gl/netdb.in.h
index 4f6fef31f1..5e5e59d275 100644
--- a/lib/gl/netdb.in.h
+++ b/lib/gl/netdb.in.h
@@ -1,5 +1,5 @@
/* Provide a netdb.h header file for systems lacking it (read: MinGW).
- Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
Written by Simon Josefsson.
This program is free software; you can redistribute it and/or modify
@@ -51,6 +51,7 @@
# if !@HAVE_STRUCT_ADDRINFO@
+# if !GNULIB_defined_struct_addrinfo
/* Structure to contain information about address of a service provider. */
struct addrinfo
{
@@ -63,6 +64,8 @@ struct addrinfo
char *ai_canonname; /* Canonical name for service location. */
struct addrinfo *ai_next; /* Pointer to next in list. */
};
+# define GNULIB_defined_struct_addrinfo 1
+# endif
# endif
/* Possible values for `ai_flags' field in `addrinfo' structure. */
diff --git a/lib/gl/printf-args.c b/lib/gl/printf-args.c
index b37cae2004..f913a96f30 100644
--- a/lib/gl/printf-args.c
+++ b/lib/gl/printf-args.c
@@ -1,5 +1,5 @@
/* Decomposed printf argument list.
- Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2010 Free Software
+ Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2011 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
diff --git a/lib/gl/printf-args.h b/lib/gl/printf-args.h
index fcdee85c0d..3b8d9af9e6 100644
--- a/lib/gl/printf-args.h
+++ b/lib/gl/printf-args.h
@@ -1,5 +1,5 @@
/* Decomposed printf argument list.
- Copyright (C) 1999, 2002-2003, 2006-2007, 2009-2010 Free Software
+ Copyright (C) 1999, 2002-2003, 2006-2007, 2011 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -136,10 +136,14 @@ typedef struct
}
argument;
+/* Number of directly allocated arguments (no malloc() needed). */
+#define N_DIRECT_ALLOC_ARGUMENTS 7
+
typedef struct
{
size_t count;
argument *arg;
+ argument direct_alloc_arg[N_DIRECT_ALLOC_ARGUMENTS];
}
arguments;
diff --git a/lib/gl/printf-parse.c b/lib/gl/printf-parse.c
index 2b8cc7b7d1..a14741266f 100644
--- a/lib/gl/printf-parse.c
+++ b/lib/gl/printf-parse.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 1999-2000, 2002-2003, 2006-2010 Free Software Foundation, Inc.
+ Copyright (C) 1999-2000, 2002-2003, 2006-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -63,6 +63,9 @@
/* malloc(), realloc(), free(). */
#include <stdlib.h>
+/* memcpy(). */
+#include <string.h>
+
/* errno. */
#include <errno.h>
@@ -80,23 +83,20 @@ STATIC
int
PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
{
- const CHAR_T *cp = format; /* pointer into format */
+ const CHAR_T *cp = format; /* pointer into format */
size_t arg_posn = 0; /* number of regular arguments consumed */
- size_t d_allocated; /* allocated elements of d->dir */
- size_t a_allocated; /* allocated elements of a->arg */
+ size_t d_allocated; /* allocated elements of d->dir */
+ size_t a_allocated; /* allocated elements of a->arg */
size_t max_width_length = 0;
size_t max_precision_length = 0;
d->count = 0;
- d_allocated = 1;
- d->dir = (DIRECTIVE *) malloc (d_allocated * sizeof (DIRECTIVE));
- if (d->dir == NULL)
- /* Out of memory. */
- goto out_of_memory_1;
+ d_allocated = N_DIRECT_ALLOC_DIRECTIVES;
+ d->dir = d->direct_alloc_dir;
a->count = 0;
- a_allocated = 0;
- a->arg = NULL;
+ a_allocated = N_DIRECT_ALLOC_ARGUMENTS;
+ a->arg = a->direct_alloc_arg;
#define REGISTER_ARG(_index_,_type_) \
{ \
@@ -113,12 +113,14 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
if (size_overflow_p (memory_size)) \
/* Overflow, would lead to out of memory. */ \
goto out_of_memory; \
- memory = (argument *) (a->arg \
+ memory = (argument *) (a->arg != a->direct_alloc_arg \
? realloc (a->arg, memory_size) \
: malloc (memory_size)); \
if (memory == NULL) \
/* Out of memory. */ \
goto out_of_memory; \
+ if (a->arg == a->direct_alloc_arg) \
+ memcpy (memory, a->arg, a->count * sizeof (argument)); \
a->arg = memory; \
} \
while (a->count <= n) \
@@ -588,10 +590,14 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
if (size_overflow_p (memory_size))
/* Overflow, would lead to out of memory. */
goto out_of_memory;
- memory = (DIRECTIVE *) realloc (d->dir, memory_size);
+ memory = (DIRECTIVE *) (d->dir != d->direct_alloc_dir
+ ? realloc (d->dir, memory_size)
+ : malloc (memory_size));
if (memory == NULL)
/* Out of memory. */
goto out_of_memory;
+ if (d->dir == d->direct_alloc_dir)
+ memcpy (memory, d->dir, d->count * sizeof (DIRECTIVE));
d->dir = memory;
}
}
@@ -610,19 +616,18 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
return 0;
error:
- if (a->arg)
+ if (a->arg != a->direct_alloc_arg)
free (a->arg);
- if (d->dir)
+ if (d->dir != d->direct_alloc_dir)
free (d->dir);
errno = EINVAL;
return -1;
out_of_memory:
- if (a->arg)
+ if (a->arg != a->direct_alloc_arg)
free (a->arg);
- if (d->dir)
+ if (d->dir != d->direct_alloc_dir)
free (d->dir);
-out_of_memory_1:
errno = ENOMEM;
return -1;
}
diff --git a/lib/gl/printf-parse.h b/lib/gl/printf-parse.h
index 853cc4770d..b8583e392a 100644
--- a/lib/gl/printf-parse.h
+++ b/lib/gl/printf-parse.h
@@ -1,5 +1,5 @@
/* Parse printf format string.
- Copyright (C) 1999, 2002-2003, 2005, 2007, 2009-2010 Free Software
+ Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2011 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -47,6 +47,9 @@
/* xxx_directive: A parsed directive.
xxx_directives: A parsed format string. */
+/* Number of directly allocated directives (no malloc() needed). */
+#define N_DIRECT_ALLOC_DIRECTIVES 7
+
/* A parsed directive. */
typedef struct
{
@@ -71,6 +74,7 @@ typedef struct
char_directive *dir;
size_t max_width_length;
size_t max_precision_length;
+ char_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
}
char_directives;
@@ -100,6 +104,7 @@ typedef struct
u8_directive *dir;
size_t max_width_length;
size_t max_precision_length;
+ u8_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
}
u8_directives;
@@ -127,6 +132,7 @@ typedef struct
u16_directive *dir;
size_t max_width_length;
size_t max_precision_length;
+ u16_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
}
u16_directives;
@@ -154,6 +160,7 @@ typedef struct
u32_directive *dir;
size_t max_width_length;
size_t max_precision_length;
+ u32_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
}
u32_directives;
diff --git a/lib/gl/read-file.c b/lib/gl/read-file.c
index 38b26e47c8..7a5076d7ab 100644
--- a/lib/gl/read-file.c
+++ b/lib/gl/read-file.c
@@ -1,5 +1,5 @@
/* read-file.c -- read file contents into a string
- Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc.
Written by Simon Josefsson and Bruno Haible.
This program is free software; you can redistribute it and/or modify
@@ -39,12 +39,12 @@
and set *LENGTH to the length of the string. The string is
zero-terminated, but the terminating zero byte is not counted in
*LENGTH. On errors, *LENGTH is undefined, errno preserves the
- values set by system functions (if any), and NULL is returned. */
+ values set by system functions (if any), and NULL is returned. */
char *
-fread_file (FILE * stream, size_t * length)
+fread_file (FILE *stream, size_t *length)
{
char *buf = NULL;
- size_t alloc = 0;
+ size_t alloc = BUFSIZ;
/* For a regular file, allocate a buffer that has exactly the right
size. This avoids the need to do dynamic reallocations later. */
@@ -59,59 +59,31 @@ fread_file (FILE * stream, size_t * length)
{
off_t alloc_off = st.st_size - pos;
- if (SIZE_MAX <= alloc_off)
+ /* '1' below, accounts for the trailing NUL. */
+ if (SIZE_MAX - 1 < alloc_off)
{
errno = ENOMEM;
return NULL;
}
alloc = alloc_off + 1;
-
- buf = malloc (alloc);
- if (!buf)
- /* errno is ENOMEM. */
- return NULL;
}
}
}
+ if (!(buf = malloc (alloc)))
+ return NULL; /* errno is ENOMEM. */
+
{
size_t size = 0; /* number of bytes read so far */
int save_errno;
for (;;)
{
- size_t count;
- size_t requested;
-
- if (size + BUFSIZ + 1 > alloc)
- {
- char *new_buf;
- size_t new_alloc = alloc + alloc / 2;
-
- /* Check against overflow. */
- if (new_alloc < alloc)
- {
- save_errno = ENOMEM;
- break;
- }
-
- alloc = new_alloc;
- if (alloc < size + BUFSIZ + 1)
- alloc = size + BUFSIZ + 1;
-
- new_buf = realloc (buf, alloc);
- if (!new_buf)
- {
- save_errno = errno;
- break;
- }
-
- buf = new_buf;
- }
-
- requested = alloc - size - 1;
- count = fread (buf + size, 1, requested, stream);
+ /* This reads 1 more than the size of a regular file
+ so that we get eof immediately. */
+ size_t requested = alloc - size;
+ size_t count = fread (buf + size, 1, requested, stream);
size += count;
if (count != requested)
@@ -121,7 +93,7 @@ fread_file (FILE * stream, size_t * length)
break;
/* Shrink the allocated memory if possible. */
- if (size + 1 < alloc)
+ if (size < alloc - 1)
{
char *smaller_buf = realloc (buf, size + 1);
if (smaller_buf != NULL)
@@ -132,6 +104,29 @@ fread_file (FILE * stream, size_t * length)
*length = size;
return buf;
}
+
+ {
+ char *new_buf;
+
+ if (alloc == SIZE_MAX)
+ {
+ save_errno = ENOMEM;
+ break;
+ }
+
+ if (alloc < SIZE_MAX - alloc / 2)
+ alloc = alloc + alloc / 2;
+ else
+ alloc = SIZE_MAX;
+
+ if (!(new_buf = realloc (buf, alloc)))
+ {
+ save_errno = errno;
+ break;
+ }
+
+ buf = new_buf;
+ }
}
free (buf);
@@ -141,7 +136,7 @@ fread_file (FILE * stream, size_t * length)
}
static char *
-internal_read_file (const char *filename, size_t * length, const char *mode)
+internal_read_file (const char *filename, size_t *length, const char *mode)
{
FILE *stream = fopen (filename, mode);
char *out;
@@ -175,7 +170,7 @@ internal_read_file (const char *filename, size_t * length, const char *mode)
undefined, errno preserves the values set by system functions (if
any), and NULL is returned. */
char *
-read_file (const char *filename, size_t * length)
+read_file (const char *filename, size_t *length)
{
return internal_read_file (filename, length, "r");
}
@@ -188,7 +183,7 @@ read_file (const char *filename, size_t * length)
preserves the values set by system functions (if any), and NULL is
returned. */
char *
-read_binary_file (const char *filename, size_t * length)
+read_binary_file (const char *filename, size_t *length)
{
return internal_read_file (filename, length, "rb");
}
diff --git a/lib/gl/read-file.h b/lib/gl/read-file.h
index 465c3d1f78..5ca64a2b58 100644
--- a/lib/gl/read-file.h
+++ b/lib/gl/read-file.h
@@ -1,5 +1,5 @@
/* read-file.h -- read file contents into a string
- Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc.
Written by Simon Josefsson.
This program is free software; you can redistribute it and/or modify
diff --git a/lib/gl/realloc.c b/lib/gl/realloc.c
index 2201385a6f..e0a7a16845 100644
--- a/lib/gl/realloc.c
+++ b/lib/gl/realloc.c
@@ -1,6 +1,6 @@
/* realloc() function that is glibc compatible.
- Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2010 Free Software
+ Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2011 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
diff --git a/lib/gl/size_max.h b/lib/gl/size_max.h
index cc99ee3f3d..7ea0c2ed7d 100644
--- a/lib/gl/size_max.h
+++ b/lib/gl/size_max.h
@@ -1,5 +1,5 @@
/* size_max.h -- declare SIZE_MAX through system headers
- Copyright (C) 2005-2006, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2011 Free Software Foundation, Inc.
Written by Simon Josefsson.
This program is free software; you can redistribute it and/or modify
diff --git a/lib/gl/snprintf.c b/lib/gl/snprintf.c
index d9207a8e6e..2e24ca6470 100644
--- a/lib/gl/snprintf.c
+++ b/lib/gl/snprintf.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 2004, 2006-2010 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2006-2011 Free Software Foundation, Inc.
Written by Simon Josefsson and Paul Eggert.
This program is free software; you can redistribute it and/or modify
diff --git a/lib/gl/sockets.c b/lib/gl/sockets.c
index 113dc17dcb..16cca82ce2 100644
--- a/lib/gl/sockets.c
+++ b/lib/gl/sockets.c
@@ -1,6 +1,6 @@
/* sockets.c --- wrappers for Windows socket functions
- Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/lib/gl/sockets.h b/lib/gl/sockets.h
index 0bcbd9f70c..b071c3e86a 100644
--- a/lib/gl/sockets.h
+++ b/lib/gl/sockets.h
@@ -1,6 +1,6 @@
/* sockets.h - wrappers for Windows socket functions
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/lib/gl/stdbool.in.h b/lib/gl/stdbool.in.h
index 88b3520041..12efde36d3 100644
--- a/lib/gl/stdbool.in.h
+++ b/lib/gl/stdbool.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2003, 2006-2010 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2003, 2006-2011 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
diff --git a/lib/gl/stddef.in.h b/lib/gl/stddef.in.h
index 4f25aeeb08..b3fc2b507a 100644
--- a/lib/gl/stddef.in.h
+++ b/lib/gl/stddef.in.h
@@ -1,6 +1,6 @@
/* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/lib/gl/stdint.in.h b/lib/gl/stdint.in.h
index 6fafca4ff4..1140c12b44 100644
--- a/lib/gl/stdint.in.h
+++ b/lib/gl/stdint.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2002, 2004-2010 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2002, 2004-2011 Free Software Foundation, Inc.
Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
This file is part of gnulib.
@@ -108,6 +108,8 @@
warnings in the signed case. */ \
((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
+#if !GNULIB_defined_stdint_types
+
/* 7.18.1.1. Exact-width integer types */
/* Here we assume a standard architecture where the hardware integer
@@ -137,9 +139,10 @@ typedef unsigned int gl_uint32_t;
/* If the system defines INT64_MAX, assume int64_t works. That way,
if the underlying platform defines int64_t to be a 64-bit long long
int, the code below won't mistakenly define it to be a 64-bit long
- int, which would mess up C++ name mangling. */
+ int, which would mess up C++ name mangling. We must use #ifdef
+ rather than #if, to avoid an error with HP-UX 10.20 cc. */
-#if INT64_MAX
+#ifdef INT64_MAX
# define GL_INT64_T
#else
/* Do not undefine int64_t if gnulib is not being used with 64-bit
@@ -162,7 +165,7 @@ typedef long long int gl_int64_t;
# endif
#endif
-#if UINT64_MAX
+#ifdef UINT64_MAX
# define GL_UINT64_T
#else
# if ULONG_MAX >> 31 >> 31 >> 1 == 1
@@ -295,6 +298,9 @@ typedef unsigned long int gl_uintmax_t;
typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
? 1 : -1];
+#define GNULIB_defined_stdint_types 1
+#endif /* !GNULIB_defined_stdint_types */
+
/* 7.18.2. Limits of specified-width integer types */
#if ! defined __cplusplus || defined __STDC_LIMIT_MACROS
@@ -491,7 +497,12 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
sequence of nested includes
<wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
<stdint.h> and assumes its types are already defined. */
-#if ! (defined WCHAR_MIN && defined WCHAR_MAX)
+#if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX)
+ /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
# include <wchar.h>
# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
diff --git a/lib/gl/stdio-impl.h b/lib/gl/stdio-impl.h
index 7a64fa839c..7136829024 100644
--- a/lib/gl/stdio-impl.h
+++ b/lib/gl/stdio-impl.h
@@ -1,5 +1,5 @@
/* Implementation details of FILE streams.
- Copyright (C) 2007-2008, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2008, 2010-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -75,6 +75,17 @@
/* SystemV derived implementations. */
+#ifdef __TANDEM /* NonStop Kernel */
+# ifndef _IOERR
+/* These values were determined by the program 'stdioext-flags' at
+ <http://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00165.html>. */
+# define _IOERR 0x40
+# define _IOREAD 0x80
+# define _IOWRT 0x4
+# define _IORW 0x100
+# endif
+#endif
+
#if defined _IOERR
# if defined __sun && defined _LP64 /* Solaris/{SPARC,AMD64} 64-bit */
diff --git a/lib/gl/stdio-write.c b/lib/gl/stdio-write.c
index 2db98c37fa..35d8fc5e49 100644
--- a/lib/gl/stdio-write.c
+++ b/lib/gl/stdio-write.c
@@ -1,5 +1,5 @@
/* POSIX compatible FILE stream write function.
- Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This program is free software: you can redistribute it and/or modify
diff --git a/lib/gl/stdio.in.h b/lib/gl/stdio.in.h
index b219d46f24..9091497383 100644
--- a/lib/gl/stdio.in.h
+++ b/lib/gl/stdio.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <stdio.h>.
- Copyright (C) 2004, 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2007-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -21,8 +21,14 @@
#endif
@PRAGMA_COLUMNS@
-#if defined __need_FILE || defined __need___FILE
-/* Special invocation convention inside glibc header files. */
+#if defined __need_FILE || defined __need___FILE || defined _GL_ALREADY_INCLUDING_STDIO_H
+/* Special invocation convention:
+ - Inside glibc header files.
+ - On OSF/1 5.1 we have a sequence of nested includes
+ <stdio.h> -> <getopt.h> -> <ctype.h> -> <sys/localedef.h> ->
+ <sys/lc_core.h> -> <nl_types.h> -> <mesg.h> -> <stdio.h>.
+ In this situation, the functions are not yet declared, therefore we cannot
+ provide the C++ aliases. */
#@INCLUDE_NEXT@ @NEXT_STDIO_H@
@@ -31,9 +37,13 @@
#ifndef _GL_STDIO_H
+#define _GL_ALREADY_INCLUDING_STDIO_H
+
/* The include_next requires a split double-inclusion guard. */
#@INCLUDE_NEXT@ @NEXT_STDIO_H@
+#undef _GL_ALREADY_INCLUDING_STDIO_H
+
#ifndef _GL_STDIO_H
#define _GL_STDIO_H
@@ -42,20 +52,23 @@
#include <stddef.h>
-/* Get off_t and ssize_t. Needed on many systems, including glibc 2.8. */
+/* Get off_t and ssize_t. Needed on many systems, including glibc 2.8
+ and eglibc 2.11.2. */
#include <sys/types.h>
-#ifndef __attribute__
/* The __attribute__ feature is available in gcc versions 2.5 and later.
The __-protected variants of the attributes 'format' and 'printf' are
accepted by gcc versions 2.6.4 (effectively 2.7) and later.
- We enable __attribute__ only if these are supported too, because
+ We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
gnulib and libintl do '#define printf __printf__' when they override
the 'printf' function. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-# define __attribute__(Spec) /* empty */
-# endif
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+#else
+# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
#endif
+#define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
+ _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
/* Solaris 10 declares renameat in <unistd.h>, not in <stdio.h>. */
/* But in any case avoid namespace pollution on glibc systems. */
@@ -82,13 +95,13 @@
# define dprintf rpl_dprintf
# endif
_GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *format, ...));
# else
# if !@HAVE_DPRINTF@
_GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *format, ...));
@@ -179,7 +192,7 @@ _GL_WARN_ON_USE (fopen, "fopen on Win32 platforms is not POSIX compatible - "
# endif
# define GNULIB_overrides_fprintf 1
_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (fprintf, int, (FILE *fp, const char *format, ...));
# else
@@ -345,7 +358,7 @@ _GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence));
# else
-# if ! @HAVE_FSEEKO@
+# if ! @HAVE_DECL_FSEEKO@
_GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)
_GL_ARG_NONNULL ((1)));
# endif
@@ -356,17 +369,20 @@ _GL_CXXALIASWARN (fseeko);
/* Provide an fseek function that is consistent with fseeko. */
/* In order to avoid that fseek gets defined as a macro here, the
developer can request the 'fseek' module. */
-# undef fseek
-# define fseek rpl_fseek
+# if !GNULIB_defined_fseek_function
+# undef fseek
+# define fseek rpl_fseek
static inline int _GL_ARG_NONNULL ((1))
rpl_fseek (FILE *fp, long offset, int whence)
{
-# if @REPLACE_FSEEKO@
+# if @REPLACE_FSEEKO@
return rpl_fseeko (fp, offset, whence);
-# else
+# else
return fseeko (fp, offset, whence);
-# endif
+# endif
}
+# define GNULIB_defined_fseek_function 1
+# endif
# endif
#elif defined GNULIB_POSIXCHECK
# define _GL_FSEEK_WARN /* Category 1, above. */
@@ -421,7 +437,7 @@ _GL_CXXALIASWARN (ftell);
_GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp));
# else
-# if ! @HAVE_FTELLO@
+# if ! @HAVE_DECL_FTELLO@
_GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
@@ -431,17 +447,20 @@ _GL_CXXALIASWARN (ftello);
/* Provide an ftell function that is consistent with ftello. */
/* In order to avoid that ftell gets defined as a macro here, the
developer can request the 'ftell' module. */
-# undef ftell
-# define ftell rpl_ftell
+# if !GNULIB_defined_ftell_function
+# undef ftell
+# define ftell rpl_ftell
static inline long _GL_ARG_NONNULL ((1))
rpl_ftell (FILE *f)
{
-# if @REPLACE_FTELLO@
+# if @REPLACE_FTELLO@
return rpl_ftello (f);
-# else
+# else
return ftello (f);
-# endif
+# endif
}
+# define GNULIB_defined_ftell_function 1
+# endif
# endif
#elif defined GNULIB_POSIXCHECK
# define _GL_FTELL_WARN /* Category 1, above. */
@@ -570,7 +589,7 @@ struct obstack;
# endif
_GL_FUNCDECL_RPL (obstack_printf, int,
(struct obstack *obs, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (obstack_printf, int,
(struct obstack *obs, const char *format, ...));
@@ -578,7 +597,7 @@ _GL_CXXALIAS_RPL (obstack_printf, int,
# if !@HAVE_DECL_OBSTACK_PRINTF@
_GL_FUNCDECL_SYS (obstack_printf, int,
(struct obstack *obs, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (obstack_printf, int,
@@ -591,7 +610,7 @@ _GL_CXXALIASWARN (obstack_printf);
# endif
_GL_FUNCDECL_RPL (obstack_vprintf, int,
(struct obstack *obs, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (obstack_vprintf, int,
(struct obstack *obs, const char *format, va_list args));
@@ -599,7 +618,7 @@ _GL_CXXALIAS_RPL (obstack_vprintf, int,
# if !@HAVE_DECL_OBSTACK_PRINTF@
_GL_FUNCDECL_SYS (obstack_vprintf, int,
(struct obstack *obs, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (obstack_vprintf, int,
@@ -662,13 +681,16 @@ _GL_FUNCDECL_RPL_1 (__printf__, int,
(const char *format, ...)
__asm__ (@ASM_SYMBOL_PREFIX@
_GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
- __attribute__ ((__format__ (__printf__, 1, 2)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
# else
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define printf rpl_printf
+# endif
_GL_FUNCDECL_RPL (printf, int,
(const char *format, ...)
- __attribute__ ((__format__ (__printf__, 1, 2)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (printf, int, (const char *format, ...));
# endif
@@ -808,7 +830,7 @@ _GL_WARN_ON_USE (renameat, "renameat is not portable - "
# endif
_GL_FUNCDECL_RPL (snprintf, int,
(char *str, size_t size, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 3, 4)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
_GL_ARG_NONNULL ((3)));
_GL_CXXALIAS_RPL (snprintf, int,
(char *str, size_t size, const char *format, ...));
@@ -816,7 +838,7 @@ _GL_CXXALIAS_RPL (snprintf, int,
# if !@HAVE_DECL_SNPRINTF@
_GL_FUNCDECL_SYS (snprintf, int,
(char *str, size_t size, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 3, 4)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
_GL_ARG_NONNULL ((3)));
# endif
_GL_CXXALIAS_SYS (snprintf, int,
@@ -846,7 +868,7 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
# define sprintf rpl_sprintf
# endif
_GL_FUNCDECL_RPL (sprintf, int, (char *str, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (sprintf, int, (char *str, const char *format, ...));
# else
@@ -891,7 +913,7 @@ _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
# endif
_GL_FUNCDECL_RPL (asprintf, int,
(char **result, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (asprintf, int,
(char **result, const char *format, ...));
@@ -899,7 +921,7 @@ _GL_CXXALIAS_RPL (asprintf, int,
# if !@HAVE_VASPRINTF@
_GL_FUNCDECL_SYS (asprintf, int,
(char **result, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (asprintf, int,
@@ -912,7 +934,7 @@ _GL_CXXALIASWARN (asprintf);
# endif
_GL_FUNCDECL_RPL (vasprintf, int,
(char **result, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (vasprintf, int,
(char **result, const char *format, va_list args));
@@ -920,7 +942,7 @@ _GL_CXXALIAS_RPL (vasprintf, int,
# if !@HAVE_VASPRINTF@
_GL_FUNCDECL_SYS (vasprintf, int,
(char **result, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (vasprintf, int,
@@ -935,13 +957,13 @@ _GL_CXXALIASWARN (vasprintf);
# define vdprintf rpl_vdprintf
# endif
_GL_FUNCDECL_RPL (vdprintf, int, (int fd, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (vdprintf, int, (int fd, const char *format, va_list args));
# else
# if !@HAVE_VDPRINTF@
_GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((2)));
# endif
/* Need to cast, because on Solaris, the third parameter will likely be
@@ -966,7 +988,7 @@ _GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
# endif
# define GNULIB_overrides_vfprintf 1
_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args));
# else
@@ -996,7 +1018,7 @@ _GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
# endif
# define GNULIB_overrides_vprintf 1
_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 1, 0)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (1, 0)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (vprintf, int, (const char *format, va_list args));
# else
@@ -1024,7 +1046,7 @@ _GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
# endif
_GL_FUNCDECL_RPL (vsnprintf, int,
(char *str, size_t size, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 3, 0)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
_GL_ARG_NONNULL ((3)));
_GL_CXXALIAS_RPL (vsnprintf, int,
(char *str, size_t size, const char *format, va_list args));
@@ -1032,7 +1054,7 @@ _GL_CXXALIAS_RPL (vsnprintf, int,
# if !@HAVE_DECL_VSNPRINTF@
_GL_FUNCDECL_SYS (vsnprintf, int,
(char *str, size_t size, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 3, 0)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
_GL_ARG_NONNULL ((3)));
# endif
_GL_CXXALIAS_SYS (vsnprintf, int,
@@ -1054,7 +1076,7 @@ _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
# endif
_GL_FUNCDECL_RPL (vsprintf, int,
(char *str, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (vsprintf, int,
(char *str, const char *format, va_list args));
diff --git a/lib/gl/stdlib.in.h b/lib/gl/stdlib.in.h
index 9c7cad93a8..1fa357665c 100644
--- a/lib/gl/stdlib.in.h
+++ b/lib/gl/stdlib.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <stdlib.h>.
- Copyright (C) 1995, 2001-2004, 2006-2010 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2001-2004, 2006-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -49,21 +49,23 @@
# include <sys/loadavg.h>
#endif
+#if @GNULIB_RANDOM_R@
+
/* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
- from <stdlib.h> if _REENTRANT is defined. Include it always. */
-#if @HAVE_RANDOM_H@
-# include <random.h>
-#endif
+ from <stdlib.h> if _REENTRANT is defined. Include it whenever we need
+ 'struct random_data'. */
+# if @HAVE_RANDOM_H@
+# include <random.h>
+# endif
-#if !@HAVE_STRUCT_RANDOM_DATA@ || (@GNULIB_RANDOM_R@ && !@HAVE_RANDOM_R@) \
- || defined GNULIB_POSIXCHECK
-# include <stdint.h>
-#endif
+# if !@HAVE_STRUCT_RANDOM_DATA@ || !@HAVE_RANDOM_R@
+# include <stdint.h>
+# endif
-#if !@HAVE_STRUCT_RANDOM_DATA@
+# if !@HAVE_STRUCT_RANDOM_DATA@
/* Define 'struct random_data'.
But allow multiple gnulib generated <stdlib.h> replacements to coexist. */
-# if !GNULIB_defined_struct_random_data
+# if !GNULIB_defined_struct_random_data
struct random_data
{
int32_t *fptr; /* Front pointer. */
@@ -74,7 +76,8 @@ struct random_data
int rand_sep; /* Distance between front and rear. */
int32_t *end_ptr; /* Pointer behind state table. */
};
-# define GNULIB_defined_struct_random_data 1
+# define GNULIB_defined_struct_random_data 1
+# endif
# endif
#endif
@@ -85,10 +88,10 @@ struct random_data
# include <unistd.h>
#endif
-#ifndef __attribute__
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
-# define __attribute__(Spec) /* empty */
-# endif
+#if 3 <= __GNUC__ || __GNUC__ == 2 && 8 <= __GNUC_MINOR__
+# define _GL_ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
+#else
+# define _GL_ATTRIBUTE_NORETURN
#endif
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
@@ -116,7 +119,7 @@ struct random_data
/* Terminate the current process with the given return code, without running
the 'atexit' handlers. */
# if !@HAVE__EXIT@
-_GL_FUNCDECL_SYS (_Exit, void, (int status) __attribute__ ((__noreturn__)));
+_GL_FUNCDECL_SYS (_Exit, void, (int status) _GL_ATTRIBUTE_NORETURN);
# endif
_GL_CXXALIAS_SYS (_Exit, void, (int status));
_GL_CXXALIASWARN (_Exit);
@@ -584,7 +587,7 @@ _GL_FUNCDECL_RPL (setenv, int,
_GL_CXXALIAS_RPL (setenv, int,
(const char *name, const char *value, int replace));
# else
-# if !@HAVE_SETENV@
+# if !@HAVE_DECL_SETENV@
_GL_FUNCDECL_SYS (setenv, int,
(const char *name, const char *value, int replace)
_GL_ARG_NONNULL ((1)));
@@ -592,7 +595,9 @@ _GL_FUNCDECL_SYS (setenv, int,
_GL_CXXALIAS_SYS (setenv, int,
(const char *name, const char *value, int replace));
# endif
+# if !(@REPLACE_SETENV@ && !@HAVE_DECL_SETENV@)
_GL_CXXALIASWARN (setenv);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef setenv
# if HAVE_RAW_DECL_SETENV
@@ -702,12 +707,14 @@ _GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - "
_GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
# else
-# if !@HAVE_UNSETENV@
+# if !@HAVE_DECL_UNSETENV@
_GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
# endif
+# if !(@REPLACE_UNSETENV@ && !@HAVE_DECL_UNSETENV@)
_GL_CXXALIASWARN (unsetenv);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef unsetenv
# if HAVE_RAW_DECL_UNSETENV
diff --git a/lib/gl/str-two-way.h b/lib/gl/str-two-way.h
index 830edc6734..049111ad0b 100644
--- a/lib/gl/str-two-way.h
+++ b/lib/gl/str-two-way.h
@@ -1,5 +1,5 @@
/* Byte-wise substring search, using the Two-Way algorithm.
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Eric Blake <ebb9@byu.net>, 2008.
diff --git a/lib/gl/strcasecmp.c b/lib/gl/strcasecmp.c
index 3d9ea4ac19..b2cb0f4aa1 100644
--- a/lib/gl/strcasecmp.c
+++ b/lib/gl/strcasecmp.c
@@ -1,5 +1,5 @@
/* Case-insensitive string comparison function.
- Copyright (C) 1998-1999, 2005-2007, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 1998-1999, 2005-2007, 2009-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/lib/gl/string.in.h b/lib/gl/string.in.h
index b5711c07c6..d86d283e60 100644
--- a/lib/gl/string.in.h
+++ b/lib/gl/string.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <string.h>.
- Copyright (C) 1995-1996, 2001-2010 Free Software Foundation, Inc.
+ Copyright (C) 1995-1996, 2001-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -37,13 +37,8 @@
# include <wchar.h>
#endif
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
-# define __attribute__(Spec) /* empty */
-# endif
-#endif
-/* The attribute __pure__ was added in gcc 2.96. */
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The attribute __pure__ was added in gcc 2.96. */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
#else
diff --git a/lib/gl/strings.in.h b/lib/gl/strings.in.h
index fb1f19014d..94ae564b66 100644
--- a/lib/gl/strings.in.h
+++ b/lib/gl/strings.in.h
@@ -1,6 +1,6 @@
/* A substitute <strings.h>.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/lib/gl/strncasecmp.c b/lib/gl/strncasecmp.c
index 788e4234e4..4111ddd694 100644
--- a/lib/gl/strncasecmp.c
+++ b/lib/gl/strncasecmp.c
@@ -1,5 +1,5 @@
/* strncasecmp.c -- case insensitive string comparator
- Copyright (C) 1998-1999, 2005-2007, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 1998-1999, 2005-2007, 2009-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/lib/gl/strverscmp.c b/lib/gl/strverscmp.c
index 5757d647f1..04aeac21d3 100644
--- a/lib/gl/strverscmp.c
+++ b/lib/gl/strverscmp.c
@@ -1,5 +1,5 @@
/* Compare strings while treating digits characters numerically.
- Copyright (C) 1997, 2000, 2002, 2004, 2006, 2009-2010 Free Software
+ Copyright (C) 1997, 2000, 2002, 2004, 2006, 2009-2011 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jean-François Bignolles <bignolle@ecoledoc.ibp.fr>, 1997.
diff --git a/lib/gl/sys_socket.in.h b/lib/gl/sys_socket.in.h
index d62d8cfc3d..1f603bb840 100644
--- a/lib/gl/sys_socket.in.h
+++ b/lib/gl/sys_socket.in.h
@@ -1,6 +1,6 @@
/* Provide a sys/socket header file for systems lacking it (read: MinGW)
and for systems where it is incomplete.
- Copyright (C) 2005-2010 Free Software Foundation, Inc.
+ Copyright (C) 2005-2011 Free Software Foundation, Inc.
Written by Simon Josefsson.
This program is free software; you can redistribute it and/or modify
@@ -67,7 +67,10 @@
/* The definition of _GL_WARN_ON_USE is copied here. */
#if !@HAVE_SA_FAMILY_T@
+# if !GNULIB_defined_sa_family_t
typedef unsigned short sa_family_t;
+# define GNULIB_defined_sa_family_t 1
+# endif
#endif
#if @HAVE_STRUCT_SOCKADDR_STORAGE@
@@ -89,12 +92,16 @@ typedef unsigned short sa_family_t;
: alignof (__ss_aligntype)) \
+ sizeof (__ss_aligntype)))
+# if !GNULIB_defined_struct_sockaddr_storage
struct sockaddr_storage
{
sa_family_t ss_family; /* Address family, etc. */
__ss_aligntype __ss_align; /* Force desired alignment. */
char __ss_padding[_SS_PADSIZE];
};
+# define GNULIB_defined_struct_sockaddr_storage 1
+# endif
+
#endif
#if @HAVE_SYS_SOCKET_H@
@@ -159,7 +166,10 @@ struct sockaddr_storage
# include <sys/types.h>
# include <io.h>
+# if !GNULIB_defined_socklen_t
typedef int socklen_t;
+# define GNULIB_defined_socklen_t 1
+# endif
# endif
@@ -167,6 +177,8 @@ typedef int socklen_t;
#if @HAVE_WINSOCK2_H@
+# if !GNULIB_defined_rpl_fd_isset
+
/* Re-define FD_ISSET to avoid a WSA call while we are not using
network sockets. */
static inline int
@@ -183,6 +195,9 @@ rpl_fd_isset (SOCKET fd, fd_set * set)
return 0;
}
+# define GNULIB_defined_rpl_fd_isset 1
+# endif
+
# undef FD_ISSET
# define FD_ISSET(fd, set) rpl_fd_isset(fd, set)
@@ -245,8 +260,11 @@ _GL_FUNCDECL_RPL (connect, int,
_GL_CXXALIAS_RPL (connect, int,
(int fd, const struct sockaddr *addr, socklen_t addrlen));
# else
-_GL_CXXALIAS_SYS (connect, int,
- (int fd, const struct sockaddr *addr, socklen_t addrlen));
+/* Need to cast, because on NonStop Kernel, the third parameter is
+ size_t addrlen. */
+_GL_CXXALIAS_SYS_CAST (connect, int,
+ (int fd,
+ const struct sockaddr *addr, socklen_t addrlen));
# endif
_GL_CXXALIASWARN (connect);
#elif @HAVE_WINSOCK2_H@
@@ -300,8 +318,11 @@ _GL_FUNCDECL_RPL (bind, int,
_GL_CXXALIAS_RPL (bind, int,
(int fd, const struct sockaddr *addr, socklen_t addrlen));
# else
-_GL_CXXALIAS_SYS (bind, int,
- (int fd, const struct sockaddr *addr, socklen_t addrlen));
+/* Need to cast, because on NonStop Kernel, the third parameter is
+ size_t addrlen. */
+_GL_CXXALIAS_SYS_CAST (bind, int,
+ (int fd,
+ const struct sockaddr *addr, socklen_t addrlen));
# endif
_GL_CXXALIASWARN (bind);
#elif @HAVE_WINSOCK2_H@
@@ -522,9 +543,11 @@ _GL_CXXALIAS_RPL (sendto, ssize_t,
(int fd, const void *buf, size_t len, int flags,
const struct sockaddr *to, socklen_t tolen));
# else
-_GL_CXXALIAS_SYS (sendto, ssize_t,
- (int fd, const void *buf, size_t len, int flags,
- const struct sockaddr *to, socklen_t tolen));
+/* Need to cast, because on NonStop Kernel, the sixth parameter is
+ size_t tolen. */
+_GL_CXXALIAS_SYS_CAST (sendto, ssize_t,
+ (int fd, const void *buf, size_t len, int flags,
+ const struct sockaddr *to, socklen_t tolen));
# endif
_GL_CXXALIASWARN (sendto);
#elif @HAVE_WINSOCK2_H@
@@ -550,8 +573,11 @@ _GL_FUNCDECL_RPL (setsockopt, int, (int fd, int level, int optname,
_GL_CXXALIAS_RPL (setsockopt, int, (int fd, int level, int optname,
const void * optval, socklen_t optlen));
# else
-_GL_CXXALIAS_SYS (setsockopt, int, (int fd, int level, int optname,
- const void * optval, socklen_t optlen));
+/* Need to cast, because on NonStop Kernel, the fifth parameter is
+ size_t optlen. */
+_GL_CXXALIAS_SYS_CAST (setsockopt, int,
+ (int fd, int level, int optname,
+ const void * optval, socklen_t optlen));
# endif
_GL_CXXALIASWARN (setsockopt);
#elif @HAVE_WINSOCK2_H@
diff --git a/lib/gl/sys_stat.in.h b/lib/gl/sys_stat.in.h
index 4203a5899f..0ce19ed7b1 100644
--- a/lib/gl/sys_stat.in.h
+++ b/lib/gl/sys_stat.in.h
@@ -1,5 +1,5 @@
/* Provide a more complete sys/stat header file.
- Copyright (C) 2005-2010 Free Software Foundation, Inc.
+ Copyright (C) 2005-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -461,11 +461,14 @@ _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
which are included above. */
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if !GNULIB_defined_rpl_mkdir
static inline int
rpl_mkdir (char const *name, mode_t mode)
{
return _mkdir (name);
}
+# define GNULIB_defined_rpl_mkdir 1
+# endif
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mkdir rpl_mkdir
@@ -550,7 +553,8 @@ _GL_CXXALIAS_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev));
_GL_FUNCDECL_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev)
_GL_ARG_NONNULL ((1)));
# endif
-_GL_CXXALIAS_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev));
+/* Need to cast, because on OSF/1 5.1, the third parameter is '...'. */
+_GL_CXXALIAS_SYS_CAST (mknod, int, (char const *file, mode_t mode, dev_t dev));
# endif
_GL_CXXALIASWARN (mknod);
#elif defined GNULIB_POSIXCHECK
diff --git a/lib/gl/tests/Makefile.am b/lib/gl/tests/Makefile.am
index 4be0a1f091..b874134cfc 100644
--- a/lib/gl/tests/Makefile.am
+++ b/lib/gl/tests/Makefile.am
@@ -1,6 +1,6 @@
## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+# Copyright (C) 2002-2011 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
@@ -144,6 +144,47 @@ EXTRA_DIST += test-errno.c
## end gnulib module errno-tests
+## begin gnulib module fcntl-h
+
+BUILT_SOURCES += fcntl.h
+
+# We need the following in order to create <fcntl.h> when the system
+# doesn't have one that works with the given compiler.
+fcntl.h: fcntl.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
+ -e 's|@''GNULIB_FCNTL''@|$(GNULIB_FCNTL)|g' \
+ -e 's|@''GNULIB_OPEN''@|$(GNULIB_OPEN)|g' \
+ -e 's|@''GNULIB_OPENAT''@|$(GNULIB_OPENAT)|g' \
+ -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
+ -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
+ -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \
+ -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
+ -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ < $(srcdir)/fcntl.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += fcntl.h fcntl.h-t
+
+EXTRA_DIST += fcntl.in.h
+
+## end gnulib module fcntl-h
+
+## begin gnulib module fcntl-h-tests
+
+TESTS += test-fcntl-h
+check_PROGRAMS += test-fcntl-h
+EXTRA_DIST += test-fcntl-h.c
+
+## end gnulib module fcntl-h-tests
+
## begin gnulib module fseeko-tests
TESTS += test-fseeko.sh test-fseeko2.sh
@@ -378,14 +419,6 @@ EXTRA_DIST += $(top_srcdir)/build-aux/warn-on-use.h
## end gnulib module warn-on-use
-## begin gnulib module wchar-tests
-
-TESTS += test-wchar
-check_PROGRAMS += test-wchar
-EXTRA_DIST += test-wchar.c
-
-## end gnulib module wchar-tests
-
## begin gnulib module dummy
libtests_a_SOURCES += dummy.c
diff --git a/lib/gl/tests/binary-io.h b/lib/gl/tests/binary-io.h
index 5451fd48f4..c09dbf5799 100644
--- a/lib/gl/tests/binary-io.h
+++ b/lib/gl/tests/binary-io.h
@@ -1,6 +1,5 @@
/* Binary mode I/O.
- Copyright (C) 2001, 2003, 2005, 2008, 2009, 2010 Free Software Foundation,
- Inc.
+ Copyright (C) 2001, 2003, 2005, 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,24 +18,13 @@
#define _BINARY_H
/* For systems that distinguish between text and binary I/O.
- O_BINARY is usually declared in <fcntl.h>. */
+ O_BINARY is guaranteed by the gnulib <fcntl.h>. */
#include <fcntl.h>
/* The MSVC7 <stdio.h> doesn't like to be included after '#define fileno ...',
so we include it here first. */
#include <stdio.h>
-#if !defined O_BINARY && defined _O_BINARY
- /* For MSC-compatible compilers. */
-# define O_BINARY _O_BINARY
-# define O_TEXT _O_TEXT
-#endif
-#if defined __BEOS__ || defined __HAIKU__
- /* BeOS 5 and Haiku have O_BINARY and O_TEXT, but they have no effect. */
-# undef O_BINARY
-# undef O_TEXT
-#endif
-
/* SET_BINARY (fd);
changes the file descriptor fd to perform binary I/O. */
#if O_BINARY
@@ -58,8 +46,6 @@
# endif
#else
/* On reasonable systems, binary I/O is the default. */
-# undef O_BINARY
-# define O_BINARY 0
# define SET_BINARY(fd) /* do nothing */ ((void) 0)
#endif
diff --git a/lib/gl/tests/dummy.c b/lib/gl/tests/dummy.c
index 0f9a277962..c958ea05d8 100644
--- a/lib/gl/tests/dummy.c
+++ b/lib/gl/tests/dummy.c
@@ -1,5 +1,5 @@
/* A dummy file, to prevent empty libraries from breaking builds.
- Copyright (C) 2004, 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/fcntl.in.h b/lib/gl/tests/fcntl.in.h
new file mode 100644
index 0000000000..18cac454ab
--- /dev/null
+++ b/lib/gl/tests/fcntl.in.h
@@ -0,0 +1,308 @@
+/* Like <fcntl.h>, but with non-working flags defined to 0.
+
+ Copyright (C) 2006-2011 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* written by Paul Eggert */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined __need_system_fcntl_h
+/* Special invocation convention. */
+
+#include <sys/types.h>
+/* On some systems other than glibc, <sys/stat.h> is a prerequisite of
+ <fcntl.h>. On glibc systems, we would like to avoid namespace pollution.
+ But on glibc systems, <fcntl.h> includes <sys/stat.h> inside an
+ extern "C" { ... } block, which leads to errors in C++ mode with the
+ overridden <sys/stat.h> from gnulib. These errors are known to be gone
+ with g++ version >= 4.3. */
+#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
+# include <sys/stat.h>
+#endif
+#@INCLUDE_NEXT@ @NEXT_FCNTL_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _GL_FCNTL_H
+
+#include <sys/types.h>
+/* On some systems other than glibc, <sys/stat.h> is a prerequisite of
+ <fcntl.h>. On glibc systems, we would like to avoid namespace pollution.
+ But on glibc systems, <fcntl.h> includes <sys/stat.h> inside an
+ extern "C" { ... } block, which leads to errors in C++ mode with the
+ overridden <sys/stat.h> from gnulib. These errors are known to be gone
+ with g++ version >= 4.3. */
+#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
+# include <sys/stat.h>
+#endif
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_FCNTL_H@
+
+#ifndef _GL_FCNTL_H
+#define _GL_FCNTL_H
+
+#ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems. */
+# include <unistd.h>
+#endif
+
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+/* Declare overridden functions. */
+
+#if @GNULIB_FCNTL@
+# if @REPLACE_FCNTL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fcntl
+# define fcntl rpl_fcntl
+# endif
+_GL_FUNCDECL_RPL (fcntl, int, (int fd, int action, ...));
+_GL_CXXALIAS_RPL (fcntl, int, (int fd, int action, ...));
+# else
+# if !@HAVE_FCNTL@
+_GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...));
+# endif
+_GL_CXXALIAS_SYS (fcntl, int, (int fd, int action, ...));
+# endif
+_GL_CXXALIASWARN (fcntl);
+#elif defined GNULIB_POSIXCHECK
+# undef fcntl
+# if HAVE_RAW_DECL_FCNTL
+_GL_WARN_ON_USE (fcntl, "fcntl is not always POSIX compliant - "
+ "use gnulib module fcntl for portability");
+# endif
+#endif
+
+#if @GNULIB_OPEN@
+# if @REPLACE_OPEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef open
+# define open rpl_open
+# endif
+_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
+# else
+_GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
+# endif
+/* On HP-UX 11, in C++ mode, open() is defined as an inline function with a
+ default argument. _GL_CXXALIASWARN does not work in this case. */
+# if !defined __hpux
+_GL_CXXALIASWARN (open);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef open
+/* Assume open is always declared. */
+_GL_WARN_ON_USE (open, "open is not always POSIX compliant - "
+ "use gnulib module open for portability");
+#endif
+
+#if @GNULIB_OPENAT@
+# if @REPLACE_OPENAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef openat
+# define openat rpl_openat
+# endif
+_GL_FUNCDECL_RPL (openat, int,
+ (int fd, char const *file, int flags, /* mode_t mode */ ...)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (openat, int,
+ (int fd, char const *file, int flags, /* mode_t mode */ ...));
+# else
+# if !@HAVE_OPENAT@
+_GL_FUNCDECL_SYS (openat, int,
+ (int fd, char const *file, int flags, /* mode_t mode */ ...)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (openat, int,
+ (int fd, char const *file, int flags, /* mode_t mode */ ...));
+# endif
+_GL_CXXALIASWARN (openat);
+#elif defined GNULIB_POSIXCHECK
+# undef openat
+# if HAVE_RAW_DECL_OPENAT
+_GL_WARN_ON_USE (openat, "openat is not portable - "
+ "use gnulib module openat for portability");
+# endif
+#endif
+
+
+/* Fix up the FD_* macros, only known to be missing on mingw. */
+
+#ifndef FD_CLOEXEC
+# define FD_CLOEXEC 1
+#endif
+
+/* Fix up the supported F_* macros. Intentionally leave other F_*
+ macros undefined. Only known to be missing on mingw. */
+
+#ifndef F_DUPFD_CLOEXEC
+# define F_DUPFD_CLOEXEC 0x40000000
+/* Witness variable: 1 if gnulib defined F_DUPFD_CLOEXEC, 0 otherwise. */
+# define GNULIB_defined_F_DUPFD_CLOEXEC 1
+#else
+# define GNULIB_defined_F_DUPFD_CLOEXEC 0
+#endif
+
+#ifndef F_DUPFD
+# define F_DUPFD 1
+#endif
+
+#ifndef F_GETFD
+# define F_GETFD 2
+#endif
+
+/* Fix up the O_* macros. */
+
+#if !defined O_DIRECT && defined O_DIRECTIO
+/* Tru64 spells it `O_DIRECTIO'. */
+# define O_DIRECT O_DIRECTIO
+#endif
+
+#if !defined O_CLOEXEC && defined O_NOINHERIT
+/* Mingw spells it `O_NOINHERIT'. Intentionally leave it
+ undefined if not available. */
+# define O_CLOEXEC O_NOINHERIT
+#endif
+
+#ifndef O_CLOEXEC
+# define O_CLOEXEC 0
+#endif
+
+#ifndef O_DIRECT
+# define O_DIRECT 0
+#endif
+
+#ifndef O_DIRECTORY
+# define O_DIRECTORY 0
+#endif
+
+#ifndef O_DSYNC
+# define O_DSYNC 0
+#endif
+
+#ifndef O_EXEC
+# define O_EXEC O_RDONLY /* This is often close enough in older systems. */
+#endif
+
+#ifndef O_NDELAY
+# define O_NDELAY 0
+#endif
+
+#ifndef O_NOATIME
+# define O_NOATIME 0
+#endif
+
+#ifndef O_NONBLOCK
+# define O_NONBLOCK O_NDELAY
+#endif
+
+#ifndef O_NOCTTY
+# define O_NOCTTY 0
+#endif
+
+#ifndef O_NOFOLLOW
+# define O_NOFOLLOW 0
+#endif
+
+#ifndef O_NOLINKS
+# define O_NOLINKS 0
+#endif
+
+#ifndef O_RSYNC
+# define O_RSYNC 0
+#endif
+
+#ifndef O_SEARCH
+# define O_SEARCH O_RDONLY /* This is often close enough in older systems. */
+#endif
+
+#ifndef O_SYNC
+# define O_SYNC 0
+#endif
+
+#ifndef O_TTY_INIT
+# define O_TTY_INIT 0
+#endif
+
+/* For systems that distinguish between text and binary I/O.
+ O_BINARY is usually declared in fcntl.h */
+#if !defined O_BINARY && defined _O_BINARY
+ /* For MSC-compatible compilers. */
+# define O_BINARY _O_BINARY
+# define O_TEXT _O_TEXT
+#endif
+
+#if defined __BEOS__ || defined __HAIKU__
+ /* BeOS 5 and Haiku have O_BINARY and O_TEXT, but they have no effect. */
+# undef O_BINARY
+# undef O_TEXT
+#endif
+
+#ifndef O_BINARY
+# define O_BINARY 0
+# define O_TEXT 0
+#endif
+
+/* Fix up the AT_* macros. */
+
+/* Work around a bug in Solaris 9 and 10: AT_FDCWD is positive. Its
+ value exceeds INT_MAX, so its use as an int doesn't conform to the
+ C standard, and GCC and Sun C complain in some cases. If the bug
+ is present, undef AT_FDCWD here, so it can be redefined below. */
+#if 0 < AT_FDCWD && AT_FDCWD == 0xffd19553
+# undef AT_FDCWD
+#endif
+
+/* Use the same bit pattern as Solaris 9, but with the proper
+ signedness. The bit pattern is important, in case this actually is
+ Solaris with the above workaround. */
+#ifndef AT_FDCWD
+# define AT_FDCWD (-3041965)
+#endif
+
+/* Use the same values as Solaris 9. This shouldn't matter, but
+ there's no real reason to differ. */
+#ifndef AT_SYMLINK_NOFOLLOW
+# define AT_SYMLINK_NOFOLLOW 4096
+#endif
+
+#ifndef AT_REMOVEDIR
+# define AT_REMOVEDIR 1
+#endif
+
+/* Solaris 9 lacks these two, so just pick unique values. */
+#ifndef AT_SYMLINK_FOLLOW
+# define AT_SYMLINK_FOLLOW 2
+#endif
+
+#ifndef AT_EACCESS
+# define AT_EACCESS 4
+#endif
+
+
+#endif /* _GL_FCNTL_H */
+#endif /* _GL_FCNTL_H */
+#endif
diff --git a/lib/gl/tests/getpagesize.c b/lib/gl/tests/getpagesize.c
index cc2526870f..d7c1ba807a 100644
--- a/lib/gl/tests/getpagesize.c
+++ b/lib/gl/tests/getpagesize.c
@@ -1,6 +1,6 @@
/* getpagesize emulation for systems where it cannot be done in a C macro.
- Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/init.sh b/lib/gl/tests/init.sh
index 14f3b198d4..71c6516962 100644
--- a/lib/gl/tests/init.sh
+++ b/lib/gl/tests/init.sh
@@ -1,6 +1,6 @@
# source this file; set up for tests
-# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2009-2011 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -74,10 +74,10 @@ Exit () { set +e; (exit $1); exit $1; }
# the reason for skip/failure to console, rather than to the .log files.
: ${stderr_fileno_=2}
-warn_() { echo "$@" 1>&$stderr_fileno_; }
-fail_() { warn_ "$ME_: failed test: $@"; Exit 1; }
-skip_() { warn_ "$ME_: skipped test: $@"; Exit 77; }
-framework_failure_() { warn_ "$ME_: set-up failure: $@"; Exit 99; }
+warn_ () { echo "$@" 1>&$stderr_fileno_; }
+fail_ () { warn_ "$ME_: failed test: $@"; Exit 1; }
+skip_ () { warn_ "$ME_: skipped test: $@"; Exit 77; }
+framework_failure_ () { warn_ "$ME_: set-up failure: $@"; Exit 99; }
# Sanitize this shell to POSIX mode, if possible.
DUALCASE=1; export DUALCASE
@@ -111,7 +111,7 @@ fi
# Eval this code in a subshell to determine a shell's suitability.
# 10 - passes all tests; ok to use
-# 9 - ok, but enabling "set -x" corrupts application stderr; prefer higher score
+# 9 - ok, but enabling "set -x" corrupts app stderr; prefer higher score
# ? - not ok
gl_shell_test_script_='
test $(echo y) = y || exit 1
@@ -193,7 +193,7 @@ fi
test -n "$EXEEXT" && shopt -s expand_aliases
# Enable glibc's malloc-perturbing option.
-# This is cheap and useful for exposing code that depends on the fact that
+# This is useful for exposing code that depends on the fact that
# malloc-related functions often return memory that is mostly zeroed.
# If you have the time and cycles, use valgrind to do an even better job.
: ${MALLOC_PERTURB_=87}
@@ -202,22 +202,22 @@ export MALLOC_PERTURB_
# This is a stub function that is run upon trap (upon regular exit and
# interrupt). Override it with a per-test function, e.g., to unmount
# a partition, or to undo any other global state changes.
-cleanup_() { :; }
+cleanup_ () { :; }
if ( diff --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then
- compare() { diff -u "$@"; }
+ compare () { diff -u "$@"; }
elif ( cmp --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then
- compare() { cmp -s "$@"; }
+ compare () { cmp -s "$@"; }
else
- compare() { cmp "$@"; }
+ compare () { cmp "$@"; }
fi
# An arbitrary prefix to help distinguish test directories.
-testdir_prefix_() { printf gt; }
+testdir_prefix_ () { printf gt; }
# Run the user-overridable cleanup_ function, remove the temporary
# directory and exit with the incoming value of $?.
-remove_tmp_()
+remove_tmp_ ()
{
__st=$?
cleanup_
@@ -233,7 +233,7 @@ remove_tmp_()
# contains only the specified bytes (see the case stmt below), then print
# a space-separated list of those names and return 0. Otherwise, don't
# print anything and return 1. Naming constraints apply also to DIR.
-find_exe_basenames_()
+find_exe_basenames_ ()
{
feb_dir_=$1
feb_fail_=0
@@ -245,6 +245,9 @@ find_exe_basenames_()
# below, just skip it.
test "x$feb_file_" = "x$feb_dir_/*.exe" && test ! -f "$feb_file_" \
&& continue
+ # Exempt [.exe, since we can't create a function by that name, yet
+ # we can't invoke [ by PATH search anyways due to shell builtins.
+ test "x$feb_file_" = "x$feb_dir_/[.exe" && continue
case $feb_file_ in
*[!-a-zA-Z/0-9_.+]*) feb_fail_=1; break;;
*) # Remove leading file name components as well as the .exe suffix.
@@ -263,7 +266,7 @@ find_exe_basenames_()
# PROG that simply invokes PROG.exe, then return 0. If any selected
# file name or the directory name, $1, contains an unexpected character,
# define no alias and return 1.
-create_exe_shims_()
+create_exe_shims_ ()
{
case $EXEEXT in
'') return 0 ;;
@@ -272,7 +275,7 @@ create_exe_shims_()
esac
base_names_=`find_exe_basenames_ $1` \
- || { echo "$0 (exe_shim): skipping directory: $1" 1>&2; return 1; }
+ || { echo "$0 (exe_shim): skipping directory: $1" 1>&2; return 0; }
if test -n "$base_names_"; then
for base_ in $base_names_; do
@@ -285,7 +288,7 @@ create_exe_shims_()
# Use this function to prepend to PATH an absolute name for each
# specified, possibly-$initial_cwd_-relative, directory.
-path_prepend_()
+path_prepend_ ()
{
while test $# != 0; do
path_dir_=$1
@@ -308,7 +311,7 @@ path_prepend_()
export PATH
}
-setup_()
+setup_ ()
{
if test "$VERBOSE" = yes; then
# Test whether set -x may cause the selected shell to corrupt an
@@ -324,6 +327,7 @@ setup_()
fi
initial_cwd_=$PWD
+ fail=0
pfx_=`testdir_prefix_`
test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \
@@ -360,7 +364,7 @@ setup_()
# - make only $MAX_TRIES_ attempts
# Helper function. Print $N pseudo-random bytes from a-zA-Z0-9.
-rand_bytes_()
+rand_bytes_ ()
{
n_=$1
@@ -392,7 +396,7 @@ rand_bytes_()
| LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_
}
-mktempd_()
+mktempd_ ()
{
case $# in
2);;
@@ -413,11 +417,10 @@ mktempd_()
case $template_ in
*XXXX) ;;
- *) fail_ "invalid template: $template_ (must have a suffix of at least 4 X's)";;
+ *) fail_ \
+ "invalid template: $template_ (must have a suffix of at least 4 X's)";;
esac
- fail=0
-
# First, try to use mktemp.
d=`unset TMPDIR; mktemp -d -t -p "$destdir_" "$template_" 2>/dev/null` \
|| fail=1
diff --git a/lib/gl/tests/intprops.h b/lib/gl/tests/intprops.h
index 0c2787582f..58b1b3fbf4 100644
--- a/lib/gl/tests/intprops.h
+++ b/lib/gl/tests/intprops.h
@@ -1,7 +1,6 @@
/* intprops.h -- properties of integer types
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009, 2010 Free Software
- Foundation, Inc.
+ Copyright (C) 2001-2005, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -50,11 +49,11 @@
? (t) 0 \
: TYPE_SIGNED_MAGNITUDE (t) \
? ~ (t) 0 \
- : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
+ : ~ TYPE_MAXIMUM (t)))
# define TYPE_MAXIMUM(t) \
((t) (! TYPE_SIGNED (t) \
? (t) -1 \
- : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
+ : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
/* Return zero if T can be determined to be an unsigned type.
Otherwise, return 1.
diff --git a/lib/gl/tests/macros.h b/lib/gl/tests/macros.h
index 11db5a8af0..89226758ec 100644
--- a/lib/gl/tests/macros.h
+++ b/lib/gl/tests/macros.h
@@ -1,5 +1,5 @@
/* Common macros used by gnulib tests.
- Copyright (C) 2006-2010 Free Software Foundation, Inc.
+ Copyright (C) 2006-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/signature.h b/lib/gl/tests/signature.h
index 6e15c43a2a..8256989d0e 100644
--- a/lib/gl/tests/signature.h
+++ b/lib/gl/tests/signature.h
@@ -1,5 +1,5 @@
/* Macro for checking that a function declaration is compliant.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-alloca-opt.c b/lib/gl/tests/test-alloca-opt.c
index cfbecafcb9..5aa16455d0 100644
--- a/lib/gl/tests/test-alloca-opt.c
+++ b/lib/gl/tests/test-alloca-opt.c
@@ -1,5 +1,5 @@
/* Test of optional automatic memory allocation.
- Copyright (C) 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-binary-io.c b/lib/gl/tests/test-binary-io.c
index 125150b21f..8e5d193f69 100644
--- a/lib/gl/tests/test-binary-io.c
+++ b/lib/gl/tests/test-binary-io.c
@@ -1,5 +1,5 @@
/* Test of binary mode I/O.
- Copyright (C) 2005, 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-byteswap.c b/lib/gl/tests/test-byteswap.c
index 0c036052f7..e9878b3c7b 100644
--- a/lib/gl/tests/test-byteswap.c
+++ b/lib/gl/tests/test-byteswap.c
@@ -1,5 +1,5 @@
/* Test of <byteswap.h> substitute.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-c-ctype.c b/lib/gl/tests/test-c-ctype.c
index ebe594dd4f..9d748ffe88 100644
--- a/lib/gl/tests/test-c-ctype.c
+++ b/lib/gl/tests/test-c-ctype.c
@@ -1,5 +1,5 @@
/* Test of character handling in C locale.
- Copyright (C) 2005, 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-errno.c b/lib/gl/tests/test-errno.c
index 129b236fe9..7851c22d0f 100644
--- a/lib/gl/tests/test-errno.c
+++ b/lib/gl/tests/test-errno.c
@@ -1,5 +1,5 @@
/* Test of <errno.h> substitute.
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gl/tests/test-wchar.c b/lib/gl/tests/test-fcntl-h.c
index 2a03d6b669..dd20fbb406 100644
--- a/gl/tests/test-wchar.c
+++ b/lib/gl/tests/test-fcntl-h.c
@@ -1,5 +1,5 @@
-/* Test of <wchar.h> substitute.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+/* Test of <fcntl.h> substitute.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -18,17 +18,18 @@
#include <config.h>
-#include <wchar.h>
+#include <fcntl.h>
-#include "verify.h"
+/* Check that the various O_* macros are defined. */
+int o = O_DIRECT | O_DIRECTORY | O_DSYNC | O_NDELAY | O_NOATIME | O_NONBLOCK
+ | O_NOCTTY | O_NOFOLLOW | O_NOLINKS | O_RSYNC | O_SYNC | O_TTY_INIT
+ | O_BINARY | O_TEXT;
-/* Check that the types wchar_t and wint_t are defined. */
-wchar_t a = 'c';
-wint_t b = 'x';
+/* Check that the various SEEK_* macros are defined. */
+int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
-/* Check that NULL can be passed through varargs as a pointer type,
- per POSIX 2008. */
-verify (sizeof NULL == sizeof (void *));
+/* Check that the FD_* macros are defined. */
+int fd = FD_CLOEXEC;
int
main (void)
diff --git a/lib/gl/tests/test-fseeko.c b/lib/gl/tests/test-fseeko.c
index be2a78dce1..ad5eec8de9 100644
--- a/lib/gl/tests/test-fseeko.c
+++ b/lib/gl/tests/test-fseeko.c
@@ -1,5 +1,5 @@
/* Test of fseeko() function.
- Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-ftello.c b/lib/gl/tests/test-ftello.c
index 5fae570f28..636da81190 100644
--- a/lib/gl/tests/test-ftello.c
+++ b/lib/gl/tests/test-ftello.c
@@ -1,5 +1,5 @@
/* Test of ftello() function.
- Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-ftello3.c b/lib/gl/tests/test-ftello3.c
index b07ba64610..50d4b882fd 100644
--- a/lib/gl/tests/test-ftello3.c
+++ b/lib/gl/tests/test-ftello3.c
@@ -1,5 +1,5 @@
/* Test of ftello() function.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-func.c b/lib/gl/tests/test-func.c
index 476e04dd9e..19de6d3ada 100644
--- a/lib/gl/tests/test-func.c
+++ b/lib/gl/tests/test-func.c
@@ -1,5 +1,5 @@
/* Test whether __func__ is available
- Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-memchr.c b/lib/gl/tests/test-memchr.c
index 05e1bfaed2..a11f6cdb97 100644
--- a/lib/gl/tests/test-memchr.c
+++ b/lib/gl/tests/test-memchr.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2010 Free Software Foundation, Inc.
+ * Copyright (C) 2008-2011 Free Software Foundation, Inc.
* Written by Eric Blake and Bruno Haible
*
* This program is free software: you can redistribute it and/or modify
diff --git a/lib/gl/tests/test-netdb.c b/lib/gl/tests/test-netdb.c
index 697bbc8dbf..13a8925fbe 100644
--- a/lib/gl/tests/test-netdb.c
+++ b/lib/gl/tests/test-netdb.c
@@ -1,5 +1,5 @@
/* Test of <netdb.h> substitute.
- Copyright (C) 2007-2008, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2008, 2010-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-read-file.c b/lib/gl/tests/test-read-file.c
index daa61668c6..de7a0bb9f3 100644
--- a/lib/gl/tests/test-read-file.c
+++ b/lib/gl/tests/test-read-file.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006-2007, 2010 Free Software Foundation, Inc.
+ * Copyright (C) 2006-2007, 2010-2011 Free Software Foundation, Inc.
* Written by Simon Josefsson
*
* This program is free software: you can redistribute it and/or modify
diff --git a/lib/gl/tests/test-snprintf.c b/lib/gl/tests/test-snprintf.c
index 62a411bf91..95a352dc5e 100644
--- a/lib/gl/tests/test-snprintf.c
+++ b/lib/gl/tests/test-snprintf.c
@@ -1,5 +1,5 @@
/* Test of snprintf() function.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -34,15 +34,16 @@ main (int argc, char *argv[])
int size;
int retval;
+ retval = snprintf (NULL, 0, "%d", 12345);
+ ASSERT (retval == 5);
+
for (size = 0; size <= 8; size++)
{
memcpy (buf, "DEADBEEF", 8);
retval = snprintf (buf, size, "%d", 12345);
+ ASSERT (retval == 5);
if (size < 6)
{
-#if CHECK_SNPRINTF_POSIX
- ASSERT (retval < 0 || retval >= size);
-#endif
if (size > 0)
{
ASSERT (memcmp (buf, "12345", size - 1) == 0);
@@ -55,7 +56,6 @@ main (int argc, char *argv[])
}
else
{
- ASSERT (retval == 5);
ASSERT (memcmp (buf, "12345\0EF", 8) == 0);
}
}
diff --git a/lib/gl/tests/test-sockets.c b/lib/gl/tests/test-sockets.c
index ab5460ad46..0170d3754d 100644
--- a/lib/gl/tests/test-sockets.c
+++ b/lib/gl/tests/test-sockets.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ * Copyright (C) 2008-2011 Free Software Foundation, Inc.
* Written by Simon Josefsson.
*
* This program is free software: you can redistribute it and/or modify
diff --git a/lib/gl/tests/test-stdbool.c b/lib/gl/tests/test-stdbool.c
index 2103d8bab9..e115ba2940 100644
--- a/lib/gl/tests/test-stdbool.c
+++ b/lib/gl/tests/test-stdbool.c
@@ -1,5 +1,5 @@
/* Test of <stdbool.h> substitute.
- Copyright (C) 2002-2007, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -52,23 +52,28 @@
/* Several tests cannot be guaranteed with gnulib's <stdbool.h>, at
least, not for all compilers and compiler options. */
-#if HAVE_STDBOOL_H || defined __GNUC__
+#if HAVE_STDBOOL_H || 3 <= __GNUC__
struct s { _Bool s: 1; _Bool t; } s;
#endif
char a[true == 1 ? 1 : -1];
char b[false == 0 ? 1 : -1];
char c[__bool_true_false_are_defined == 1 ? 1 : -1];
-#if HAVE_STDBOOL_H || defined __GNUC__ /* See above. */
+#if HAVE_STDBOOL_H || 3 <= __GNUC__ /* See above. */
char d[(bool) 0.5 == true ? 1 : -1];
-# ifdef ADDRESS_CHECK_OKAY
+# ifdef ADDRESS_CHECK_OKAY /* Avoid gcc warning. */
+/* C99 may plausibly be interpreted as not requiring support for a cast from
+ a variable's address to bool in a static initializer. So treat it like a
+ GCC extension. */
+# ifdef __GNUC__
bool e = &s;
+# endif
# endif
char f[(_Bool) 0.0 == false ? 1 : -1];
#endif
char g[true];
char h[sizeof (_Bool)];
-#if HAVE_STDBOOL_H || defined __GNUC__ /* See above. */
+#if HAVE_STDBOOL_H || 3 <= __GNUC__ /* See above. */
char i[sizeof s.t];
#endif
enum { j = false, k = true, l = false * true, m = true * 256 };
@@ -85,11 +90,29 @@ _Bool *pq = &q;
int
main ()
{
+ int error = 0;
+
+#if HAVE_STDBOOL_H || 3 <= __GNUC__ /* See above. */
+# ifdef ADDRESS_CHECK_OKAY /* Avoid gcc warning. */
+ /* A cast from a variable's address to bool is valid in expressions. */
+ {
+ bool e1 = &s;
+ if (!e1)
+ error = 1;
+ }
+# endif
+#endif
+
/* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
reported by James Lemley on 2005-10-05; see
http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
This is a runtime test, since a corresponding compile-time
test would rely on initializer extensions. */
- char digs[] = "0123456789";
- return &(digs + 5)[-2 + (bool) 1] != &digs[4];
+ {
+ char digs[] = "0123456789";
+ if (&(digs + 5)[-2 + (bool) 1] != &digs[4])
+ error = 1;
+ }
+
+ return error;
}
diff --git a/lib/gl/tests/test-stddef.c b/lib/gl/tests/test-stddef.c
index 2c392c7547..c929af837a 100644
--- a/lib/gl/tests/test-stddef.c
+++ b/lib/gl/tests/test-stddef.c
@@ -1,5 +1,5 @@
/* Test of <stddef.h> substitute.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-stdint.c b/lib/gl/tests/test-stdint.c
index d64057a256..f606cc3e24 100644
--- a/lib/gl/tests/test-stdint.c
+++ b/lib/gl/tests/test-stdint.c
@@ -1,5 +1,5 @@
/* Test of <stdint.h> substitute.
- Copyright (C) 2006-2010 Free Software Foundation, Inc.
+ Copyright (C) 2006-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-stdio.c b/lib/gl/tests/test-stdio.c
index 87100576f0..7e7a206b7c 100644
--- a/lib/gl/tests/test-stdio.c
+++ b/lib/gl/tests/test-stdio.c
@@ -1,5 +1,5 @@
/* Test of <stdio.h> substitute.
- Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-stdlib.c b/lib/gl/tests/test-stdlib.c
index 1e7956b68c..210aab4055 100644
--- a/lib/gl/tests/test-stdlib.c
+++ b/lib/gl/tests/test-stdlib.c
@@ -1,5 +1,5 @@
/* Test of <stdlib.h> substitute.
- Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-string.c b/lib/gl/tests/test-string.c
index 019a8174ac..54c49a9735 100644
--- a/lib/gl/tests/test-string.c
+++ b/lib/gl/tests/test-string.c
@@ -1,5 +1,5 @@
/* Test of <string.h> substitute.
- Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-strings.c b/lib/gl/tests/test-strings.c
index caba95cd2a..ee2ad62714 100644
--- a/lib/gl/tests/test-strings.c
+++ b/lib/gl/tests/test-strings.c
@@ -1,5 +1,5 @@
/* Test of <strings.h> substitute.
- Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-strverscmp.c b/lib/gl/tests/test-strverscmp.c
index d7348150e1..9a9da1025e 100644
--- a/lib/gl/tests/test-strverscmp.c
+++ b/lib/gl/tests/test-strverscmp.c
@@ -1,5 +1,5 @@
/* Test of strverscmp() function.
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-sys_socket.c b/lib/gl/tests/test-sys_socket.c
index e976ff6a7b..8f323ca1d9 100644
--- a/lib/gl/tests/test-sys_socket.c
+++ b/lib/gl/tests/test-sys_socket.c
@@ -1,5 +1,5 @@
/* Test of <sys/socket.h> substitute.
- Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-sys_stat.c b/lib/gl/tests/test-sys_stat.c
index 5f1aacd1cc..cd07d86e87 100644
--- a/lib/gl/tests/test-sys_stat.c
+++ b/lib/gl/tests/test-sys_stat.c
@@ -1,5 +1,5 @@
/* Test of <sys/stat.h> substitute.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-sys_wait.h b/lib/gl/tests/test-sys_wait.h
index bb10450867..3c9b32293b 100644
--- a/lib/gl/tests/test-sys_wait.h
+++ b/lib/gl/tests/test-sys_wait.h
@@ -1,5 +1,5 @@
/* Test of macros shared between <sys/wait.h> and <stdlib.h>.
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-time.c b/lib/gl/tests/test-time.c
index 8e250bd2d5..0c78f36c66 100644
--- a/lib/gl/tests/test-time.c
+++ b/lib/gl/tests/test-time.c
@@ -1,5 +1,5 @@
/* Test of <time.h> substitute.
- Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-unistd.c b/lib/gl/tests/test-unistd.c
index ec02eeefca..be1ae06910 100644
--- a/lib/gl/tests/test-unistd.c
+++ b/lib/gl/tests/test-unistd.c
@@ -1,5 +1,5 @@
/* Test of <unistd.h> substitute.
- Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-vasnprintf.c b/lib/gl/tests/test-vasnprintf.c
index 15401eb4ca..6b2a0ff05a 100644
--- a/lib/gl/tests/test-vasnprintf.c
+++ b/lib/gl/tests/test-vasnprintf.c
@@ -1,5 +1,5 @@
/* Test of vasnprintf() and asnprintf() functions.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-vasprintf.c b/lib/gl/tests/test-vasprintf.c
index cfde4f49c7..6882d18d62 100644
--- a/lib/gl/tests/test-vasprintf.c
+++ b/lib/gl/tests/test-vasprintf.c
@@ -1,5 +1,5 @@
/* Test of vasprintf() and asprintf() functions.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-verify.c b/lib/gl/tests/test-verify.c
index 3f89ba9058..512c021b7d 100644
--- a/lib/gl/tests/test-verify.c
+++ b/lib/gl/tests/test-verify.c
@@ -1,6 +1,6 @@
/* Test the "verify" module.
- Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/tests/test-vsnprintf.c b/lib/gl/tests/test-vsnprintf.c
index 1bfa5540f7..5060836e78 100644
--- a/lib/gl/tests/test-vsnprintf.c
+++ b/lib/gl/tests/test-vsnprintf.c
@@ -1,5 +1,5 @@
/* Test of vsnprintf() function.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -47,15 +47,16 @@ main (int argc, char *argv[])
int size;
int retval;
+ retval = my_snprintf (NULL, 0, "%d", 12345);
+ ASSERT (retval == 5);
+
for (size = 0; size <= 8; size++)
{
memcpy (buf, "DEADBEEF", 8);
retval = my_snprintf (buf, size, "%d", 12345);
+ ASSERT (retval == 5);
if (size < 6)
{
-#if CHECK_VSNPRINTF_POSIX
- ASSERT (retval < 0 || retval >= size);
-#endif
if (size > 0)
{
ASSERT (memcmp (buf, "12345", size - 1) == 0);
@@ -68,7 +69,6 @@ main (int argc, char *argv[])
}
else
{
- ASSERT (retval == 5);
ASSERT (memcmp (buf, "12345\0EF", 8) == 0);
}
}
diff --git a/lib/gl/tests/zerosize-ptr.h b/lib/gl/tests/zerosize-ptr.h
index cfab200871..beeb3da3e0 100644
--- a/lib/gl/tests/zerosize-ptr.h
+++ b/lib/gl/tests/zerosize-ptr.h
@@ -1,5 +1,5 @@
/* Return a pointer to a zero-size object in memory.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/lib/gl/time.in.h b/lib/gl/time.in.h
index 9d0d68031b..8c179150b6 100644
--- a/lib/gl/time.in.h
+++ b/lib/gl/time.in.h
@@ -1,6 +1,6 @@
/* A more-standard <time.h>.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -69,13 +69,16 @@
extern "C" {
# endif
-# undef timespec
-# define timespec rpl_timespec
+# if !GNULIB_defined_struct_timespec
+# undef timespec
+# define timespec rpl_timespec
struct timespec
{
time_t tv_sec;
long int tv_nsec;
};
+# define GNULIB_defined_struct_timespec 1
+# endif
# ifdef __cplusplus
}
@@ -84,6 +87,7 @@ struct timespec
# endif
# endif
+# if !GNULIB_defined_struct_time_t_must_be_integral
/* Per http://austingroupbugs.net/view.php?id=327, POSIX requires
time_t to be an integer type, even though C99 permits floating
point. We don't know of any implementation that uses floating
@@ -92,6 +96,8 @@ struct timespec
struct __time_t_must_be_integral {
unsigned int __floating_time_t_unsupported : (time_t) 1;
};
+# define GNULIB_defined_struct_time_t_must_be_integral 1
+# endif
/* Sleep for at least RQTP seconds unless interrupted, If interrupted,
return -1 and store the remaining time into RMTP. See
@@ -147,7 +153,7 @@ _GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
_GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result));
# else
-# if ! @HAVE_LOCALTIME_R@
+# if ! @HAVE_DECL_LOCALTIME_R@
_GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result)
_GL_ARG_NONNULL ((1, 2)));
@@ -155,7 +161,9 @@ _GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
_GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result));
# endif
+# if @HAVE_DECL_LOCALTIME_R@
_GL_CXXALIASWARN (localtime_r);
+# endif
# if @REPLACE_LOCALTIME_R@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef gmtime_r
@@ -167,7 +175,7 @@ _GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
_GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result));
# else
-# if ! @HAVE_LOCALTIME_R@
+# if ! @HAVE_DECL_LOCALTIME_R@
_GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result)
_GL_ARG_NONNULL ((1, 2)));
@@ -175,7 +183,9 @@ _GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
_GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result));
# endif
+# if @HAVE_DECL_LOCALTIME_R@
_GL_CXXALIASWARN (gmtime_r);
+# endif
# endif
/* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store
diff --git a/lib/gl/time_r.c b/lib/gl/time_r.c
index 591bc02b23..35c74c895d 100644
--- a/lib/gl/time_r.c
+++ b/lib/gl/time_r.c
@@ -1,6 +1,6 @@
/* Reentrant time functions like localtime_r.
- Copyright (C) 2003, 2006-2007, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006-2007, 2010-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/lib/gl/unistd.in.h b/lib/gl/unistd.in.h
index 255869af1e..1713c33e00 100644
--- a/lib/gl/unistd.in.h
+++ b/lib/gl/unistd.in.h
@@ -1,5 +1,5 @@
/* Substitute for and wrapper around <unistd.h>.
- Copyright (C) 2003-2010 Free Software Foundation, Inc.
+ Copyright (C) 2003-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -88,9 +88,11 @@
# include <io.h>
#endif
-/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>. */
+/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.
+ NonStop Kernel declares gethostname in <netdb.h>, not in <unistd.h>. */
/* But avoid namespace pollution on glibc systems. */
-#if @GNULIB_GETDOMAINNAME@ && (defined _AIX || defined __osf__) \
+#if ((@GNULIB_GETDOMAINNAME@ && (defined _AIX || defined __osf__)) \
+ || (@GNULIB_GETHOSTNAME@ && defined __TANDEM)) \
&& !defined __GLIBC__
# include <netdb.h>
#endif
@@ -435,6 +437,10 @@ _GL_EXTERN_C void _gl_unregister_fd (int fd);
_GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd);
_GL_EXTERN_C const char *_gl_directory_name (int fd);
+# else
+# if !@HAVE_DECL_FCHDIR@
+_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
+# endif
# endif
_GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/));
_GL_CXXALIASWARN (fchdir);
@@ -650,7 +656,8 @@ _GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len));
_GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len)
_GL_ARG_NONNULL ((1)));
# endif
-/* Need to cast, because on Solaris 10 systems, the second parameter is
+/* Need to cast, because on Solaris 10 and OSF/1 5.1 systems, the second
+ parameter is
int len. */
_GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len));
# endif
@@ -707,13 +714,22 @@ _GL_WARN_ON_USE (getlogin, "getlogin is unportable - "
${LOGNAME-$USER} on Unix platforms,
$USERNAME on native Windows platforms.
*/
-# if !@HAVE_DECL_GETLOGIN_R@
+# if @REPLACE_GETLOGIN_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define getlogin_r rpl_getlogin_r
+# endif
+_GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (getlogin_r, int, (char *name, size_t size));
+# else
+# if !@HAVE_DECL_GETLOGIN_R@
_GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size)
_GL_ARG_NONNULL ((1)));
-# endif
+# endif
/* Need to cast, because on Solaris 10 systems, the second argument is
int size. */
_GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size));
+# endif
_GL_CXXALIASWARN (getlogin_r);
#elif defined GNULIB_POSIXCHECK
# undef getlogin_r
@@ -780,11 +796,14 @@ _GL_CXXALIAS_RPL (getpagesize, int, (void));
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define getpagesize() _gl_getpagesize ()
# else
+# if !GNULIB_defined_getpagesize_function
static inline int
getpagesize ()
{
return _gl_getpagesize ();
}
+# define GNULIB_defined_getpagesize_function 1
+# endif
# endif
# endif
# endif
@@ -972,6 +991,24 @@ _GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some "
#endif
+#if @GNULIB_PIPE@
+/* Create a pipe, defaulting to O_BINARY mode.
+ Store the read-end as fd[0] and the write-end as fd[1].
+ Return 0 upon success, or -1 with errno set upon failure. */
+# if !@HAVE_PIPE@
+_GL_FUNCDECL_SYS (pipe, int, (int fd[2]) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pipe, int, (int fd[2]));
+_GL_CXXALIASWARN (pipe);
+#elif defined GNULIB_POSIXCHECK
+# undef pipe
+# if HAVE_RAW_DECL_PIPE
+_GL_WARN_ON_USE (pipe, "pipe is unportable - "
+ "use gnulib module pipe-posix for portability");
+# endif
+#endif
+
+
#if @GNULIB_PIPE2@
/* Create a pipe, applying the given flags when opening the read-end of the
pipe and the write-end of the pipe.
@@ -1226,7 +1263,7 @@ _GL_FUNCDECL_RPL (ttyname_r, int,
_GL_CXXALIAS_RPL (ttyname_r, int,
(int fd, char *buf, size_t buflen));
# else
-# if !@HAVE_TTYNAME_R@
+# if !@HAVE_DECL_TTYNAME_R@
_GL_FUNCDECL_SYS (ttyname_r, int,
(int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
# endif
diff --git a/lib/gl/vasnprintf.c b/lib/gl/vasnprintf.c
index 8585e84156..94299ebe01 100644
--- a/lib/gl/vasnprintf.c
+++ b/lib/gl/vasnprintf.c
@@ -1,5 +1,5 @@
/* vsprintf with automatic memory allocation.
- Copyright (C) 1999, 2002-2010 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -1753,8 +1753,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
return NULL;
#define CLEANUP() \
- free (d.dir); \
- if (a.arg) \
+ if (d.dir != d.direct_alloc_dir) \
+ free (d.dir); \
+ if (a.arg != a.direct_alloc_arg) \
free (a.arg);
if (PRINTF_FETCHARGS (args, &a) < 0)
diff --git a/lib/gl/vasnprintf.h b/lib/gl/vasnprintf.h
index 6bf9c59cd9..740f7e977d 100644
--- a/lib/gl/vasnprintf.h
+++ b/lib/gl/vasnprintf.h
@@ -1,5 +1,5 @@
/* vsprintf with automatic memory allocation.
- Copyright (C) 2002-2004, 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2002-2004, 2007-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -24,16 +24,16 @@
/* Get size_t. */
#include <stddef.h>
-#ifndef __attribute__
/* The __attribute__ feature is available in gcc versions 2.5 and later.
The __-protected variants of the attributes 'format' and 'printf' are
accepted by gcc versions 2.6.4 (effectively 2.7) and later.
- We enable __attribute__ only if these are supported too, because
+ We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
gnulib and libintl do '#define printf __printf__' when they override
the 'printf' function. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-# define __attribute__(Spec) /* empty */
-# endif
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+#else
+# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
#endif
#ifdef __cplusplus
@@ -69,9 +69,9 @@ extern "C" {
# define vasnprintf rpl_vasnprintf
#endif
extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 3, 4)));
+ _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 4));
extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 3, 0)));
+ _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 0));
#ifdef __cplusplus
}
diff --git a/lib/gl/vasprintf.c b/lib/gl/vasprintf.c
index b8c52a9ec8..86d032811b 100644
--- a/lib/gl/vasprintf.c
+++ b/lib/gl/vasprintf.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 1999, 2002, 2006-2010 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2006-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/lib/gl/verify.h b/lib/gl/verify.h
index a29f8666df..d51ba68274 100644
--- a/lib/gl/verify.h
+++ b/lib/gl/verify.h
@@ -1,6 +1,6 @@
/* Compile-time assert-like macros.
- Copyright (C) 2005-2006, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/lib/gl/vsnprintf.c b/lib/gl/vsnprintf.c
index 2ec3cae9d7..38c0f46cc6 100644
--- a/lib/gl/vsnprintf.c
+++ b/lib/gl/vsnprintf.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 2004, 2006-2010 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2006-2011 Free Software Foundation, Inc.
Written by Simon Josefsson and Yoann Vandoorselaere <yoann@prelude-ids.org>.
This program is free software; you can redistribute it and/or modify
diff --git a/lib/gl/w32sock.h b/lib/gl/w32sock.h
index 1bcee466d6..50e9cb606e 100644
--- a/lib/gl/w32sock.h
+++ b/lib/gl/w32sock.h
@@ -1,6 +1,6 @@
/* w32sock.h --- internal auxilliary functions for Windows socket functions
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/lib/gl/wchar.in.h b/lib/gl/wchar.in.h
deleted file mode 100644
index edae751f5e..0000000000
--- a/lib/gl/wchar.in.h
+++ /dev/null
@@ -1,433 +0,0 @@
-/* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
-
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-/* Written by Eric Blake. */
-
-/*
- * ISO C 99 <wchar.h> for platforms that have issues.
- * <http://www.opengroup.org/susv3xbd/wchar.h.html>
- *
- * For now, this just ensures proper prerequisite inclusion order and
- * the declaration of wcwidth().
- */
-
-#if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-#endif
-@PRAGMA_COLUMNS@
-
-#if defined __need_mbstate_t || defined __need_wint_t || (defined __hpux && ((defined _INTTYPES_INCLUDED && !defined strtoimax) || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) || defined _GL_ALREADY_INCLUDING_WCHAR_H
-/* Special invocation convention:
- - Inside glibc and uClibc header files.
- - On HP-UX 11.00 we have a sequence of nested includes
- <wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>,
- once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h>
- and once directly. In both situations 'wint_t' is not yet defined,
- therefore we cannot provide the function overrides; instead include only
- the system's <wchar.h>.
- - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and
- the latter includes <wchar.h>. But here, we have no way to detect whether
- <wctype.h> is completely included or is still being included. */
-
-#@INCLUDE_NEXT@ @NEXT_WCHAR_H@
-
-#else
-/* Normal invocation convention. */
-
-#ifndef _GL_WCHAR_H
-
-#define _GL_ALREADY_INCLUDING_WCHAR_H
-
-#if @HAVE_FEATURES_H@
-# include <features.h> /* for __GLIBC__ */
-#endif
-
-/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
- <wchar.h>.
- BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
- included before <wchar.h>.
- But avoid namespace pollution on glibc systems. */
-#ifndef __GLIBC__
-# include <stddef.h>
-# include <stdio.h>
-# include <time.h>
-#endif
-
-/* Include the original <wchar.h> if it exists.
- Some builds of uClibc lack it. */
-/* The include_next requires a split double-inclusion guard. */
-#if @HAVE_WCHAR_H@
-# @INCLUDE_NEXT@ @NEXT_WCHAR_H@
-#endif
-
-#undef _GL_ALREADY_INCLUDING_WCHAR_H
-
-#ifndef _GL_WCHAR_H
-#define _GL_WCHAR_H
-
-/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
-
-/* The definition of _GL_ARG_NONNULL is copied here. */
-
-/* The definition of _GL_WARN_ON_USE is copied here. */
-
-
-/* Define wint_t and WEOF. (Also done in wctype.in.h.) */
-#if !@HAVE_WINT_T@ && !defined wint_t
-# define wint_t int
-# ifndef WEOF
-# define WEOF -1
-# endif
-#else
-# ifndef WEOF
-# define WEOF ((wint_t) -1)
-# endif
-#endif
-
-
-/* Override mbstate_t if it is too small.
- On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
- implementing mbrtowc for encodings like UTF-8. */
-#if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
-typedef int rpl_mbstate_t;
-# undef mbstate_t
-# define mbstate_t rpl_mbstate_t
-# define GNULIB_defined_mbstate_t 1
-#endif
-
-
-/* Convert a single-byte character to a wide character. */
-#if @GNULIB_BTOWC@
-# if @REPLACE_BTOWC@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef btowc
-# define btowc rpl_btowc
-# endif
-_GL_FUNCDECL_RPL (btowc, wint_t, (int c));
-_GL_CXXALIAS_RPL (btowc, wint_t, (int c));
-# else
-# if !@HAVE_BTOWC@
-_GL_FUNCDECL_SYS (btowc, wint_t, (int c));
-# endif
-_GL_CXXALIAS_SYS (btowc, wint_t, (int c));
-# endif
-_GL_CXXALIASWARN (btowc);
-#elif defined GNULIB_POSIXCHECK
-# undef btowc
-# if HAVE_RAW_DECL_BTOWC
-_GL_WARN_ON_USE (btowc, "btowc is unportable - "
- "use gnulib module btowc for portability");
-# endif
-#endif
-
-
-/* Convert a wide character to a single-byte character. */
-#if @GNULIB_WCTOB@
-# if @REPLACE_WCTOB@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef wctob
-# define wctob rpl_wctob
-# endif
-_GL_FUNCDECL_RPL (wctob, int, (wint_t wc));
-_GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
-# else
-# if !defined wctob && !@HAVE_DECL_WCTOB@
-/* wctob is provided by gnulib, or wctob exists but is not declared. */
-_GL_FUNCDECL_SYS (wctob, int, (wint_t wc));
-# endif
-_GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
-# endif
-_GL_CXXALIASWARN (wctob);
-#elif defined GNULIB_POSIXCHECK
-# undef wctob
-# if HAVE_RAW_DECL_WCTOB
-_GL_WARN_ON_USE (wctob, "wctob is unportable - "
- "use gnulib module wctob for portability");
-# endif
-#endif
-
-
-/* Test whether *PS is in the initial state. */
-#if @GNULIB_MBSINIT@
-# if @REPLACE_MBSINIT@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef mbsinit
-# define mbsinit rpl_mbsinit
-# endif
-_GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps));
-_GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
-# else
-# if !@HAVE_MBSINIT@
-_GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
-# endif
-_GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
-# endif
-_GL_CXXALIASWARN (mbsinit);
-#elif defined GNULIB_POSIXCHECK
-# undef mbsinit
-# if HAVE_RAW_DECL_MBSINIT
-_GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
- "use gnulib module mbsinit for portability");
-# endif
-#endif
-
-
-/* Convert a multibyte character to a wide character. */
-#if @GNULIB_MBRTOWC@
-# if @REPLACE_MBRTOWC@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef mbrtowc
-# define mbrtowc rpl_mbrtowc
-# endif
-_GL_FUNCDECL_RPL (mbrtowc, size_t,
- (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
-_GL_CXXALIAS_RPL (mbrtowc, size_t,
- (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
-# else
-# if !@HAVE_MBRTOWC@
-_GL_FUNCDECL_SYS (mbrtowc, size_t,
- (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
-# endif
-_GL_CXXALIAS_SYS (mbrtowc, size_t,
- (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
-# endif
-_GL_CXXALIASWARN (mbrtowc);
-#elif defined GNULIB_POSIXCHECK
-# undef mbrtowc
-# if HAVE_RAW_DECL_MBRTOWC
-_GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
- "use gnulib module mbrtowc for portability");
-# endif
-#endif
-
-
-/* Recognize a multibyte character. */
-#if @GNULIB_MBRLEN@
-# if @REPLACE_MBRLEN@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef mbrlen
-# define mbrlen rpl_mbrlen
-# endif
-_GL_FUNCDECL_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
-_GL_CXXALIAS_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
-# else
-# if !@HAVE_MBRLEN@
-_GL_FUNCDECL_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
-# endif
-_GL_CXXALIAS_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
-# endif
-_GL_CXXALIASWARN (mbrlen);
-#elif defined GNULIB_POSIXCHECK
-# undef mbrlen
-# if HAVE_RAW_DECL_MBRLEN
-_GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
- "use gnulib module mbrlen for portability");
-# endif
-#endif
-
-
-/* Convert a string to a wide string. */
-#if @GNULIB_MBSRTOWCS@
-# if @REPLACE_MBSRTOWCS@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef mbsrtowcs
-# define mbsrtowcs rpl_mbsrtowcs
-# endif
-_GL_FUNCDECL_RPL (mbsrtowcs, size_t,
- (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
- _GL_ARG_NONNULL ((2)));
-_GL_CXXALIAS_RPL (mbsrtowcs, size_t,
- (wchar_t *dest, const char **srcp, size_t len,
- mbstate_t *ps));
-# else
-# if !@HAVE_MBSRTOWCS@
-_GL_FUNCDECL_SYS (mbsrtowcs, size_t,
- (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
- _GL_ARG_NONNULL ((2)));
-# endif
-_GL_CXXALIAS_SYS (mbsrtowcs, size_t,
- (wchar_t *dest, const char **srcp, size_t len,
- mbstate_t *ps));
-# endif
-_GL_CXXALIASWARN (mbsrtowcs);
-#elif defined GNULIB_POSIXCHECK
-# undef mbsrtowcs
-# if HAVE_RAW_DECL_MBSRTOWCS
-_GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
- "use gnulib module mbsrtowcs for portability");
-# endif
-#endif
-
-
-/* Convert a string to a wide string. */
-#if @GNULIB_MBSNRTOWCS@
-# if @REPLACE_MBSNRTOWCS@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef mbsnrtowcs
-# define mbsnrtowcs rpl_mbsnrtowcs
-# endif
-_GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
- (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
- mbstate_t *ps)
- _GL_ARG_NONNULL ((2)));
-_GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
- (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
- mbstate_t *ps));
-# else
-# if !@HAVE_MBSNRTOWCS@
-_GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
- (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
- mbstate_t *ps)
- _GL_ARG_NONNULL ((2)));
-# endif
-_GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
- (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
- mbstate_t *ps));
-# endif
-_GL_CXXALIASWARN (mbsnrtowcs);
-#elif defined GNULIB_POSIXCHECK
-# undef mbsnrtowcs
-# if HAVE_RAW_DECL_MBSNRTOWCS
-_GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
- "use gnulib module mbsnrtowcs for portability");
-# endif
-#endif
-
-
-/* Convert a wide character to a multibyte character. */
-#if @GNULIB_WCRTOMB@
-# if @REPLACE_WCRTOMB@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef wcrtomb
-# define wcrtomb rpl_wcrtomb
-# endif
-_GL_FUNCDECL_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
-_GL_CXXALIAS_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
-# else
-# if !@HAVE_WCRTOMB@
-_GL_FUNCDECL_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
-# endif
-_GL_CXXALIAS_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
-# endif
-_GL_CXXALIASWARN (wcrtomb);
-#elif defined GNULIB_POSIXCHECK
-# undef wcrtomb
-# if HAVE_RAW_DECL_WCRTOMB
-_GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
- "use gnulib module wcrtomb for portability");
-# endif
-#endif
-
-
-/* Convert a wide string to a string. */
-#if @GNULIB_WCSRTOMBS@
-# if @REPLACE_WCSRTOMBS@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef wcsrtombs
-# define wcsrtombs rpl_wcsrtombs
-# endif
-_GL_FUNCDECL_RPL (wcsrtombs, size_t,
- (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
- _GL_ARG_NONNULL ((2)));
-_GL_CXXALIAS_RPL (wcsrtombs, size_t,
- (char *dest, const wchar_t **srcp, size_t len,
- mbstate_t *ps));
-# else
-# if !@HAVE_WCSRTOMBS@
-_GL_FUNCDECL_SYS (wcsrtombs, size_t,
- (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
- _GL_ARG_NONNULL ((2)));
-# endif
-_GL_CXXALIAS_SYS (wcsrtombs, size_t,
- (char *dest, const wchar_t **srcp, size_t len,
- mbstate_t *ps));
-# endif
-_GL_CXXALIASWARN (wcsrtombs);
-#elif defined GNULIB_POSIXCHECK
-# undef wcsrtombs
-# if HAVE_RAW_DECL_WCSRTOMBS
-_GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
- "use gnulib module wcsrtombs for portability");
-# endif
-#endif
-
-
-/* Convert a wide string to a string. */
-#if @GNULIB_WCSNRTOMBS@
-# if @REPLACE_WCSNRTOMBS@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef wcsnrtombs
-# define wcsnrtombs rpl_wcsnrtombs
-# endif
-_GL_FUNCDECL_RPL (wcsnrtombs, size_t,
- (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
- mbstate_t *ps)
- _GL_ARG_NONNULL ((2)));
-_GL_CXXALIAS_RPL (wcsnrtombs, size_t,
- (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
- mbstate_t *ps));
-# else
-# if !@HAVE_WCSNRTOMBS@
-_GL_FUNCDECL_SYS (wcsnrtombs, size_t,
- (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
- mbstate_t *ps)
- _GL_ARG_NONNULL ((2)));
-# endif
-_GL_CXXALIAS_SYS (wcsnrtombs, size_t,
- (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
- mbstate_t *ps));
-# endif
-_GL_CXXALIASWARN (wcsnrtombs);
-#elif defined GNULIB_POSIXCHECK
-# undef wcsnrtombs
-# if HAVE_RAW_DECL_WCSNRTOMBS
-_GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
- "use gnulib module wcsnrtombs for portability");
-# endif
-#endif
-
-
-/* Return the number of screen columns needed for WC. */
-#if @GNULIB_WCWIDTH@
-# if @REPLACE_WCWIDTH@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef wcwidth
-# define wcwidth rpl_wcwidth
-# endif
-_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t));
-_GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
-# else
-# if !@HAVE_DECL_WCWIDTH@
-/* wcwidth exists but is not declared. */
-_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t));
-# endif
-_GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
-# endif
-_GL_CXXALIASWARN (wcwidth);
-#elif defined GNULIB_POSIXCHECK
-# undef wcwidth
-# if HAVE_RAW_DECL_WCWIDTH
-_GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
- "use gnulib module wcwidth for portability");
-# endif
-#endif
-
-
-#endif /* _GL_WCHAR_H */
-#endif /* _GL_WCHAR_H */
-#endif
diff --git a/lib/gl/xsize.h b/lib/gl/xsize.h
index 1d43dfe4c2..5816dcf1ae 100644
--- a/lib/gl/xsize.h
+++ b/lib/gl/xsize.h
@@ -1,6 +1,6 @@
/* xsize.h -- Checked size_t computations.
- Copyright (C) 2003, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2008-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/libextra/build-aux/config.rpath b/libextra/build-aux/config.rpath
index 17298f2348..8bd7f5d726 100755
--- a/libextra/build-aux/config.rpath
+++ b/libextra/build-aux/config.rpath
@@ -2,7 +2,7 @@
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
-# Copyright 1996-2010 Free Software Foundation, Inc.
+# Copyright 1996-2011 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
@@ -57,13 +57,6 @@ else
aix*)
wl='-Wl,'
;;
- darwin*)
- case $cc_basename in
- xlc*)
- wl='-Wl,'
- ;;
- esac
- ;;
mingw* | cygwin* | pw32* | os2* | cegcc*)
;;
hpux9* | hpux10* | hpux11*)
@@ -72,9 +65,7 @@ else
irix5* | irix6* | nonstopux*)
wl='-Wl,'
;;
- newsos6)
- ;;
- linux* | k*bsd*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
ecc*)
wl='-Wl,'
@@ -85,17 +76,26 @@ else
lf95*)
wl='-Wl,'
;;
- pgcc | pgf77 | pgf90)
+ nagfor*)
+ wl='-Wl,-Wl,,'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
wl='-Wl,'
;;
ccc*)
wl='-Wl,'
;;
+ xl* | bgxl* | bgf* | mpixl*)
+ wl='-Wl,'
+ ;;
como)
wl='-lopt='
;;
*)
case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ F* | *Sun*Fortran*)
+ wl=
+ ;;
*Sun\ C*)
wl='-Wl,'
;;
@@ -103,13 +103,24 @@ else
;;
esac
;;
+ newsos6)
+ ;;
+ *nto* | *qnx*)
+ ;;
osf3* | osf4* | osf5*)
wl='-Wl,'
;;
rdos*)
;;
solaris*)
- wl='-Wl,'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ wl='-Qoption ld '
+ ;;
+ *)
+ wl='-Wl,'
+ ;;
+ esac
;;
sunos4*)
wl='-Qoption ld '
@@ -171,15 +182,14 @@ if test "$with_gnu_ld" = yes; then
fi
;;
amigaos*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we cannot use
- # them.
- ld_shlibs=no
+ case "$host_cpu" in
+ powerpc)
+ ;;
+ m68k)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
;;
beos*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
@@ -198,11 +208,13 @@ if test "$with_gnu_ld" = yes; then
ld_shlibs=no
fi
;;
+ haiku*)
+ ;;
interix[3-9]*)
hardcode_direct=no
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
- gnu* | linux* | k*bsd*-gnu)
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
@@ -325,10 +337,14 @@ else
fi
;;
amigaos*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs=no
+ case "$host_cpu" in
+ powerpc)
+ ;;
+ m68k)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
;;
bsdi[45]*)
;;
@@ -342,24 +358,15 @@ else
;;
darwin* | rhapsody*)
hardcode_direct=no
- if test "$GCC" = yes ; then
+ if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
:
else
- case $cc_basename in
- xlc*)
- ;;
- *)
- ld_shlibs=no
- ;;
- esac
+ ld_shlibs=no
fi
;;
dgux*)
hardcode_libdir_flag_spec='-L$libdir'
;;
- freebsd1*)
- ld_shlibs=no
- ;;
freebsd2.2*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
@@ -420,6 +427,8 @@ else
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
+ *nto* | *qnx*)
+ ;;
openbsd*)
if test -f /usr/libexec/ld.so; then
hardcode_direct=yes
@@ -515,7 +524,12 @@ case "$host_os" in
library_names_spec='$libname$shrext'
;;
amigaos*)
- library_names_spec='$libname.a'
+ case "$host_cpu" in
+ powerpc*)
+ library_names_spec='$libname$shrext' ;;
+ m68k)
+ library_names_spec='$libname.a' ;;
+ esac
;;
beos*)
library_names_spec='$libname$shrext'
@@ -534,8 +548,6 @@ case "$host_os" in
dgux*)
library_names_spec='$libname$shrext'
;;
- freebsd1*)
- ;;
freebsd* | dragonfly*)
case "$host_os" in
freebsd[123]*)
@@ -547,6 +559,9 @@ case "$host_os" in
gnu*)
library_names_spec='$libname$shrext'
;;
+ haiku*)
+ library_names_spec='$libname$shrext'
+ ;;
hpux9* | hpux10* | hpux11*)
case $host_cpu in
ia64*)
@@ -582,7 +597,7 @@ case "$host_os" in
;;
linux*oldld* | linux*aout* | linux*coff*)
;;
- linux* | k*bsd*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
library_names_spec='$libname$shrext'
;;
knetbsd*-gnu)
@@ -594,7 +609,7 @@ case "$host_os" in
newsos6)
library_names_spec='$libname$shrext'
;;
- nto-qnx*)
+ *nto* | *qnx*)
library_names_spec='$libname$shrext'
;;
openbsd*)
@@ -625,6 +640,9 @@ case "$host_os" in
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
library_names_spec='$libname$shrext'
;;
+ tpf*)
+ library_names_spec='$libname$shrext'
+ ;;
uts4*)
library_names_spec='$libname$shrext'
;;
diff --git a/libextra/gl/gnulib.mk b/libextra/gl/gnulib.mk
index 9b88b00222..72c57d3afe 100644
--- a/libextra/gl/gnulib.mk
+++ b/libextra/gl/gnulib.mk
@@ -1,6 +1,6 @@
## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+# Copyright (C) 2002-2011 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
diff --git a/libextra/gl/hmac-md5.c b/libextra/gl/hmac-md5.c
index 5e457ece10..eed16573ba 100644
--- a/libextra/gl/hmac-md5.c
+++ b/libextra/gl/hmac-md5.c
@@ -1,5 +1,5 @@
/* hmac-md5.c -- hashed message authentication codes
- Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libextra/gl/hmac.h b/libextra/gl/hmac.h
index 1ee9c4a78a..67cb72e7e4 100644
--- a/libextra/gl/hmac.h
+++ b/libextra/gl/hmac.h
@@ -1,5 +1,5 @@
/* hmac.h -- hashed message authentication codes
- Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2009-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libextra/gl/m4/00gnulib.m4 b/libextra/gl/m4/00gnulib.m4
index 301469b31c..7feed46694 100644
--- a/libextra/gl/m4/00gnulib.m4
+++ b/libextra/gl/m4/00gnulib.m4
@@ -1,5 +1,5 @@
# 00gnulib.m4 serial 2
-dnl Copyright (C) 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2011 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.
diff --git a/libextra/gl/m4/extensions.m4 b/libextra/gl/m4/extensions.m4
index 7d9458a8d6..1330503f0d 100644
--- a/libextra/gl/m4/extensions.m4
+++ b/libextra/gl/m4/extensions.m4
@@ -1,7 +1,7 @@
# serial 9 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
-# Copyright (C) 2003, 2006-2010 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2011 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/libextra/gl/m4/gnulib-cache.m4 b/libextra/gl/m4/gnulib-cache.m4
index ad8c687dbc..5e01d55da4 100644
--- a/libextra/gl/m4/gnulib-cache.m4
+++ b/libextra/gl/m4/gnulib-cache.m4
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+# Copyright (C) 2002-2011 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
diff --git a/libextra/gl/m4/gnulib-common.m4 b/libextra/gl/m4/gnulib-common.m4
index d0c8b66287..ecbf33694e 100644
--- a/libextra/gl/m4/gnulib-common.m4
+++ b/libextra/gl/m4/gnulib-common.m4
@@ -1,5 +1,5 @@
-# gnulib-common.m4 serial 21
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# gnulib-common.m4 serial 23
+dnl Copyright (C) 2007-2011 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.
@@ -102,6 +102,26 @@ AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS],
[Define to 1 when the gnulib module $1 should be tested.])
])
+# gl_ASSERT_NO_GNULIB_POSIXCHECK
+# asserts that there will never be a need to #define GNULIB_POSIXCHECK.
+# and thereby enables an optimization of configure and config.h.
+# Used by Emacs.
+AC_DEFUN([gl_ASSERT_NO_GNULIB_POSIXCHECK],
+[
+ dnl Override gl_WARN_ON_USE_PREPARE.
+ AC_DEFUN([gl_WARN_ON_USE_PREPARE], [])
+])
+
+# gl_ASSERT_NO_GNULIB_TESTS
+# asserts that there will be no gnulib tests in the scope of the configure.ac
+# and thereby enables an optimization of config.h.
+# Used by Emacs.
+AC_DEFUN([gl_ASSERT_NO_GNULIB_TESTS],
+[
+ dnl Override gl_MODULE_INDICATOR_FOR_TESTS.
+ AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], [])
+])
+
# Test whether <features.h> exists.
# Set HAVE_FEATURES_H.
AC_DEFUN([gl_FEATURES_H],
diff --git a/libextra/gl/m4/gnulib-comp.m4 b/libextra/gl/m4/gnulib-comp.m4
index d02a7275fc..d391b3b424 100644
--- a/libextra/gl/m4/gnulib-comp.m4
+++ b/libextra/gl/m4/gnulib-comp.m4
@@ -1,5 +1,5 @@
# DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+# Copyright (C) 2002-2011 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
diff --git a/libextra/gl/m4/gnulib-tool.m4 b/libextra/gl/m4/gnulib-tool.m4
index 69e7733b99..ed41e9d415 100644
--- a/libextra/gl/m4/gnulib-tool.m4
+++ b/libextra/gl/m4/gnulib-tool.m4
@@ -1,5 +1,5 @@
# gnulib-tool.m4 serial 2
-dnl Copyright (C) 2004-2005, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2005, 2009-2011 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.
diff --git a/libextra/gl/m4/hmac-md5.m4 b/libextra/gl/m4/hmac-md5.m4
index 417b3e36f4..2945555dea 100644
--- a/libextra/gl/m4/hmac-md5.m4
+++ b/libextra/gl/m4/hmac-md5.m4
@@ -1,5 +1,5 @@
# hmac-md5.m4 serial 2
-dnl Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2006, 2009-2011 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.
diff --git a/libextra/gl/m4/ld-output-def.m4 b/libextra/gl/m4/ld-output-def.m4
index 2dc6bf5205..2169f51510 100644
--- a/libextra/gl/m4/ld-output-def.m4
+++ b/libextra/gl/m4/ld-output-def.m4
@@ -1,5 +1,5 @@
# ld-output-def.m4 serial 2
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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.
diff --git a/libextra/gl/m4/ld-version-script.m4 b/libextra/gl/m4/ld-version-script.m4
index 8fd8c8995c..aec2f41c1e 100644
--- a/libextra/gl/m4/ld-version-script.m4
+++ b/libextra/gl/m4/ld-version-script.m4
@@ -1,5 +1,5 @@
# ld-version-script.m4 serial 2
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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.
diff --git a/libextra/gl/m4/lib-ld.m4 b/libextra/gl/m4/lib-ld.m4
index 294db72e13..ae003f7c59 100644
--- a/libextra/gl/m4/lib-ld.m4
+++ b/libextra/gl/m4/lib-ld.m4
@@ -1,5 +1,5 @@
# lib-ld.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 1996-2003, 2009-2011 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.
diff --git a/libextra/gl/m4/lib-link.m4 b/libextra/gl/m4/lib-link.m4
index 2ea9d6d073..e7c9ba9d3d 100644
--- a/libextra/gl/m4/lib-link.m4
+++ b/libextra/gl/m4/lib-link.m4
@@ -1,5 +1,5 @@
-# lib-link.m4 serial 25 (gettext-0.18.2)
-dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
+# lib-link.m4 serial 26 (gettext-0.18.2)
+dnl Copyright (C) 2001-2011 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.
@@ -116,6 +116,8 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
dnl Determine the platform dependent parameters needed to use rpath:
dnl acl_libext,
dnl acl_shlibext,
+dnl acl_libname_spec,
+dnl acl_library_names_spec,
dnl acl_hardcode_libdir_flag_spec,
dnl acl_hardcode_libdir_separator,
dnl acl_hardcode_direct,
diff --git a/libextra/gl/m4/lib-prefix.m4 b/libextra/gl/m4/lib-prefix.m4
index 1601ceaefd..7e5f0bde03 100644
--- a/libextra/gl/m4/lib-prefix.m4
+++ b/libextra/gl/m4/lib-prefix.m4
@@ -1,5 +1,5 @@
# lib-prefix.m4 serial 7 (gettext-0.18)
-dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2005, 2008-2011 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.
diff --git a/libextra/gl/m4/md5.m4 b/libextra/gl/m4/md5.m4
index 52f9c1b873..ce7671d6ce 100644
--- a/libextra/gl/m4/md5.m4
+++ b/libextra/gl/m4/md5.m4
@@ -1,6 +1,5 @@
# md5.m4 serial 11
-dnl Copyright (C) 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 Free Software
-dnl Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2008-2011 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.
diff --git a/libextra/gl/m4/memxor.m4 b/libextra/gl/m4/memxor.m4
index 3093cdc320..42789eb6fd 100644
--- a/libextra/gl/m4/memxor.m4
+++ b/libextra/gl/m4/memxor.m4
@@ -1,5 +1,5 @@
# memxor.m4 serial 3
-dnl Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2009-2011 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.
diff --git a/libextra/gl/md5.c b/libextra/gl/md5.c
index 912738a500..a4933953c7 100644
--- a/libextra/gl/md5.c
+++ b/libextra/gl/md5.c
@@ -1,7 +1,7 @@
/* Functions to compute MD5 message digest of files or memory blocks.
according to the definition of MD5 in RFC 1321 from April 1992.
- Copyright (C) 1995, 1996, 1997, 1999, 2000, 2001, 2005, 2006, 2008, 2009,
- 2010 Free Software Foundation, Inc.
+ Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-2011 Free Software
+ Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify it
diff --git a/libextra/gl/md5.h b/libextra/gl/md5.h
index 1247d786e5..53e6048029 100644
--- a/libextra/gl/md5.h
+++ b/libextra/gl/md5.h
@@ -1,6 +1,6 @@
/* Declaration of functions and data types used for MD5 sum computing
library functions.
- Copyright (C) 1995-1997, 1999-2001, 2004-2006, 2008-2010 Free Software
+ Copyright (C) 1995-1997, 1999-2001, 2004-2006, 2008-2011 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/libextra/gl/memxor.c b/libextra/gl/memxor.c
index da0ef91b50..4eeebcbd56 100644
--- a/libextra/gl/memxor.c
+++ b/libextra/gl/memxor.c
@@ -1,5 +1,5 @@
/* memxor.c -- perform binary exclusive OR operation of two memory blocks.
- Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libextra/gl/memxor.h b/libextra/gl/memxor.h
index e8eba8ba26..dafa2cfca7 100644
--- a/libextra/gl/memxor.h
+++ b/libextra/gl/memxor.h
@@ -1,5 +1,5 @@
/* memxor.h -- perform binary exclusive OR operation on memory blocks.
- Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2009-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/maint.mk b/maint.mk
index 958be698e3..ff2fbbb382 100644
--- a/maint.mk
+++ b/maint.mk
@@ -2,7 +2,7 @@
# This Makefile fragment tries to be general-purpose enough to be
# used by many projects via the gnulib maintainer-makefile module.
-## Copyright (C) 2001-2010 Free Software Foundation, Inc.
+## Copyright (C) 2001-2011 Free Software Foundation, Inc.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@@ -126,8 +126,13 @@ syntax-check-rules := $(sort $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
$(srcdir)/$(ME) $(_cfg_mk)))
.PHONY: $(syntax-check-rules)
-local-checks-available = \
- $(syntax-check-rules)
+ifeq ($(shell $(VC_LIST) >/dev/null 2>&1; echo $$?),0)
+local-checks-available += $(syntax-check-rules)
+else
+local-checks-available += no-vc-detected
+no-vc-detected:
+ @echo "No version control files detected; skipping syntax check"
+endif
.PHONY: $(local-checks-available)
# Arrange to print the name of each syntax-checking rule just before running it.
@@ -292,10 +297,10 @@ sc_prohibit_atoi_atof:
# Use STREQ rather than comparing strcmp == 0, or != 0.
sc_prohibit_strcmp:
- @grep -nE '! *str''cmp *\(|\<str''cmp *\([^)]+\) *==' \
+ @grep -nE '! *str''cmp *\(|\<str''cmp *\(.+\) *[!=]=' \
$$($(VC_LIST_EXCEPT)) \
- | grep -vE ':# *define STREQ\(' && \
- { echo '$(ME): use STREQ in place of the above uses of str''cmp' \
+ | grep -vE ':# *define STRN?EQ\(' && \
+ { echo '$(ME): replace str''cmp calls above with STREQ/STRNEQ' \
1>&2; exit 1; } || :
# Pass EXIT_*, not number, to usage, exit, and error (when exiting)
@@ -571,6 +576,13 @@ sc_prohibit_intprops_without_use:
re='\<($(_intprops_syms_re)) *\(' \
$(_sc_header_without_use)
+_stddef_syms_re = NULL|offsetof|ptrdiff_t|size_t|wchar_t
+# Prohibit the inclusion of stddef.h without an actual use.
+sc_prohibit_stddef_without_use:
+ @h='<stddef.h>' \
+ re='\<($(_stddef_syms_re)) *\(' \
+ $(_sc_header_without_use)
+
sc_obsolete_symbols:
@prohibit='\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
halt='do not use HAVE''_FCNTL_H or O'_NDELAY \
@@ -1118,9 +1130,34 @@ no-submodule-changes:
: ; \
fi
+submodule-checks ?= no-submodule-changes public-submodule-commit
+
+# Ensure that each sub-module commit we're using is public.
+# Without this, it is too easy to tag and release code that
+# cannot be built from a fresh clone.
+.PHONY: public-submodule-commit
+public-submodule-commit:
+ $(AM_V_GEN)if test -d $(srcdir)/.git; then \
+ cd $(srcdir) && \
+ git submodule --quiet foreach test '$$(git rev-parse $$sha1)' \
+ = '$$(git merge-base origin $$sha1)' \
+ || { echo '$(ME): found non-public submodule commit' >&2; \
+ exit 1; }; \
+ else \
+ : ; \
+ fi
+# This rule has a high enough utility/cost ratio that it should be a
+# dependent of "check" by default. However, some of us do occasionally
+# commit a temporary change that deliberately points to a non-public
+# submodule commit, and want to be able to use rules like "make check".
+# In that case, run e.g., "make check gl_public_submodule_commit="
+# to disable this test.
+gl_public_submodule_commit ?= public-submodule-commit
+check: $(gl_public_submodule_commit)
+
.PHONY: alpha beta stable
ALL_RECURSIVE_TARGETS += alpha beta stable
-alpha beta stable: $(local-check) writable-files no-submodule-changes
+alpha beta stable: $(local-check) writable-files $(submodule-checks)
test $@ = stable \
&& { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$' \
|| { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\
@@ -1208,8 +1245,8 @@ refresh-po:
INDENT_SOURCES ?= $(C_SOURCES)
.PHONY: indent
indent:
- indent -nut $(INDENT_SOURCES)
- indent -nut $(INDENT_SOURCES)
+ indent $(INDENT_SOURCES)
+ indent $(INDENT_SOURCES)
# If you want to set UPDATE_COPYRIGHT_* environment variables,
# put the assignments in this variable.