# HG changeset patch # User Bruce Korb # Date 1293746705 28800 # Node ID 94601a984b2be14fc7e9964c1e03c2115d634d17 # Parent 5bf72cece330218e48f5dae7a2afedd49c38a16e# Parent 602afdb74dc3ead4024cd0874b6e04c8486b2e9c merge with hand edits to ChangeLog diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,1097 @@ * libposix/bootstrap (posix_list): remove unnecessary temp file +2010-12-29 Eric Blake + + mountlist: tweak previous commit + * lib/mountlist.c (me_remote): Guarantee trailing backslash. + Reported by Paul Eggert. + + mountlist: fix local drive detection on cygwin + * lib/mountlist.c (ME_REMOTE) [__CYGWIN__]: Provide implementation + that works for cygwin. + +2010-12-29 Paul Eggert + + ftoastr, snprintf: ftoastr + snprintf module + * lib/ftoastr.c: Use GNULIB_SNPRINTF, not GNULIB_SNPRINTF_POSIX, + since the snprintf module now should be good enough here. + * modules/snprintf (configure.ac): Add gl_MODULE_INDICATOR([snprintf]). + It seems odd to have both gl_STDIO_MODULE_INDICATOR([snprintf]) + and gl_MODULE_INDICATOR([snprintf]), but the former enables + GNULIB_SNPRINTF only for the test directory, and the latter + doesn't arrange for gl_STDIO_H_DEFAULTS to be called, so neither + seems to suffice by itself. + +2010-12-28 Paul Eggert + + alloca: one step towards thread-safety + * lib/alloca.c (find_stack_direction): New arg PTR, to avoid the + need for a static variable. All callers changed. This does not + make the alloca replacement thread-safe, but it's one step. + + tests: minor indenting change + * tests/init.sh: Sync from coreutils housekeeping patch + + to keep lines within 80 columns. + +2010-12-28 Jim Meyering + + regex: don't infloop on persistent failing calloc + * lib/regexec.c (build_trtable): Return failure indication upon + calloc failure. Otherwise, re_search_internal could infloop on OOM. + In glibc, this was fixed for version 2.13: + http://sourceware.org/bugzilla/show_bug.cgi?id=12348 + +2010-12-28 Bruno Haible + Paul Eggert + + linkat: Make implementation robust against system behaviour variations. + * m4/link-follow.m4 (gl_FUNC_LINK_FOLLOWS_SYMLINK): Define + LINK_FOLLOWS_SYMLINKS to -1 if it needs a runtime test in the Solaris + way, and to -2 if it needs a generic runtime test. + * lib/linkat.c (solaris_optimized_link_immediate, + solaris_optimized_link_follow): New functions. + * tests/test-linkat.c (EXPECT_LINK_HARDLINKS_SYMLINKS): New macro. + (check_same_link): Use it. + +2010-12-26 Ben Pfaff + + New module 'unigbrk/base'. + * modules/unigbrk/base: New file. + * lib/unigbrk.in.h: New file. + + New module 'unigbrk/uc-gbrk-prop'. + * lib/gen-uni-tables.c: Generate lib/unigbrk/gbrkprop.h. + * modules/unigbrk/uc-gbrk-prop: New file. + * lib/unigbrk/gbrkprop.h: New file. + * lib/unigbrk/uc-gbrk-prop.c: New file. + + New module 'unigbrk/uc-is-grapheme-break'. + * modules/unigbrk/uc-is-grapheme-break: New file. + * modules/unigbrk/uc-is-grapheme-break-tests: New file. + * lib/unigbrk/uc-is-grapheme-break.c: New file. + * tests/unigbrk/test-uc-is-grapheme-break.c: New file. + * tests/unigbrk/test-uc-is-grapheme-break.sh: New file. + * tests/unigbrk/GraphemeBreakTest.txt: New file. + + With corrections and tweaks by Bruno Haible . + +2010-12-27 Bruno Haible + + linkat test: Avoid failure on Solaris 11 2010-11. + * tests/test-linkat.c (main): Allow ENOTDIR as alternative error code. + +2010-12-27 Paul Eggert + + utimens: work around glibc rounding bug on more platforms + * lib/utimens.c (fdutimens): Work around rounding bug even if + HAVE_WORKING_UTIMES. Reported for Linux 2.4.21 by Bruno Haible in + . + +2010-12-27 Bruno Haible + + select tests: Improve comments. + * tests/test-select.c (do_select): Add comments. + +2010-12-27 Bruno Haible + + select tests: Safer way of handling timeout. + * tests/test-select.c (do_select_nowait): Zero-initialize the timeout + at every invocation. + +2010-12-27 Bruno Haible + + select tests: Use 'bool' where appropriate. + * tests/test-select.c (connect_to_socket): Change argument type to + 'bool'. + +2010-12-27 Bruno Haible + + select tests: Use existing modules. + * modules/select-tests (Depends-on): Add pipe-posix, unistd. + (configure.ac): Don't test for unistd.h. + * tests/test-select.c: Include always. Use pipe() as + declared in . + +2010-12-27 Bruno Haible + + mbrtowc: Work around a Solaris 7 bug. + * m4/mbrtowc.m4 (gl_MBRTOWC_NULL_ARG1): New macro. + (gl_MBRTOWC_NULL_ARG2): Renamed from gl_MBRTOWC_NULL_ARG. + (gl_FUNC_MBRTOWC): Update. Define MBRTOWC_NULL_ARG2_BUG instead of + MBRTOWC_NULL_ARG_BUG. Invoke gl_MBRTOWC_NULL_ARG1 and define + MBRTOWC_NULL_ARG1_BUG. + * lib/mbrtowc.c (rpl_mbrtowc): Use MBRTOWC_NULL_ARG2_BUG instead of + MBRTOWC_NULL_ARG_BUG. Handle MBRTOWC_NULL_ARG1_BUG. + * tests/test-mbrtowc.c (main): Test support of a NULL first argument. + * doc/posix-functions/mbrtowc.texi: Mention the Solaris 7 bug. + +2010-12-27 Jim Meyering + + read-file.c: tweak syntax + * lib/read-file.c (fread_file): Remove space after "*" in function + definitions. + +2010-12-27 Bruno Haible + + times test: Avoid gcc warnings on OSF/1. + * tests/test-times.c (main): Cast printf arguments from clock_t to + 'long int'. + +2010-12-27 Paul Eggert + + utimens: work around glibc rounding bug on older Linux kernels + * lib/utimens.c (fdutimens): If invoking futimesat or futimes + on Linux with a glibc whose utimes might not work, then work + around a longstanding glibc bug involving rounding rather than + truncated time stamps. Reported for Linux 2.4.21 by Bruno Haible in + . + +2010-12-26 Bruno Haible + + inet_ntop: Hide mismatch of declaration on NonStop Kernel. + * lib/arpa_inet.in.h (inet_ntop): Use _GL_CXXALIAS_SYS_CAST instead of + _GL_CXXALIAS_SYS. + Reported by Joachim Schmitz . + +2010-12-26 Bruno Haible + + inet_ntop, inet_pton: Ensure declaration on NonStop Kernel. + * lib/arpa_inet.in.h: On NonStop Kernel, include also . + * m4/arpa_inet_h.m4 (gl_HEADER_ARPA_INET): Likewise. + * m4/inet_ntop.m4 (gl_PREREQ_INET_NTOP): Include also when + looking for the declaration. + * m4/inet_pton.m4 (gl_PREREQ_INET_PTON): Likewise. + * doc/posix-functions/inet_ntop.texi: Document the NonStop Kernel + problem. + * doc/posix-functions/inet_pton.texi: Likewise. + +2010-12-26 Bruno Haible + + arpa_inet: Use the common idioms with C++ support. + * lib/arpa_inet.in.h: Include c++defs.h. + (inet_ntop, inet_pton): Declare using the macros with C++ namespace + support. + * modules/arpa_inet (Depends-on): Add c++defs. + (Makefile.am): Substitute the contents of c++defs.h. + * modules/arpa_inet-tests (Depends-on): Add arpa_inet-c++-tests. + * modules/arpa_inet-c++-tests: New file. + * tests/test-arpa_inet-c++.cc: New file. + +2010-12-25 Bruno Haible + + Fix more C++ link errors on Solaris 8. + * modules/fcntl-h-c++-tests (test_fcntl_h_c___LDADD): Add + $(LIB_EACCESS). + * modules/stdio-c++-tests (test_stdio_c___LDADD): Likewise. + * modules/stdlib-c++-tests (test_stdlib_c___LDADD): Likewise. + * modules/sys_ioctl-c++-tests (test_sys_ioctl_c___LDADD): Likewise. + * modules/wchar-c++-tests (test_wchar_c___LDADD): Likewise. + * modules/wctype-c++-tests (test_wctype_c___LDADD): Likewise. + +2010-12-25 Bruno Haible + + printf-posix: Fix link error when a non-GCC compiler is used. + * lib/stdio.in.h (printf): When not using GCC, override printf + correctly. + Reported by Joachim Schmitz . + +2010-12-25 Bruno Haible + + strerror_r-posix: Update doc. + * doc/posix-functions/strerror_r.texi: Update doc about the return + value. See . + +2010-12-25 Paul Eggert + + utimens: simplify the logic of the previous change + * m4/utimes.m4 (gl_FUNC_UTIMES): Simplify the logic a bit. + This should not affect whether the test succeeds or fails. + + utimens: configure better on hosts with NFS clock skew + * m4/utimes.m4 (gl_FUNC_UTIMES): Don't assume that utimes (f, NULL) + uses the clock of the local host. It might use the clock of the + NFS server. Reported for Linux 2.4.21 client by Bruno Haible in + . + +2010-12-25 Bruno Haible + + ptsname test: Avoid failure on Solaris. + * tests/test-ptsname.c (main): For Solaris, use the recommended way to + open a pseudo-terminal; don't use BSD-style ptys. + * doc/posix-functions/ptsname.texi: Document the limitation on Solaris. + +2010-12-25 Bruno Haible + + ptsname: Avoid ERANGE failure on some systems. + * lib/ptsname.c (buffer): Increase size. + +2010-12-25 Bruno Haible + + rename, renameat: Avoid test failures at NFS mounted locations. + * tests/test-rename.h (assert_nonexistent): Remove the old directory, + so that subsequent mkdir calls succeed. + +2010-12-25 Bruno Haible + + iswblank: Fix C++ link error on Solaris 8. + * lib/wctype.in.h (iswblank): Declare using _GL_FUNCDECL_RPL or + _GL_FUNCDECL_SYS. + +2010-12-25 Bruno Haible + + unistd: Fix C++ link error on Solaris 8. + * modules/unistd-c++-tests (test_unistd_c___LDADD): Add $(LIB_EACCESS). + +2010-12-25 Bruno Haible + + readlink doc: Mention an old glibc bug. + * doc/posix-functions/readlink.texi: Mention glibc 2.4 bug (BZ #2450). + +2010-12-25 Bruno Haible + + fcntl-h: Fix for use of C++ on glibc systems. + * lib/fcntl.in.h: Include before include_next + also on glibc systems in C++ mode. + Reported by Gary V. Vaughan . + +2010-12-25 Bruno Haible + + roundl-ieee: Make it work on OSF/1 5.1 with cc. + * modules/roundl-ieee (Depends-on): Add floorl-ieee, ceill-ieee. + +2010-12-25 Bruno Haible + + truncl-ieee: Make it work on OSF/1 5.1 with cc. + * doc/posix-functions/truncl.texi: Mention the OSF/1 5.1 bug. + * m4/truncl.m4 (gl_FUNC_TRUNCL): If gl_FUNC_TRUNCL_IEEE is also used, + test whether truncl works according to ISO C 99 with IEC 60559. + * m4/truncl-ieee.m4: New file. + * modules/truncl-ieee (Files): Add it and m4/minus-zero.m4, + m4/signbit.m4. + (configure.ac): Invoke gl_FUNC_TRUNCL_IEEE. + +2010-12-25 Bruno Haible + + ceill-ieee: Make it work on OSF/1 5.1 with cc. + * doc/posix-functions/ceill.texi: Mention the OSF/1 5.1 bug. + * m4/ceill.m4 (gl_FUNC_CEILL): If gl_FUNC_CEILL_IEEE is also used, + test whether ceill works according to ISO C 99 with IEC 60559. + * m4/ceill-ieee.m4: New file. + * modules/ceill-ieee (Files): Add it and m4/minus-zero.m4, + m4/signbit.m4. + (configure.ac): Invoke gl_FUNC_CEILL_IEEE. + +2010-12-25 Bruno Haible + + Ensure all prerequisites of are included. + * m4/btowc.m4 (gl_FUNC_BTOWC): Include , , + before . + * m4/mbrlen.m4 (gl_MBRLEN_INCOMPLETE_STATE, gl_MBRLEN_RETVAL, + gl_MBRLEN_NUL_RETVAL): Likewise. + * m4/mbrtowc.m4 (gl_MBRTOWC_INCOMPLETE_STATE, gl_MBRTOWC_SANITYCHECK, + gl_MBRTOWC_NULL_ARG, gl_MBRTOWC_RETVAL, gl_MBRTOWC_NUL_RETVAL, + AC_FUNC_MBRTOWC): Likewise. + * m4/mbsrtowcs.m4 (gl_MBSRTOWCS_WORKS): Likewise. + * m4/mbstate_t.m4 (AC_TYPE_MBSTATE_T): Likewise. + * m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): Likewise. + * m4/wcsrtombs.m4 (gl_WCSRTOMBS_TERMINATION, gl_WCSRTOMBS_NULL): + Likewise. + * m4/wctob.m4 (gl_FUNC_WCTOB): Likewise. + * m4/wchar_h.m4 (gl_WCHAR_H_INLINE_OK): Likewise. + (gl_WCHAR_H): Improve comments. + * m4/wctype_h.m4 (gl_WCTYPE_H): Likewise. + +2010-12-25 Bruno Haible + + strtok_r: Fix C syntax error in autoconf macro. + * m4/strtok_r.m4 (gl_FUNC_STRTOK_R): Don't use UTF-8 encoded U+00A0 + characters in test program. + +2010-12-24 Bruno Haible + + ceil, trunc, round: Fix gcc warnings. + * lib/ceil.c (MIN): Undefine before redefining. + * lib/trunc.c (MIN): Likewise. + * lib/round.c (MIN): Likewise. + Include first. + +2010-12-24 Bruno Haible + + select tests: Avoid failures on OSF/1 5.1. + * tests/test-select.c (test_accept_first, test_socket_pair): Ignore + failure of closing the last socket; it may fail with ECONNRESET. + +2010-12-24 Eric Blake + + stdint: avoid HP-UX 10.20 preprocessor bug + * lib/stdint.in.h (INT64_MAX, UINT64_MAX): Check via #ifdef rather + than #if. + * tests/test-floor2.c (main): Likewise. + Reported by Peter O'Gorman. + + pipe: make obsoletion transition easier + * lib/pipe.h: Restore file as thin shim around "spawn-pipe.h". + * modules/pipe (Files): Include revived file. + (Include): Drop reference, to mirror getdate's behavior. + +2010-12-24 Bruno Haible + + sys_socket: Hide mismatch of declarations on NonStop Kernel. + * lib/sys_socket.in.h (connect, bind, sendto, setsockopt): Use + _GL_CXXALIAS_SYS_CAST instead of _GL_CXXALIAS_SYS. + Reported by Joachim Schmitz . + +2010-12-24 Bruno Haible + + gethostname: Ensure declaration on NonStop Kernel. + * lib/unistd.in.h: Include also on NonStop Kernel systems. + Reported by Joachim Schmitz . + +2010-12-24 Bruno Haible + + sys_select: Ensure all necessary types on NonStop Kernel. + * lib/sys_select.in.h: If the system does not have , + include . + * doc/posix-headers/sys_select.texi: Mention that it's missing on + NonStop Kernel. + Reported by Joachim Schmitz . + +2010-12-24 Bruno Haible + + sys_select: Remove unneeded include. + * lib/sys_select.in.h: Don't include on platforms that + have . + +2010-12-24 Bruno Haible + + gethostname: Provide a fallback for HOST_NAME_MAX. + * m4/gethostname.m4 (gl_FUNC_GETHOSTNAME): When neither HOST_NAME_MAX + nor MAXHOSTNAMELEN is found in the usual system headers, use 256 + instead. + Reported by Joachim Schmitz . + +2010-12-24 Bruno Haible + + sigaction tests: Allow missing SA_RESETHAND and SA_RESTART. + * tests/test-sigaction.c (SA_RESETHAND): Fall back to 0. + (SA_RESTART): Likewise. + Reported by Joachim Schmitz . + +2010-12-24 Bruno Haible + + signal: Define NSIG. + * lib/signal.in.h (NSIG): Define to 32 on NonStop Kernel. + * tests/test-signal.c (nsig): New variable. + Reported by Joachim Schmitz . + +2010-12-24 Bruno Haible + + rename, renameat: Avoid test failures on OSF/1 5.1. + * tests/test-rename.h (test_rename): Allow EEXIST and ENOTDIR as + alternative error codes. + * tests/test-renameat.c (main): Likewise. + +2010-12-24 Bruno Haible + + *printf: Detect large precisions bug on Solaris 10/SPARC. + * m4/printf.m4 (gl_PRINTF_PRECISION): Add one more test code, provided + by Paul Eggert. + * tests/test-snprintf-posix.h (test_function): Add this test code here + too. + * tests/test-sprintf-posix.h (test_function): Likewise. + * tests/test-vasnprintf-posix.c (test_function): Likewise. + * tests/test-vasprintf-posix.c (test_function): Likewise. + * doc/posix-functions/fprintf.texi: Mention Solaris 10 bug as worked + around by gnulib. + * doc/posix-functions/printf.texi: Likewise. + * doc/posix-functions/snprintf.texi: Likewise. + * doc/posix-functions/sprintf.texi: Likewise. + * doc/posix-functions/vfprintf.texi: Likewise. + * doc/posix-functions/vprintf.texi: Likewise. + * doc/posix-functions/vsnprintf.texi: Likewise. + * doc/posix-functions/vsprintf.texi: Likewise. + * doc/posix-functions/dprintf.texi: Undo last commit. + * doc/posix-functions/vdprintf.texi: Likewise. + +2010-12-23 Paul Eggert + + tests: port test-fdutimensat.c to Solaris 8 + * tests/test-fdutimensat.c (do_fdutimens): Don't assume + fdutimensat works with a nonnegative fd and AT_SYMLINK_NOFOLLOW. + On Solaris 8, it fails with errno == ENOSYS, because there is no + futimens (so it can't use the fd), and there is no lutimens (so it + can't implement AT_SYMLINK_NOFOLLOW on symlinks). + + vsnprintf: make more consistent with snprintf; doc fixes + + * doc/posix-functions/snprintf.texi (snprintf): The workaround for + the byte count return problem was promoted from the snprintf-posix + to the snprintf module. + * doc/posix-functions/vsnprintf.texi (vsnprintf): Likewise. + * m4/vsnprintf.m4 (gl_FUNC_VSNPRINTF): Also check + gl_SNPRINTF_RETVAL_C99, for consistency with gl_FUNC_SNPRINTF. + * tests/test-snprintf.c (main): Check the byte count returned. + * tests/test-vsnprintf.c (main): Likewise. + +2010-12-23 Eric Blake + + sigpipe: relax to LGPLv2+, since it did not have any LGPLv3+ parts + * modules/sigpipe (License): Relax license. + +2010-12-22 Paul Eggert + + doc: document Solaris printf bug with large float precisions + * doc/posix-functions/dprintf.texi (dprintf): + * doc/posix-functions/fprintf.texi (fprintf): + * doc/posix-functions/printf.texi (printf): + * doc/posix-functions/snprintf.texi (snprintf): + * doc/posix-functions/sprintf.texi (sprintf): + * doc/posix-functions/vdprintf.texi (vdprintf): + * doc/posix-functions/vfprintf.texi (vfprintf): + * doc/posix-functions/vprintf.texi (vprintf): + * doc/posix-functions/vsnprintf.texi (vsnprintf): + * doc/posix-functions/vsprintf.texi (vsprintf): + Mention that these functions mishandle large floating point + precisions on Solaris 10. The same bug is also present in Solaris + 8, and I assume earlier. This causes "cd gnulib-tests; make + check" to fail on Solaris 8 (and I assume, later) when building + the latest coreutils, in test-vasprintf-posix's call to + my_asprintf (&result, "%.4000f %d", 1.0, 99). I have not checked + the wide flavors (e.g., wprintf) so this patch just updates the + documentation for the narrow ones. + + test-posixtm.c: add two tests + * tests/test-posixtm.c: Add two tests, to highlight the + bug in Solaris 10 (and earlier) localtime. Gnulib doesn't work + around this bug; this is merely to document it. + +2010-12-22 Bruno Haible + + getlogin_r: Work around portability problem on OSF/1. + * m4/getlogin_r.m4 (gl_FUNC_GETLOGIN_R): Detect the OSF/1 problem. + * lib/unistd.in.h (getlogin_r): Replace if REPLACE_GETLOGIN_R is set. + * lib/getlogin_r.c (getlogin_r): When getlogin_r exists, invoke it and + test for a truncated result. + * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize REPLACE_GETLOGIN_R. + * modules/unistd (Makefile.am): Substitute REPLACE_GETLOGIN_R. + * modules/getlogin_r (Depends-on): Add memchr. + * doc/posix-functions/getlogin_r.texi: Mention the OSF/1 problem. + +2010-12-22 Bruno Haible + + ptsname: Avoid test failure on OSF/1 5.1. + * modules/ptsname-tests (Depends-on): Add 'same-inode'. + * tests/test-ptsname.c: Include , same-inode.h. + (same_slave): New function. + (main): Use it to compare ptsname's result with the expected file name. + +2010-12-22 Bruno Haible + + Port extended stdio modules to HP NonStop Kernel. + * lib/stdio-impl.h (_IOERR, _IOREAD, _IOWRT, _IORW) [__TANDEM]: New + macros. + * lib/fbufmode.c: Update comments. + * lib/fflush.c: Likewise. + * lib/fpurge.c: Likewise. + * lib/freadable.c: Likewise. + * lib/freadahead.c: Likewise. + * lib/freading.c: Likewise. + * lib/freadptr.c: Likewise. + * lib/freadseek.c: Likewise. + * lib/fseeko.c: Likewise. + * lib/fseterr.c: Likewise. + * lib/fwritable.c: Likewise. + * lib/fwriting.c: Likewise. + Reported by Joachim Schmitz . + +2010-12-22 Bruno Haible + + ttyname_r: Work around bug on OSF/1 5.1. + * doc/posix-functions/ttyname_r.texi: Mention the OSF/1 bug. + * m4/ttyname_r.m4 (gl_FUNC_TTYNAME_R): Detect the OSF/1 bug. Say "no" + instead of "guessing no" when the OSF/1 bug or the Solaris bug is + present. + * lib/ttyname_r.c (ttyname_r): Update comments. + +2010-12-22 Bruno Haible + + round: Implement result sign according to IEEE 754. + * lib/round.c (MIN, MINUS_ZERO): New macros. + (FLOOR_FREE_ROUND): Return -0.0 for -0.5 < x < 0. + * tests/test-roundf-ieee.c (main): Test also values between -1 and 1. + * tests/test-round-ieee.c (main): Likewise. + * tests/test-roundl-ieee.c (main): Likewise. + + trunc: Implement result sign according to IEEE 754. + * lib/trunc.c (MIN, MINUS_ZERO): New macros. + (FUNC): Return +0.0 for 0 < x < 1 and -0.0 for -1 < x < 0. + * tests/test-trunc2.c: Include minus-zero.h. + (MINUS_ZERO): New macro. + (trunc_reference): Keep in sync with lib/trunc.c. + * tests/test-truncf2.c: Include minus-zero.h. + (MINUS_ZERO): New macro. + (truncf_reference): Keep in sync with lib/trunc.c. + * tests/test-truncf-ieee.c (main): Test also values between -1 and 1. + * tests/test-trunc-ieee.c (main): Likewise. + * tests/test-truncl-ieee.c (main): Likewise. + + ceil: Implement result sign according to IEEE 754. + * lib/ceil.c (MIN, MINUS_ZERO): New macros. + (FUNC): Return -0.0 for -1 < x < 0. + * tests/test-ceil2.c: Include minus-zero.h. + (MINUS_ZERO): New macro. + (ceil_reference): Keep in sync with lib/ceil.c. + * tests/test-ceilf2.c: Include minus-zero.h. + (MINUS_ZERO): New macro. + (ceilf_reference): Keep in sync with lib/ceil.c. + * tests/test-ceilf-ieee.c (main): Test also values between -1 and 1. + * tests/test-ceil-ieee.c (main): Likewise. + * tests/test-ceill-ieee.c (main): Likewise. + + floor: Implement result sign according to IEEE 754. + * lib/floor.c (FUNC): Return +0.0 for 0 < x < 1. + * tests/test-floor2.c (floor_reference): Keep in sync with lib/floor.c. + * tests/test-floorf2.c (floorf_reference): Likewise. + * tests/test-floorf-ieee.c (main): Test also values between -1 and 1. + * tests/test-floor-ieee.c (main): Likewise. + * tests/test-floorl-ieee.c (main): Likewise. + +2010-12-22 Bruno Haible + + getaddrinfo: Update doc. + * doc/posix-functions/gai_strerror.texi: Return type is also different + on AIX and HP-UX. + +2010-12-22 Paul Eggert + + getaddrinfo, inet_ntop: Update doc for Solaris. + * doc/posix-functions/gai_strerror.texi: Return type is also an + issue on Solaris 9 and earlier. + * doc/posix-functions/inet_ntop.texi: 4th arg type is also an issue + on Solaris 10 and earlier. + +2010-12-21 Bruno Haible + + New module 'roundl-ieee'. + * modules/roundl-ieee: New file. + * m4/roundl.m4 (gl_FUNC_ROUNDL): If gl_FUNC_ROUNDL_IEEE is also used, + test whether roundl works according to ISO C 99 with IEC 60559. + * m4/roundl-ieee.m4: New file. + * modules/roundl-ieee-tests: New file. + * tests/test-roundl-ieee.c: New file, based on tests/test-roundl.c. + * tests/test-roundl.c (main): Remove signbit tests. + * modules/roundl-tests (Depends-on): Remove signbit. + * doc/posix-functions/roundl.texi: Mention the new module. + +2010-12-21 Bruno Haible + + New module 'truncl-ieee'. + * modules/truncl-ieee: New file. + * modules/truncl-ieee-tests: New file. + * tests/test-truncl-ieee.c: New file, based on tests/test-truncl.c. + * tests/test-truncl.c (main): Remove signbit tests. + * modules/truncl-tests (Depends-on): Remove signbit. + * doc/posix-functions/truncl.texi: Mention the new module. + +2010-12-21 Bruno Haible + + New module 'ceill-ieee'. + * modules/ceill-ieee: New file. + * modules/ceill-ieee-tests: New file. + * tests/test-ceill-ieee.c: New file, based on tests/test-ceill.c. + * tests/test-ceill.c (main): Remove signbit tests. + * modules/ceill-tests (Depends-on): Remove signbit. + * doc/posix-functions/ceill.texi: Mention the new module. + +2010-12-21 Bruno Haible + + New module 'floorl-ieee'. + * modules/floorl-ieee: New file. + * modules/floorl-ieee-tests: New file. + * tests/test-floorl-ieee.c: New file, based on tests/test-floorl.c. + * tests/test-floorl.c (main): Remove signbit tests. + * modules/floorl-tests (Depends-on): Remove signbit. + * doc/posix-functions/floorl.texi: Mention the new module. + +2010-12-21 Bruno Haible + + New module 'round-ieee'. + * modules/round-ieee: New file. + * m4/round.m4 (gl_FUNC_ROUND): If gl_FUNC_ROUND_IEEE is also used, test + whether round works according to ISO C 99 with IEC 60559. + * m4/round-ieee.m4: New file. + * modules/round-ieee-tests: New file. + * tests/test-round-ieee.c: New file, based on tests/test-roundf-ieee.c. + * tests/test-round1.c (main): Remove signbit tests. + * modules/round-tests (Depends-on): Remove 'signbit'. + * doc/posix-functions/round.texi: Mention the new module. + +2010-12-21 Bruno Haible + + New module 'trunc-ieee'. + * modules/trunc-ieee: New file. + * m4/trunc.m4 (gl_FUNC_TRUNC): If gl_FUNC_TRUNC_IEEE is also used, test + whether trunc works according to ISO C 99 with IEC 60559. + * m4/trunc-ieee.m4: New file. + * lib/math.in.h (trunc): Replace if REPLACE_TRUNC is set. + * m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize REPLACE_TRUNC. + * modules/math (Makefile.am): Substitute REPLACE_TRUNC. + * modules/trunc-ieee-tests: New file. + * tests/test-trunc-ieee.c: New file, based on tests/test-truncf-ieee.c. + * tests/test-trunc1.c (main): Remove signbit tests. + * modules/trunc-tests (Depends-on): Remove 'signbit'. + * doc/posix-functions/trunc.texi: Mention the new module. + +2010-12-21 Bruno Haible + + New module 'ceil-ieee'. + * modules/ceil-ieee: New file. + * m4/ceil.m4 (gl_FUNC_CEIL): Require gl_MATH_H_DEFAULTS. If + gl_FUNC_CEIL_IEEE is also used, test whether ceil works according to + ISO C 99 with IEC 60559. + * m4/ceil-ieee.m4: New file. + * modules/ceil (Files): Add lib/ceil.c. + (Depends-on): Add 'float'. + (configure.ac): Invoke gl_MATH_MODULE_INDICATOR. + * lib/math.in.h (ceil): New declaration. + * m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize GNULIB_CEIL, + REPLACE_CEIL. + * modules/math (Makefile.am): Substitute GNULIB_CEIL, REPLACE_CEIL. + * modules/ceil-ieee-tests: New file. + * tests/test-ceil-ieee.c: New file, based on tests/test-ceilf-ieee.c. + * tests/test-math-c++.cc: Check the signature of 'ceil'. + * doc/posix-functions/ceil.texi: Mention the new module. + +2010-12-21 Bruno Haible + + New module 'floor-ieee'. + * modules/floor-ieee: New file. + * m4/floor.m4 (gl_FUNC_FLOOR): Require gl_MATH_H_DEFAULTS. If + gl_FUNC_FLOOR_IEEE is also used, test whether floor works according to + ISO C 99 with IEC 60559. + * m4/floor-ieee.m4: New file. + * modules/floor (Files): Add lib/floor.c. + (Depends-on): Add 'float'. + (configure.ac): Invoke gl_MATH_MODULE_INDICATOR. + * lib/math.in.h (floor): New declaration. + * m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize GNULIB_FLOOR, + REPLACE_FLOOR. + * modules/math (Makefile.am): Substitute GNULIB_FLOOR, REPLACE_FLOOR. + * modules/floor-ieee-tests: New file. + * tests/test-floor-ieee.c: New file, based on tests/test-floorf-ieee.c. + * tests/test-math-c++.cc: Check the signature of 'floor'. + * doc/posix-functions/floor.texi: Mention the new module. + +2010-12-21 Bruno Haible + + New module 'roundf-ieee'. + * modules/roundf-ieee: New file. + * m4/roundf.m4 (gl_FUNC_ROUNDF): If gl_FUNC_ROUNDF_IEEE is also used, + test whether roundf works according to ISO C 99 with IEC 60559. + * m4/roundf-ieee.m4: New file. + * modules/roundf-ieee-tests: New file. + * tests/test-roundf-ieee.c: New file, based on tests/test-roundf1.c. + * tests/test-roundf1.c (main): Remove signbit tests. + * modules/roundf-tests (Depends-on): Remove 'signbit'. + * doc/posix-functions/roundf.texi: Mention the new module. + +2010-12-21 Bruno Haible + + New module 'truncf-ieee'. + * modules/truncf-ieee: New file. + * m4/truncf.m4 (gl_FUNC_TRUNCF): If gl_FUNC_TRUNCF_IEEE is also used, + test whether truncf works according to ISO C 99 with IEC 60559. + * m4/truncf-ieee.m4: New file. + * lib/math.in.h (truncf): Replace if REPLACE_TRUNCF is set. + * m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize REPLACE_TRUNCF. + * modules/math (Makefile.am): Substitute REPLACE_TRUNCF. + * modules/truncf-ieee-tests: New file. + * tests/test-truncf-ieee.c: New file, based on tests/test-truncf1.c. + * tests/test-truncf1.c (main): Remove signbit tests. + * modules/truncf-tests (Depends-on): Remove 'signbit'. + * doc/posix-functions/truncf.texi: Mention the new module. + +2010-12-21 Bruno Haible + + New module 'ceilf-ieee'. + * modules/ceilf-ieee: New file. + * m4/ceilf.m4 (gl_FUNC_FLOORF): If gl_FUNC_CEILF_IEEE is also used, + test whether ceilf works according to ISO C 99 with IEC 60559. + * m4/ceilf-ieee.m4: New file. + * modules/ceilf-ieee-tests: New file. + * tests/test-ceilf-ieee.c: New file, based on tests/test-ceilf1.c. + * tests/test-ceilf1.c (main): Remove signbit tests. + * modules/ceilf-tests (Depends-on): Remove 'signbit'. + * doc/posix-functions/ceilf.texi: Mention the new module. + +2010-12-21 Bruno Haible + + New module 'floorf-ieee'. + * modules/floorf-ieee: New file. + * m4/floorf.m4 (gl_FUNC_FLOORF): If gl_FUNC_FLOORF_IEEE is also used, + test whether floorf works according to ISO C 99 with IEC 60559. + * m4/floorf-ieee.m4: New file. + * modules/floorf-ieee-tests: New file. + * tests/test-floorf-ieee.c: New file, based on tests/test-floorf1.c. + * tests/test-floorf1.c (main): Remove signbit tests. + * modules/floorf-tests (Depends-on): Remove 'signbit'. + * doc/posix-functions/floorf.texi: Mention the new module. + +2010-12-21 Bruno Haible + + Support for minus zero in autoconf macros. + * m4/minus-zero.m4: New file, based on tests/minus-zero.h. + * m4/signbit.m4 (gl_FLOAT_SIGNBIT_CODE, gl_DOUBLE_SIGNBIT_CODE, + gl_LONG_DOUBLE_SIGNBIT_CODE, gl_FLOATTYPE_SIGNBIT_CODE): New macros. + * tests/minus-zero.h: Update comments. + +2010-12-21 Bruno Haible + + Tests for module 'ceil'. + * modules/ceil-tests: New file. + * tests/test-ceil1.c: New file, based on tests/test-ceill.c. + * tests/test-ceil2.c: New file, based on tests/test-ceilf2.c. + +2010-12-21 Bruno Haible + + Tests for module 'floor'. + * modules/floor-tests: New file. + * tests/test-floor1.c: New file, based on tests/test-floorl.c. + * tests/test-floor2.c: New file, based on tests/test-floorf2.c. + +2010-12-21 Bruno Haible + + math: Fix indentation. + * lib/math.in.h (floorf): Fix indentation. + +2010-12-21 Bruno Haible + + Fix cross-compilation guesses on Solaris. + * m4/fopen.m4 (gl_FUNC_FOPEN): Correct shell pattern so that it does + not match "solaris2.10". + * m4/open.m4 (gl_FUNC_OPEN): Likewise. + * m4/printf.m4 (gl_SNPRINTF_TRUNCATION_C99, gl_SNPRINTF_DIRECTIVE_N, + gl_VSNPRINTF_ZEROSIZE_C99): Likewise. + +2010-12-21 Paul Eggert + + snprintf: port snprintf (NULL, 0, ...) to Solaris 8 and 9 + This fixes a problem observed with the latest coreutils snapshot + that caused a test to fail on Solaris 8. src/csplit.c's call + snprintf (NULL, 0, format, UINT_MAX) returns -1 on Solaris 9 and + earlier, instead of returning the number of bytes that would have + been generated; this causes csplit to incorrectly report memory + exhaustion. + * m4/printf.m4 (gl_SNPRINTF_RETVAL_C99): Also check for + snprintf (NULL, 0, ...) and (for good measure) snprintf (buf, 0, ...). + Guess that it doesn't work on Solaris 2.6 through 9. Adjust + comments to match. + (gl_PRINTF_SIZES_C99, gl_PRINTF_DIRECTIVE_F, gl_SNPRINTF_RETVAL_C99): + Fix typo in matching older versions of Solaris: "solaris2.10" + is matched by the shell pattern "solaris2.[0-9]*". This matters + only for guessing while cross-compiling. + * m4/snprintf.m4 (gl_FUNC_SNPRINTF): Also check gl_SNPRINTF_RETVAL_C99. + +2010-12-20 Paul Eggert + + ftoastr: fix comment again + * lib/ftoastr.h: Fix typo in comment. Noted by Ben Pfaff in + . + Also, simplify example a bit by using flags = 0. + +2010-12-20 Bruno Haible + + round*, trunc*: Update documentation regarding glibc. + * doc/posix-functions/roundf.texi: Mention missing declaration problem. + * doc/posix-functions/round.texi: Likewise. + * doc/posix-functions/roundl.texi: Likewise. + * doc/posix-functions/truncf.texi: Likewise. + * doc/posix-functions/trunc.texi: Likewise. + * doc/posix-functions/truncl.texi: Likewise. + +2010-12-20 Bruno Haible + + roundf, round, roundl: Update documentation regarding OSF/1 5.1. + * doc/posix-functions/roundf.texi: Mention OSF/1 5.1 problem. + * doc/posix-functions/round.texi: Likewise. + * doc/posix-functions/roundl.texi: Likewise. + +2010-12-20 Bruno Haible + + ttyname_r: Add missing declaration on HP-UX 11. + * lib/unistd.in.h (ttyname_r): Test HAVE_DECL_TTYNAME_R instead of + HAVE_TTYNAME_R. + * m4/ttyname_r.m4 (gl_FUNC_TTYNAME_R): Test whether ttyname_r is + declared. Set HAVE_TTYNAME_R always. + * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize + HAVE_DECL_TTYNAME_R, not HAVE_TTYNAME_R. + * modules/unistd (Makefile.am): Substitute HAVE_DECL_TTYNAME_R, not + HAVE_TTYNAME_R. + * doc/posix-functions/ttyname_r.texi: Document the HP-UX 11 problem. + +2010-12-20 Bruno Haible + + getlogin, getlogin_r: Document HP-UX 11.11 bugs. + * doc/posix-functions/getlogin.texi: Document HP-UX 11.11 bug. + * doc/posix-functions/getlogin_r.texi: Likewise. + * tests/test-getlogin.c: Include . + (main): Avoid test failure on HP-UX 11.11. + * tests/test-getlogin_r.c (main): Likewise. + +2010-12-20 Bruno Haible + + getlogin_r: Add missing declaration on HP-UX 11. + * m4/getlogin_r.m4 (gl_FUNC_GETLOGIN_R): Test whether getlogin_r is + declared also when it exists as a function. + * doc/posix-functions/getlogin_r.texi: Document this workaround. + +2010-12-20 Bruno Haible + + wcsrtombs: Don't confuse mbstate_t with rpl_mbstate_t. + * lib/wcsrtombs.c: If gnulib overrides mbstate_t, define wcsrtombs + through wcrtomb. + +2010-12-19 Paul Eggert + + ftoastr: fix comment + * lib/ftoastr.h: Fix typo in comment. Noted by Ben Pfaff in + . + +2010-12-19 Bruno Haible + + isnan: Ensure it is a macro. + * lib/math.in.h (isnan): Define as a macro if not already a macro. + * doc/posix-functions/isnan.texi: Mention problem on IRIX, OSF/1, + Solaris. + +2010-12-19 Bruno Haible + + ldexpl test: Fix link error on OSF/1 5.1. + * modules/ldexpl-tests (Makefile.am): Define test_ldexpl_LDADD. + +2010-12-19 Bruno Haible + + wctype: Make it work in C++ mode on OSF/1 5.1. + * lib/wctype.in.h (iswblank): Declare but not define here. + * lib/iswblank.c: New file, extracted from lib/wctype.in.h. + * m4/wctype_h.m4 (gl_WCTYPE_H): Arrange to compile it if needed. + * modules/wctype (Files): Add lib/iswblank.c. + +2010-12-19 Bruno Haible + + signal: Document problem with type of SIGRTMIN, SIGRTMAX on OSF/1 5.1. + * doc/posix-headers/signal.texi: Document OSF/1 5.1 problem. + * lib/strsignal.c (strsignal): Cast SIGRTMIN to 'int'. + +2010-12-19 Bruno Haible + + sys_socket: Use POSIX compatible declarations on OSF/1 5.1. + * m4/sys_socket_h.m4 (gl_HEADER_SYS_SOCKET): On OSF/1, define + _POSIX_PII_SOCKET. + * doc/posix-functions/recv.texi: Document the OSF/1 problem. + * doc/posix-functions/recvfrom.texi: Likewise. + * doc/posix-functions/send.texi: Likewise. + * doc/posix-functions/sendto.texi: Likewise. + +2010-12-19 Bruno Haible + + tcgetsid: Add missing declaration on OSF/1 5.1. + * lib/termios.in.h (tcgetsid): Test HAVE_DECL_TCGETSID instead of + HAVE_TCGETSID. + * m4/tcgetsid.m4 (gl_FUNC_TCGETSID): Test whether tcgetsid is declared. + Don't set HAVE_TCGETSID. + * m4/termios_h.m4 (gl_TERMIOS_H_DEFAULTS): Initialize + HAVE_DECL_TCGETSID, not HAVE_TCGETSID. + * modules/termios (Makefile.am): Substitute HAVE_DECL_TCGETSID, not + HAVE_TCGETSID. + * doc/posix-functions/tcgetsid.texi: Mention the OSF/1 5.1 problem. + +2010-12-19 Bruno Haible + + stdio: Fix problem with popen() declaration on OSF/1 5.1. + * lib/stdio.in.h: During the include_next statement, let recursive + includes of this file include only the system header file. + +2010-12-19 Bruno Haible + + iconv_open: Fix regression from 2010-12-04. + * m4/iconv_open.m4 (gl_FUNC_ICONV_OPEN_UTF): Fix typo. + Reported by Noah Lavine . + +2010-12-19 Bruno Haible + + stdbool test: Avoid a gcc warning. + * tests/test-stdbool.c (main): Fail if e1 is false. + Reported by Jim Meyering. + +2010-12-19 Jim Meyering + + setenv: restore to working order + $HAVE_SETENV is used in gl_FUNC_SETENV, yet its definitions were + mistakenly removed. + * m4/setenv.m4 (gl_FUNC_SETENV_SEPARATE): Restore code to set + HAVE_SETENV. + * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Restore code to initialize + HAVE_SETENV. + +2010-12-19 Bruno Haible + + Document some different function declarations on OSF/1 5.1. + * doc/posix-functions/gai_strerror.texi: Mention different declaration. + * doc/posix-functions/inet_ntop.texi: Likewise. + * doc/posix-functions/gethostname.texi: Likewise. + * lib/unistd.in.h (gethostname): Update comment. + +2010-12-19 Bruno Haible + + doc: Mention vasprintf-posix module. + * doc/glibc-functions/asprintf.texi: Mention the workarounds present in + the 'vasprintf-posix' module. + * doc/glibc-functions/vasprintf.texi: Likewise. + +2010-12-19 Bruno Haible + + unsetenv: Add missing declaration on OSF/1 5.1. + * lib/stdlib.in.h (setenv): Test HAVE_DECL_UNSETENV, not HAVE_UNSETENV. + * m4/setenv.m4 (gl_FUNC_UNSETENV): Test whether unsetenv is declared. + Don't set HAVE_UNSETENV. In the test program, set _BSD. + * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize HAVE_DECL_UNSETENV, + not HAVE_UNSETENV. + * modules/stdlib (Makefile.am): Substitute HAVE_DECL_UNSETENV, not + HAVE_UNSETENV. + * doc/posix-functions/unsetenv.texi: Mention the OSF/1 5.1 problem. + +2010-12-19 Bruno Haible + + setenv: Add missing declaration on OSF/1 5.1. + * lib/stdlib.in.h (setenv): Test HAVE_DECL_SETENV, not HAVE_SETENV. + * m4/setenv.m4 (gl_FUNC_SETENV_SEPARATE): Test whether setenv is + declared. Don't set HAVE_SETENV. + * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize HAVE_DECL_SETENV, + not HAVE_SETENV. + * modules/stdlib (Makefile.am): Substitute HAVE_DECL_SETENV, not + HAVE_SETENV. + * doc/posix-functions/setenv.texi: Mention the OSF/1 5.1 problem. + +2010-12-19 Bruno Haible + + nl_langinfo tests: Avoid gcc warning. + * tests/test-nl_langinfo.c: Don't enable the GCC pragma for GCC 4.2. + +2010-12-19 Bruno Haible + + mknod: Avoid error in C++ mode on OSF/1 with GCC. + * lib/sys_stat.in.h (mknod): Use _GL_CXXALIAS_SYS_CAST instead of + _GL_CXXALIAS_SYS. + +2010-12-19 Bruno Haible + + stdbool: Relax test. + * tests/test-stdbool.c (e): Don't require that casts from a variable's + address to 'bool' work in static initializer, for compilers other than + GCC. + +2010-12-19 Bruno Haible + + ftello: Add missing declaration on OSF/1 5.1. + * lib/stdio.in.h (ftello): Test HAVE_DECL_FTELLO, not HAVE_FTELLO. + * m4/ftello.m4 (gl_FUNC_FTELLO): Test whether ftello is declared. + * m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Initialize HAVE_DECL_FTELLO. + * modules/stdio (Makefile.am): Substitute HAVE_DECL_FTELLO. + * doc/posix-functions/ftello.texi: Mention the OSF/1 5.1 problem. + +2010-12-19 Bruno Haible + + fseeko: Add missing declaration on OSF/1 5.1. + * lib/stdio.in.h (fseeko): Test HAVE_DECL_FSEEKO, not HAVE_FSEEKO. + * m4/fseeko.m4 (gl_FUNC_FSEEKO): Test whether fseeko is declared. + * m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Initialize HAVE_DECL_FSEEKO. + * modules/stdio (Makefile.am): Substitute HAVE_DECL_FSEEKO. + * doc/posix-functions/fseeko.texi: Mention the OSF/1 5.1 problem. + +2010-12-19 Bruno Haible + + fchdir: Add missing declaration on OSF/1 5.1. + * lib/unistd.in.h (fchdir): Provide declaration if systems lacks it. + * m4/fchdir.m4 (gl_FUNC_FCHDIR): Check whether fchdir is declared. + * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize HAVE_DECL_FCHDIR. + * modules/unistd (Makefile.am): Substitute HAVE_DECL_FCHDIR. + * doc/posix-functions/fchdir.texi: Mention the OSF/1 5.1 problem. + +2010-12-19 Bruno Haible + + relocatable-prog-wrapper: Separate from relocatable-prog. + * modules/relocatable-prog (Makefile.am): Define uninstall-hook and + uninstall-relocwrapper rule here. + * modules/relocatable-prog-wrapper (Makefile.am): ... not here. + Reported by Ian Beckwith . + +2010-12-19 Bruno Haible + + unistr/u8-mbsnlen: Add missing dependency. + * modules/unistr/u8-mbsnlen (Depends-on): Add unistr/u8-mbtouc. + Reported by Ian Beckwith . + +2010-12-19 Bruno Haible + + iconv: Make it possible again to use this module without 'iconv-h'. + * modules/iconv (configure.ac): Don't invoke gl_ICONV_MODULE_INDICATOR + if it is not defined. + Reported by Ian Beckwith . + +2010-12-18 Paul Eggert + + acl: port to Solaris 8 when copying from tmpfs to ufs + * lib/copy-acl.c (qcopy_acl): Also allow EINVAL as an ignorable + error number. Problem observed on Solaris 8 with latest + coreutils, with "mv A B", where A is on a tmpfs file system and B + is on a ufs file system. This caused coreutils' mv/part-symlink + test to fail. + + tests: set fail=0 at start + * tests/init.sh (setup_): Move fail=0 initialization here ... + (mktempd_): ... from here, so that tests can rely on fail being + set to 0 initially. This fixes a problem in coreutils; see: + http://lists.gnu.org/archive/html/coreutils/2010-12/msg00083.html + +2010-12-18 Bruno Haible + + memmem-simple: Stylistic changes. + * m4/memmem.m4 (gl_FUNC_MEMMEM_SIMPLE): Avoid possible gcc warning. + Fix preprocessor directive indentation. + +2010-12-15 Pádraig Brady + + memmem, memmem-simple: reorganize and expand empty needle check + * m4/memmem.m4 (gl_FUNC_MEMMEM_SIMPLE, gl_FUNC_MEMMEM): Move all + functional checks to memmem-simple so that one has a fully functional + memmem by using just this module. + Restrict the performance only check to the memmem module. + Also expand the empty needle check to ensure the correct + pointer is returned, not just a non NULL pointer. + * doc/glibc-functions/memmem.texi: Rearrange the portability + documentation to correlate with the rearranged checks. + Clarify exactly how the memmem and memmem-simple modules + relate to each other. + +2010-12-15 Pádraig Brady + Bruno Haible + + Improve cross-compilation guesses for uClibc. + * m4/memmem.m4 (gl_FUNC_MEMMEM_SIMPLE): When cross-compiling, assume + that uClibc does not have the glibc bug. + * m4/strcasestr.m4 (gl_FUNC_STRCASESTR_SIMPLE): Likewise. + * m4/strstr.m4 (gl_FUNC_STRSTR_SIMPLE): Likewise. + +2010-12-14 Eric Blake + + configmake: provide fallbacks for oldest supported autotools + * m4/configmake.m4: New file. + * modules/configmake (Files): Ship it. + (configure.ac): Use it to guarantee fallbacks. + 2010-12-13 Pádraig Brady read-file: Improve handling of large files diff --git a/build-aux/texinfo.tex b/build-aux/texinfo.tex --- a/build-aux/texinfo.tex +++ b/build-aux/texinfo.tex @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2010-09-06.17} +\def\texinfoversion{2010-12-23.17} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, @@ -6891,25 +6891,28 @@ } \fi -\def\scanmacro#1{% - \begingroup - \newlinechar`\^^M - \let\xeatspaces\eatspaces - % Undo catcode changes of \startcontents and \doprintindex - % When called from @insertcopying or (short)caption, we need active - % backslash to get it printed correctly. Previously, we had - % \catcode`\\=\other instead. We'll see whether a problem appears - % with macro expansion. --kasal, 19aug04 - \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ - % ... and \example - \spaceisspace - % - % Append \endinput to make sure that TeX does not see the ending newline. - % I've verified that it is necessary both for e-TeX and for ordinary TeX - % --kasal, 29nov03 - \scantokens{#1\endinput}% - \endgroup -} +\def\scanmacro#1{\begingroup + \newlinechar`\^^M + \let\xeatspaces\eatspaces + % + % Undo catcode changes of \startcontents and \doprintindex + % When called from @insertcopying or (short)caption, we need active + % backslash to get it printed correctly. Previously, we had + % \catcode`\\=\other instead. We'll see whether a problem appears + % with macro expansion. --kasal, 19aug04 + \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ + % + % ... and for \example: + \spaceisspace + % + % The \empty here causes a following catcode 5 newline to be eaten + % as part of reading whitespace after a control sequence. It does + % not eat a catcode 13 newline. There's no good way to handle the + % two cases. See the Macro Details node in the manual for the + % workaround we currently have to recommend for macros and + % line-oriented commands. + \scantokens{#1\empty}% +\endgroup} \def\scanexp#1{% \edef\temp{\noexpand\scanmacro{#1}}% diff --git a/doc/glibc-functions/asprintf.texi b/doc/glibc-functions/asprintf.texi --- a/doc/glibc-functions/asprintf.texi +++ b/doc/glibc-functions/asprintf.texi @@ -2,15 +2,62 @@ @subsection @code{asprintf} @findex asprintf -Gnulib module: vasprintf +Gnulib module: vasprintf or vasprintf-posix -Portability problems fixed by Gnulib: +Portability problems fixed by either Gnulib module @code{vasprintf} or @code{vasprintf-posix}: @itemize @item This function is missing on some platforms: AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw, Interix 3.5. @end itemize +Portability problems fixed by Gnulib module @code{vasprintf-posix}: +@itemize +@item +This function does not support size specifiers as in C99 (@code{hh}, @code{ll}, +@code{j}, @code{t}, @code{z}) on some platforms: +Cygwin 1.5.24, BeOS. +@item +printf of @samp{long double} numbers is unsupported on some platforms: +BeOS. +@item +printf @code{"%f"}, @code{"%e"}, @code{"%g"} of Infinity and NaN yields an +incorrect result on some platforms: +Solaris 11 2010-11. +@item +This function does not support the @samp{a} and @samp{A} directives on some +platforms: +glibc-2.3.6, MacOS X 10.5, NetBSD 5.0, OpenBSD 4.0, Solaris 11 2010-11, Cygwin 1.5.x, BeOS. +@item +This function does not support the @samp{F} directive on some platforms: +NetBSD 3.0, Cygwin 1.5.x, BeOS. +@item +This function does not support the @samp{ls} directive on some platforms: +OpenBSD 4.0, Cygwin 1.5.x, Haiku. +@item +This function does not support precisions in the @samp{ls} directive correctly +on some platforms: +Solaris 11 2010-11. +@item +This function does not support format directives that access arguments in an +arbitrary order, such as @code{"%2$s"}, on some platforms: +NetBSD 3.0, BeOS. +@item +This function doesn't support the @code{'} flag on some platforms: +NetBSD 3.0, Cygwin 1.5.24. +@item +printf @code{"%010f"} of NaN and Infinity yields an incorrect result (padded +with zeroes) on some platforms: +MacOS X 10.5, FreeBSD 6.0, NetBSD 5.0, Solaris 11 2010-11, Cygwin 1.5.x. +@item +This function does not support precisions larger than 512 or 1024 in integer, +floating-point and pointer output on some platforms: +BeOS. +@item +This function can crash in out-of-memory conditions on some platforms: +MacOS X 10.3, FreeBSD 6.0, NetBSD 5.0. +@end itemize + Portability problems not fixed by Gnulib: @itemize @end itemize diff --git a/doc/glibc-functions/memmem.texi b/doc/glibc-functions/memmem.texi --- a/doc/glibc-functions/memmem.texi +++ b/doc/glibc-functions/memmem.texi @@ -4,6 +4,10 @@ Gnulib module: memmem or memmem-simple +Both modules implement the same replacement for the @code{memmem} function +with the memmem module providing a replacement on more platforms where +the existing @code{memmem} function has a quadratic worst-case complexity. + Portability problems fixed by either Gnulib module @code{memmem-simple} or @code{memmem}: @itemize @@ -17,18 +21,20 @@ This function can trigger false positives for long periodic needles on some platforms: glibc 2.12, Cygwin 1.7.7. -@end itemize -Portability problems fixed by Gnulib module @code{memmem}: -@itemize @item This function returns incorrect values in some cases, such as when given an empty needle: glibc <= 2.0, Cygwin 1.5.x. +@end itemize + +Performance problems fixed by Gnulib module @code{memmem}: +@itemize @item This function has quadratic instead of linear worst-case complexity on some platforms: glibc 2.8, FreeBSD 6.2, NetBSD 5.0, AIX 5.1, Solaris 11 2010-11, Cygwin 1.5.x. +Note for small needles the replacement may be slower. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/glibc-functions/vasprintf.texi b/doc/glibc-functions/vasprintf.texi --- a/doc/glibc-functions/vasprintf.texi +++ b/doc/glibc-functions/vasprintf.texi @@ -2,15 +2,62 @@ @subsection @code{vasprintf} @findex vasprintf -Gnulib module: vasprintf +Gnulib module: vasprintf or vasprintf-posix -Portability problems fixed by Gnulib: +Portability problems fixed by either Gnulib module @code{vasprintf} or @code{vasprintf-posix}: @itemize @item This function is missing on some platforms: AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw, Interix 3.5. @end itemize +Portability problems fixed by Gnulib module @code{vasprintf-posix}: +@itemize +@item +This function does not support size specifiers as in C99 (@code{hh}, @code{ll}, +@code{j}, @code{t}, @code{z}) on some platforms: +Cygwin 1.5.24, BeOS. +@item +printf of @samp{long double} numbers is unsupported on some platforms: +BeOS. +@item +printf @code{"%f"}, @code{"%e"}, @code{"%g"} of Infinity and NaN yields an +incorrect result on some platforms: +Solaris 11 2010-11. +@item +This function does not support the @samp{a} and @samp{A} directives on some +platforms: +glibc-2.3.6, MacOS X 10.5, NetBSD 5.0, OpenBSD 4.0, Solaris 11 2010-11, Cygwin 1.5.x, BeOS. +@item +This function does not support the @samp{F} directive on some platforms: +NetBSD 3.0, Cygwin 1.5.x, BeOS. +@item +This function does not support the @samp{ls} directive on some platforms: +OpenBSD 4.0, Cygwin 1.5.x, Haiku. +@item +This function does not support precisions in the @samp{ls} directive correctly +on some platforms: +Solaris 11 2010-11. +@item +This function does not support format directives that access arguments in an +arbitrary order, such as @code{"%2$s"}, on some platforms: +NetBSD 3.0, BeOS. +@item +This function doesn't support the @code{'} flag on some platforms: +NetBSD 3.0, Cygwin 1.5.24. +@item +printf @code{"%010f"} of NaN and Infinity yields an incorrect result (padded +with zeroes) on some platforms: +MacOS X 10.5, FreeBSD 6.0, NetBSD 5.0, Solaris 11 2010-11, Cygwin 1.5.x. +@item +This function does not support precisions larger than 512 or 1024 in integer, +floating-point and pointer output on some platforms: +BeOS. +@item +This function can crash in out-of-memory conditions on some platforms: +MacOS X 10.3, FreeBSD 6.0, NetBSD 5.0. +@end itemize + Portability problems not fixed by Gnulib: @itemize @end itemize diff --git a/doc/posix-functions/ceil.texi b/doc/posix-functions/ceil.texi --- a/doc/posix-functions/ceil.texi +++ b/doc/posix-functions/ceil.texi @@ -4,10 +4,18 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/ceil.html} -Gnulib module: ceil +Gnulib module: ceil or ceil-ieee + +Portability problems fixed by either Gnulib module @code{ceil} or @code{ceil-ieee}: +@itemize +@end itemize -Portability problems fixed by Gnulib: +Portability problems fixed by Gnulib module @code{ceil-ieee}: @itemize +@item +This function returns a positive zero for a minus zero argument +on some platforms: +OSF/1 5.1. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/posix-functions/ceilf.texi b/doc/posix-functions/ceilf.texi --- a/doc/posix-functions/ceilf.texi +++ b/doc/posix-functions/ceilf.texi @@ -4,15 +4,23 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/ceilf.html} -Gnulib module: ceilf +Gnulib module: ceilf or ceilf-ieee -Portability problems fixed by Gnulib: +Portability problems fixed by either Gnulib module @code{ceilf} or @code{ceilf-ieee}: @itemize @item This function is missing on some platforms: AIX 5.1, HP-UX 11, Solaris 9. @end itemize +Portability problems fixed by Gnulib module @code{ceilf-ieee}: +@itemize +@item +This function returns a positive zero for a minus zero argument +on some platforms: +OSF/1 5.1. +@end itemize + Portability problems not fixed by Gnulib: @itemize @end itemize diff --git a/doc/posix-functions/ceill.texi b/doc/posix-functions/ceill.texi --- a/doc/posix-functions/ceill.texi +++ b/doc/posix-functions/ceill.texi @@ -4,15 +4,23 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/ceill.html} -Gnulib module: ceill +Gnulib module: ceill or ceill-ieee -Portability problems fixed by Gnulib: +Portability problems fixed by either Gnulib module @code{ceill} or @code{ceill-ieee}: @itemize @item This function is missing on some platforms: FreeBSD 5.2.1, NetBSD 5.0, OpenBSD 3.8, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin, Interix 3.5, BeOS. @end itemize +Portability problems fixed by Gnulib module @code{ceill-ieee}: +@itemize +@item +This function returns a positive zero for an argument between -1 and 0 +on some platforms: +OSF/1 5.1. +@end itemize + Portability problems not fixed by Gnulib: @itemize @end itemize diff --git a/doc/posix-functions/dprintf.texi b/doc/posix-functions/dprintf.texi diff --git a/doc/posix-functions/fchdir.texi b/doc/posix-functions/fchdir.texi --- a/doc/posix-functions/fchdir.texi +++ b/doc/posix-functions/fchdir.texi @@ -12,6 +12,9 @@ This function is missing on some platforms: Tandem/NSK, mingw, BeOS. But the replacement function is not safe to be used in libraries and is not multithread-safe. +@item +This function is not declared on some platforms: +OSF/1 5.1. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/posix-functions/floor.texi b/doc/posix-functions/floor.texi --- a/doc/posix-functions/floor.texi +++ b/doc/posix-functions/floor.texi @@ -4,10 +4,18 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/floor.html} -Gnulib module: floor +Gnulib module: floor or floor-ieee + +Portability problems fixed by either Gnulib module @code{floor} or @code{floor-ieee}: +@itemize +@end itemize -Portability problems fixed by Gnulib: +Portability problems fixed by Gnulib module @code{floor-ieee}: @itemize +@item +This function returns a positive zero for a minus zero argument +on some platforms: +OSF/1 5.1. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/posix-functions/floorf.texi b/doc/posix-functions/floorf.texi --- a/doc/posix-functions/floorf.texi +++ b/doc/posix-functions/floorf.texi @@ -4,15 +4,23 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/floorf.html} -Gnulib module: floorf +Gnulib module: floorf or floorf-ieee -Portability problems fixed by Gnulib: +Portability problems fixed by either Gnulib module @code{floorf} or @code{floorf-ieee}: @itemize @item This function is missing on some platforms: AIX 5.1, HP-UX 11, Solaris 9. @end itemize +Portability problems fixed by Gnulib module @code{floorf-ieee}: +@itemize +@item +This function returns a positive zero for a minus zero argument +on some platforms: +OSF/1 5.1. +@end itemize + Portability problems not fixed by Gnulib: @itemize @end itemize diff --git a/doc/posix-functions/floorl.texi b/doc/posix-functions/floorl.texi --- a/doc/posix-functions/floorl.texi +++ b/doc/posix-functions/floorl.texi @@ -4,7 +4,7 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/floorl.html} -Gnulib module: floorl +Gnulib module: floorl or floorl-ieee Portability problems fixed by Gnulib: @itemize diff --git a/doc/posix-functions/fprintf.texi b/doc/posix-functions/fprintf.texi --- a/doc/posix-functions/fprintf.texi +++ b/doc/posix-functions/fprintf.texi @@ -55,6 +55,11 @@ floating-point and pointer output on some platforms: Solaris 10/x86, mingw, BeOS. @item +This function mishandles large floating point precisions +(for example, formatting 1.0 with @samp{"%.511f"}) +on some platforms: +Solaris 10. +@item This function can crash in out-of-memory conditions on some platforms: MacOS X 10.3, FreeBSD 6.0, NetBSD 5.0. @end itemize diff --git a/doc/posix-functions/fseeko.texi b/doc/posix-functions/fseeko.texi --- a/doc/posix-functions/fseeko.texi +++ b/doc/posix-functions/fseeko.texi @@ -13,7 +13,8 @@ IRIX 5.3, OSF/1 4.0, Solaris 2.5.1, mingw. @item The declaration of @code{fseeko} in @code{} is not enabled by default -on some platforms: glibc 2.3.6. +on some platforms: +glibc 2.3.6, OSF/1 5.1. @item This function fails on seekable stdin, stdout, and stderr: cygwin <= 1.5.24. @end itemize diff --git a/doc/posix-functions/ftello.texi b/doc/posix-functions/ftello.texi --- a/doc/posix-functions/ftello.texi +++ b/doc/posix-functions/ftello.texi @@ -13,7 +13,8 @@ IRIX 5.3, OSF/1 4.0, Solaris 2.5.1, mingw. @item The declaration of @code{ftello} in @code{} is not enabled by default -on some platforms: glibc 2.3.6. +on some platforms: +glibc 2.3.6, OSF/1 5.1. @item This function produces incorrect results after @code{putc} that followed a @code{getc} call that reached EOF on some platforms: diff --git a/doc/posix-functions/gai_strerror.texi b/doc/posix-functions/gai_strerror.texi --- a/doc/posix-functions/gai_strerror.texi +++ b/doc/posix-functions/gai_strerror.texi @@ -15,4 +15,7 @@ Portability problems not fixed by Gnulib: @itemize +This function's return type is @code{char *} instead of @code{const char *} +on some platforms: +AIX 7.1, HP-UX 11, OSF/1 5.1, Solaris 9. @end itemize diff --git a/doc/posix-functions/gethostname.texi b/doc/posix-functions/gethostname.texi --- a/doc/posix-functions/gethostname.texi +++ b/doc/posix-functions/gethostname.texi @@ -16,6 +16,10 @@ Portability problems not fixed by Gnulib: @itemize @item +This function's second argument type is @code{int} instead of @code{size_t} +on some platforms: +OSF/1 5.1, Solaris 10. +@item If the given buffer is too small for the host name, some implementations fail with @code{EINVAL}, instead of returning a truncated host name. @end itemize diff --git a/doc/posix-functions/getlogin.texi b/doc/posix-functions/getlogin.texi --- a/doc/posix-functions/getlogin.texi +++ b/doc/posix-functions/getlogin.texi @@ -15,4 +15,8 @@ Portability problems not fixed by Gnulib: @itemize +@item +This function returns an empty string even when standard input is a tty +on some platforms: +HP-UX 11.11. @end itemize diff --git a/doc/posix-functions/getlogin_r.texi b/doc/posix-functions/getlogin_r.texi --- a/doc/posix-functions/getlogin_r.texi +++ b/doc/posix-functions/getlogin_r.texi @@ -12,10 +12,21 @@ This function is missing on some platforms: NetBSD 3.0, mingw. @item +This function is not declared unless @code{_REENTRANT} is defined, +on some platforms: +HP-UX 11. +@item This function has an incompatible declaration on some platforms: Solaris 11 2010-11 (when @code{_POSIX_PTHREAD_SEMANTICS} is not defined). +@item +This function returns a truncated result, instead of failing with error code +@code{ERANGE}, when the buffer is not large enough, on some platforms: +OSF/1 5.1. @end itemize Portability problems not fixed by Gnulib: @itemize +@item +This function fails even when standard input is a tty on some platforms: +HP-UX 11.11. @end itemize diff --git a/doc/posix-functions/inet_ntop.texi b/doc/posix-functions/inet_ntop.texi --- a/doc/posix-functions/inet_ntop.texi +++ b/doc/posix-functions/inet_ntop.texi @@ -11,8 +11,16 @@ @item This function is missing on some platforms: HP-UX 11.00, OSF/1 4.0, Solaris 2.5.1, mingw, Interix 3.5, BeOS. +@item +This function is declared in @code{} instead of @code{} +on some platforms: +NonStop Kernel. @end itemize Portability problems not fixed by Gnulib: @itemize +@item +This function's fourth argument type is @code{size_t} instead of +@code{socklen_t} on some platforms: +OSF/1 5.1, Solaris 10. @end itemize diff --git a/doc/posix-functions/inet_pton.texi b/doc/posix-functions/inet_pton.texi --- a/doc/posix-functions/inet_pton.texi +++ b/doc/posix-functions/inet_pton.texi @@ -11,6 +11,10 @@ @item This function is missing on some platforms: HP-UX 11.00, OSF/1 4.0, Solaris 2.5.1, mingw, Interix 3.5, BeOS. +@item +This function is declared in @code{} instead of @code{} +on some platforms: +NonStop Kernel. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/posix-functions/isnan.texi b/doc/posix-functions/isnan.texi --- a/doc/posix-functions/isnan.texi +++ b/doc/posix-functions/isnan.texi @@ -12,6 +12,9 @@ @code{isnan} was introduced with C99 and is thus commonly not present on pre-C99 systems. @item +@code{isnan} is not a macro on some platforms: +IRIX 6.5, OSF/1 5.1 with gcc, Solaris 11 2010-11. +@item On IRIX 6.5 with @code{cc}, @code{isnan} does not recognize some NaNs. @item On NetBSD/i386 and glibc/ia64, @code{isnan} does not recognize some diff --git a/doc/posix-functions/mbrtowc.texi b/doc/posix-functions/mbrtowc.texi --- a/doc/posix-functions/mbrtowc.texi +++ b/doc/posix-functions/mbrtowc.texi @@ -20,6 +20,9 @@ some platforms: Solaris 8. @item +This function fails if the @code{pwc} argument is NULL on some platforms: +Solaris 7. +@item This function does not ignore the @code{pwc} argument if the string argument is NULL on some platforms: OSF/1 5.1. diff --git a/doc/posix-functions/printf.texi b/doc/posix-functions/printf.texi --- a/doc/posix-functions/printf.texi +++ b/doc/posix-functions/printf.texi @@ -55,6 +55,11 @@ floating-point and pointer output on some platforms: Solaris 10/x86, mingw, BeOS. @item +This function mishandles large floating point precisions +(for example, formatting 1.0 with @samp{"%.511f"}) +on some platforms: +Solaris 10. +@item This function can crash in out-of-memory conditions on some platforms: MacOS X 10.3, FreeBSD 6.0, NetBSD 5.0. @end itemize diff --git a/doc/posix-functions/ptsname.texi b/doc/posix-functions/ptsname.texi --- a/doc/posix-functions/ptsname.texi +++ b/doc/posix-functions/ptsname.texi @@ -15,4 +15,7 @@ Portability problems not fixed by Gnulib: @itemize +@item +On Solaris 11 2010-11, this function fails on all BSD-style @file{/dev/pty*} +device files. @end itemize diff --git a/doc/posix-functions/readlink.texi b/doc/posix-functions/readlink.texi --- a/doc/posix-functions/readlink.texi +++ b/doc/posix-functions/readlink.texi @@ -14,7 +14,7 @@ @item On some platforms, @code{readlink} returns @code{int} instead of @code{ssize_t}: -FreeBSD 6.0, OpenBSD 3.8, Cygwin 1.5.x. +glibc 2.4, FreeBSD 6.0, OpenBSD 3.8, Cygwin 1.5.x. @item This function is missing on some platforms: mingw. diff --git a/doc/posix-functions/recv.texi b/doc/posix-functions/recv.texi --- a/doc/posix-functions/recv.texi +++ b/doc/posix-functions/recv.texi @@ -9,6 +9,10 @@ Portability problems fixed by Gnulib: @itemize @item +This function has the return type @code{int} instead of @code{ssize_t} +on some platforms: +OSF/1 5.1. +@item On Windows platforms (excluding Cygwin), error codes for @code{recv} are not placed in @code{errno}, and @code{WSAGetLastError} must be used instead. diff --git a/doc/posix-functions/recvfrom.texi b/doc/posix-functions/recvfrom.texi --- a/doc/posix-functions/recvfrom.texi +++ b/doc/posix-functions/recvfrom.texi @@ -9,6 +9,10 @@ Portability problems fixed by Gnulib: @itemize @item +This function has the return type @code{int} instead of @code{ssize_t} +on some platforms: +OSF/1 5.1. +@item On Windows platforms (excluding Cygwin), error codes for @code{recvfrom} are not placed in @code{errno}, and @code{WSAGetLastError} must be used instead. diff --git a/doc/posix-functions/round.texi b/doc/posix-functions/round.texi --- a/doc/posix-functions/round.texi +++ b/doc/posix-functions/round.texi @@ -4,18 +4,29 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/round.html} -Gnulib module: round +Gnulib module: round or round-ieee -Portability problems fixed by Gnulib: +Portability problems fixed by either Gnulib module @code{round} or @code{round-ieee}: @itemize @item This function is missing on some platforms: FreeBSD 5.2.1, OpenBSD 3.8, AIX 5.1, IRIX 6.5, OSF/1 4.0, Solaris 9, Interix 3.5. @item +This function is not declared on some platforms: +glibc 2.8, OSF/1 5.1. +@item This functions returns a wrong result for x = 1/2 - 2^-54 on some platforms: NetBSD 3.0, AIX 7.1. @end itemize +Portability problems fixed by Gnulib module @code{round-ieee}: +@itemize +@item +This function returns a positive zero for a minus zero argument +on some platforms: +OSF/1 5.1. +@end itemize + Portability problems not fixed by Gnulib: @itemize @end itemize diff --git a/doc/posix-functions/roundf.texi b/doc/posix-functions/roundf.texi --- a/doc/posix-functions/roundf.texi +++ b/doc/posix-functions/roundf.texi @@ -4,18 +4,29 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/roundf.html} -Gnulib module: roundf +Gnulib module: roundf or roundf-ieee -Portability problems fixed by Gnulib: +Portability problems fixed by either Gnulib module @code{roundf} or @code{roundf-ieee}: @itemize @item This function is missing on some platforms: FreeBSD 5.2.1, OpenBSD 3.8, AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 4.0, Solaris 9, Interix 3.5. @item +This function is not declared on some platforms: +glibc 2.8, OSF/1 5.1. +@item This functions returns a wrong result for x = 1/2 - 2^-25 on some platforms: mingw. @end itemize +Portability problems fixed by Gnulib module @code{roundf-ieee}: +@itemize +@item +This function returns a positive zero for a minus zero argument +on some platforms: +OSF/1 5.1. +@end itemize + Portability problems not fixed by Gnulib: @itemize @end itemize diff --git a/doc/posix-functions/roundl.texi b/doc/posix-functions/roundl.texi --- a/doc/posix-functions/roundl.texi +++ b/doc/posix-functions/roundl.texi @@ -4,13 +4,24 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/roundl.html} -Gnulib module: roundl +Gnulib module: roundl or roundl-ieee -Portability problems fixed by Gnulib: +Portability problems fixed by either Gnulib module @code{roundl} or @code{roundl-ieee}: @itemize @item This function is missing on some platforms: FreeBSD 5.2.1, NetBSD 5.0, OpenBSD 3.8, AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 4.0, Solaris 9, Cygwin, Interix 3.5, BeOS. +@item +This function is not declared on some platforms: +glibc 2.8, OSF/1 5.1. +@end itemize + +Portability problems fixed by Gnulib module @code{roundl-ieee}: +@itemize +@item +This function returns a positive zero for a minus zero argument +on some platforms: +OSF/1 5.1. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/posix-functions/send.texi b/doc/posix-functions/send.texi --- a/doc/posix-functions/send.texi +++ b/doc/posix-functions/send.texi @@ -9,6 +9,10 @@ Portability problems fixed by Gnulib: @itemize @item +This function has the return type @code{int} instead of @code{ssize_t} +on some platforms: +OSF/1 5.1. +@item On Windows platforms (excluding Cygwin), error codes for @code{send} are not placed in @code{errno}, and @code{WSAGetLastError} must be used instead. diff --git a/doc/posix-functions/sendto.texi b/doc/posix-functions/sendto.texi --- a/doc/posix-functions/sendto.texi +++ b/doc/posix-functions/sendto.texi @@ -9,6 +9,10 @@ Portability problems fixed by Gnulib: @itemize @item +This function has the return type @code{int} instead of @code{ssize_t} +on some platforms: +OSF/1 5.1. +@item On Windows platforms (excluding Cygwin), error codes for @code{sendto} are not placed in @code{errno}, and @code{WSAGetLastError} must be used instead. diff --git a/doc/posix-functions/setenv.texi b/doc/posix-functions/setenv.texi --- a/doc/posix-functions/setenv.texi +++ b/doc/posix-functions/setenv.texi @@ -12,6 +12,9 @@ This function is missing on some platforms: AIX 4.3.2, HP-UX 11.23, IRIX 6.5, Solaris 9, mingw, BeOS. @item +This function is not declared on some platforms: +OSF/1 5.1. +@item On some platforms, this function does not fail with @samp{EINVAL} when passed an empty string or a string containing @samp{=}: MacOS X 10.5, FreeBSD 6.0, NetBSD 1.6, OpenBSD 3.8, Cygwin 1.5.x. diff --git a/doc/posix-functions/snprintf.texi b/doc/posix-functions/snprintf.texi --- a/doc/posix-functions/snprintf.texi +++ b/doc/posix-functions/snprintf.texi @@ -12,6 +12,9 @@ This function is missing on some platforms: IRIX 5.3, OSF/1 4.0, Solaris 2.5.1. @item +This function does not return a byte count as specified in C99 on some platforms: +HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 9, mingw. +@item This function overwrites memory even when a size argument of 1 is passed on some platforms: Linux libc5. @@ -66,15 +69,17 @@ floating-point and pointer output on some platforms: Solaris 10/x86, mingw, BeOS. @item +This function mishandles large floating point precisions +(for example, formatting 1.0 with @samp{"%.511f"}) +on some platforms: +Solaris 10. +@item This function can crash in out-of-memory conditions on some platforms: MacOS X 10.3, FreeBSD 6.0, NetBSD 5.0. @item This function does not truncate the result as specified in C99 on some platforms: mingw. @item -This function does not return a byte count as specified in C99 on some platforms: -HP-UX 11, IRIX 6.5, OSF/1 5.1, mingw. -@item This function does not fully support the @samp{n} directive on some platforms: HP-UX 11, mingw. @item diff --git a/doc/posix-functions/sprintf.texi b/doc/posix-functions/sprintf.texi --- a/doc/posix-functions/sprintf.texi +++ b/doc/posix-functions/sprintf.texi @@ -55,6 +55,11 @@ floating-point and pointer output on some platforms: Solaris 10/x86, mingw, BeOS. @item +This function mishandles large floating point precisions +(for example, formatting 1.0 with @samp{"%.511f"}) +on some platforms: +Solaris 10. +@item This function can crash in out-of-memory conditions on some platforms: MacOS X 10.3, FreeBSD 6.0, NetBSD 5.0. @end itemize diff --git a/doc/posix-functions/strerror_r.texi b/doc/posix-functions/strerror_r.texi --- a/doc/posix-functions/strerror_r.texi +++ b/doc/posix-functions/strerror_r.texi @@ -30,7 +30,7 @@ @item When this function fails, it returns -1 and sets @code{errno}, instead of returning the error number, on some platforms: -glibc 2.8 with @code{-D_POSIX_C_SOURCE=200112L}, AIX 6.1, OSF/1 5.1. +glibc 2.12 with @code{-D_POSIX_C_SOURCE=200112L}, AIX 6.1, OSF/1 5.1. @item This function does not support the error values that are specified by POSIX but not defined by the system, on some platforms: diff --git a/doc/posix-functions/tcgetsid.texi b/doc/posix-functions/tcgetsid.texi --- a/doc/posix-functions/tcgetsid.texi +++ b/doc/posix-functions/tcgetsid.texi @@ -8,8 +8,12 @@ Portability problems fixed by Gnulib: @itemize +@item This function is missing on some platforms: MacOS X 10.3, FreeBSD 6.0, OpenBSD 4.5, Cygwin, mingw, Interix 3.5, BeOS. +@item +This function is not declared on some platforms: +OSF/1 5.1. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/posix-functions/trunc.texi b/doc/posix-functions/trunc.texi --- a/doc/posix-functions/trunc.texi +++ b/doc/posix-functions/trunc.texi @@ -4,13 +4,24 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/trunc.html} -Gnulib module: trunc +Gnulib module: trunc or trunc-ieee -Portability problems fixed by Gnulib: +Portability problems fixed by either Gnulib module @code{trunc} or @code{trunc-ieee}: @itemize @item This function is missing on some platforms: FreeBSD 5.2.1, NetBSD 3.0, OpenBSD 3.8, Solaris 9, Interix 3.5. +@item +This function is not declared (without @code{-D_GNU_SOURCE}) on some platforms: +glibc 2.8. +@end itemize + +Portability problems fixed by Gnulib module @code{trunc-ieee}: +@itemize +@item +This function returns a positive zero for a minus zero argument +on some platforms: +OSF/1 5.1. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/posix-functions/truncf.texi b/doc/posix-functions/truncf.texi --- a/doc/posix-functions/truncf.texi +++ b/doc/posix-functions/truncf.texi @@ -4,13 +4,24 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/truncf.html} -Gnulib module: truncf +Gnulib module: truncf or truncf-ieee -Portability problems fixed by Gnulib: +Portability problems fixed by either Gnulib module @code{truncf} or @code{truncf-ieee}: @itemize @item This function is missing on some platforms: FreeBSD 5.2.1, NetBSD 3.0, OpenBSD 3.8, AIX 5.1, HP-UX 11, Solaris 9, Interix 3.5. +@item +This function is not declared (without @code{-D_GNU_SOURCE}) on some platforms: +glibc 2.8. +@end itemize + +Portability problems fixed by Gnulib module @code{truncf-ieee}: +@itemize +@item +This function returns a positive zero for a minus zero argument +on some platforms: +OSF/1 5.1. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/posix-functions/truncl.texi b/doc/posix-functions/truncl.texi --- a/doc/posix-functions/truncl.texi +++ b/doc/posix-functions/truncl.texi @@ -4,18 +4,29 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/truncl.html} -Gnulib module: truncl +Gnulib module: truncl or truncl-ieee -Portability problems fixed by Gnulib: +Portability problems fixed by either Gnulib module @code{truncl} or @code{truncl-ieee}: @itemize @item This function is missing on some platforms: FreeBSD 5.2.1, NetBSD 5.0, OpenBSD 3.8, AIX 5.1, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin, Interix 3.5, BeOS. @item +This function is not declared (without @code{-D_GNU_SOURCE}) on some platforms: +glibc 2.8. +@item This function crashes on some platforms: OSF/1 4.0. @end itemize +Portability problems fixed by Gnulib module @code{truncl-ieee}: +@itemize +@item +This function returns a positive zero for an argument between -1 and 0 +on some platforms: +OSF/1 5.1. +@end itemize + Portability problems not fixed by Gnulib: @itemize @end itemize diff --git a/doc/posix-functions/ttyname_r.texi b/doc/posix-functions/ttyname_r.texi --- a/doc/posix-functions/ttyname_r.texi +++ b/doc/posix-functions/ttyname_r.texi @@ -12,9 +12,17 @@ This function is missing on some platforms: NetBSD 3.0, mingw, BeOS. @item +This function is not declared unless @code{_REENTRANT} is defined, +on some platforms: +HP-UX 11. +@item This function has an incompatible declaration on some platforms: MacOS X 10.4, Solaris 11 2010-11 (when @code{_POSIX_PTHREAD_SEMANTICS} is not defined). @item +This function ignores the size argument, thus overwriting memory after the +buffer, on some platforms: +OSF/1 5.1. +@item This function refuses to do anything when the output buffer is less than 128 bytes large, on some platforms: Solaris 11 2010-11. diff --git a/doc/posix-functions/unsetenv.texi b/doc/posix-functions/unsetenv.texi --- a/doc/posix-functions/unsetenv.texi +++ b/doc/posix-functions/unsetenv.texi @@ -12,6 +12,9 @@ This function is missing on some platforms: AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, mingw, BeOS. @item +This function is not declared on some platforms: +OSF/1 5.1. +@item This function has the return type @samp{void} instead of @samp{int} on some platforms: MacOS X 10.3, FreeBSD 6.0, NetBSD 1.6, OpenBSD 3.8, OSF/1 5.1. diff --git a/doc/posix-functions/vdprintf.texi b/doc/posix-functions/vdprintf.texi diff --git a/doc/posix-functions/vfprintf.texi b/doc/posix-functions/vfprintf.texi --- a/doc/posix-functions/vfprintf.texi +++ b/doc/posix-functions/vfprintf.texi @@ -55,6 +55,11 @@ floating-point and pointer output on some platforms: Solaris 10/x86, mingw, BeOS. @item +This function mishandles large floating point precisions +(for example, formatting 1.0 with @samp{"%.511f"}) +on some platforms: +Solaris 10. +@item This function can crash in out-of-memory conditions on some platforms: MacOS X 10.3, FreeBSD 6.0, NetBSD 5.0. @end itemize diff --git a/doc/posix-functions/vprintf.texi b/doc/posix-functions/vprintf.texi --- a/doc/posix-functions/vprintf.texi +++ b/doc/posix-functions/vprintf.texi @@ -55,6 +55,11 @@ floating-point and pointer output on some platforms: Solaris 10/x86, mingw, BeOS. @item +This function mishandles large floating point precisions +(for example, formatting 1.0 with @samp{"%.511f"}) +on some platforms: +Solaris 10. +@item This function can crash in out-of-memory conditions on some platforms: MacOS X 10.3, FreeBSD 6.0, NetBSD 5.0. @end itemize diff --git a/doc/posix-functions/vsnprintf.texi b/doc/posix-functions/vsnprintf.texi --- a/doc/posix-functions/vsnprintf.texi +++ b/doc/posix-functions/vsnprintf.texi @@ -15,6 +15,9 @@ This function overwrites memory even when a size argument of 1 is passed on some platforms: Linux libc5. +@item +This function does not return a byte count as specified in C99 on some platforms: +HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 9, mingw. @end itemize Portability problems fixed by Gnulib module @code{vsnprintf-posix}: @@ -66,15 +69,17 @@ floating-point and pointer output on some platforms: Solaris 10/x86, mingw, BeOS. @item +This function mishandles large floating point precisions +(for example, formatting 1.0 with @samp{"%.511f"}) +on some platforms: +Solaris 10. +@item This function can crash in out-of-memory conditions on some platforms: MacOS X 10.3, FreeBSD 6.0, NetBSD 5.0. @item This function does not truncate the result as specified in C99 on some platforms: mingw. @item -This function does not return a byte count as specified in C99 on some platforms: -HP-UX 11, IRIX 6.5, OSF/1 5.1, mingw. -@item This function does not fully support the @samp{n} directive on some platforms: HP-UX 11, mingw. @item diff --git a/doc/posix-functions/vsprintf.texi b/doc/posix-functions/vsprintf.texi --- a/doc/posix-functions/vsprintf.texi +++ b/doc/posix-functions/vsprintf.texi @@ -55,6 +55,11 @@ floating-point and pointer output on some platforms: Solaris 10/x86, mingw, BeOS. @item +This function mishandles large floating point precisions +(for example, formatting 1.0 with @samp{"%.511f"}) +on some platforms: +Solaris 10. +@item This function can crash in out-of-memory conditions on some platforms: MacOS X 10.3, FreeBSD 6.0, NetBSD 5.0. @end itemize diff --git a/doc/posix-headers/signal.texi b/doc/posix-headers/signal.texi --- a/doc/posix-headers/signal.texi +++ b/doc/posix-headers/signal.texi @@ -35,4 +35,8 @@ @item Many signals are not defined on some platforms: mingw. +@item +The macros @code{SIGRTMIN} and @code{SIGRTMAX} expand to an expression of type +@code{long} instead of @code{int} on some platforms: +OSF/1 5.1. @end itemize diff --git a/doc/posix-headers/sys_select.texi b/doc/posix-headers/sys_select.texi --- a/doc/posix-headers/sys_select.texi +++ b/doc/posix-headers/sys_select.texi @@ -9,7 +9,7 @@ @itemize @item This header file is missing on some platforms: -HP-UX 11.11, mingw, BeOS. +HP-UX 11.11, NonStop Kernel, mingw, BeOS. @item This header file is not self-contained on some platforms: it requires @code{} to be included first. diff --git a/lib/alloca.c b/lib/alloca.c --- a/lib/alloca.c +++ b/lib/alloca.c @@ -94,21 +94,20 @@ # 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 @@ # 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/lib/arpa_inet.in.h b/lib/arpa_inet.in.h --- a/lib/arpa_inet.in.h +++ b/lib/arpa_inet.in.h @@ -34,6 +34,12 @@ # include #endif +/* On NonStop Kernel, inet_ntop and inet_pton are declared in . + But avoid namespace pollution on glibc systems. */ +#if defined __TANDEM && !defined __GLIBC__ +# include +#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 @@ For more details, see the POSIX:2001 specification . */ -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 @@ #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 @@ # endif #endif -#ifdef __cplusplus -} -#endif #endif /* _GL_ARPA_INET_H */ #endif /* _GL_ARPA_INET_H */ diff --git a/lib/ceil.c b/lib/ceil.c --- a/lib/ceil.c +++ b/lib/ceil.c @@ -1,5 +1,5 @@ /* Round towards positive infinity. - Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. + 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 @@ -23,23 +23,35 @@ #include +#undef MIN + #ifdef USE_LONG_DOUBLE # define FUNC ceill # define DOUBLE long double # define MANT_DIG LDBL_MANT_DIG +# define MIN LDBL_MIN # define L_(literal) literal##L #elif ! defined USE_FLOAT # define FUNC ceil # define DOUBLE double # define MANT_DIG DBL_MANT_DIG +# define MIN DBL_MIN # define L_(literal) literal #else /* defined USE_FLOAT */ # define FUNC ceilf # define DOUBLE float # define MANT_DIG FLT_MANT_DIG +# define MIN FLT_MIN # define L_(literal) literal##f #endif +/* -0.0. See minus-zero.h. */ +#if defined __hpux || defined __sgi || defined __ICC +# define MINUS_ZERO (-MIN * MIN) +#else +# define MINUS_ZERO L_(-0.0) +#endif + /* 2^(MANT_DIG-1). */ static const DOUBLE TWO_MANT_DIG = /* Assume MANT_DIG <= 5 * 31. @@ -78,8 +90,12 @@ } else if (z < L_(0.0)) { + /* For -1 < x < 0, return -0.0 regardless of the current rounding + mode. */ + if (z > L_(-1.0)) + z = MINUS_ZERO; /* Avoid rounding errors for values near -2^k, where k >= MANT_DIG-1. */ - if (z > - TWO_MANT_DIG) + else if (z > - TWO_MANT_DIG) { /* Round to the next integer (nearest or up or down, doesn't matter). */ z -= TWO_MANT_DIG; diff --git a/lib/copy-acl.c b/lib/copy-acl.c --- a/lib/copy-acl.c +++ b/lib/copy-acl.c @@ -358,7 +358,7 @@ if (ret < 0 && saved_errno == 0) { saved_errno = errno; - if ((errno == ENOSYS || errno == EOPNOTSUPP) + if ((errno == ENOSYS || errno == EOPNOTSUPP || errno == EINVAL) && !acl_nontrivial (count, entries)) saved_errno = 0; } diff --git a/lib/fbufmode.c b/lib/fbufmode.c --- a/lib/fbufmode.c +++ b/lib/fbufmode.c @@ -50,7 +50,7 @@ return _IOFBF; #elif defined __EMX__ /* emx+gcc */ return fp->_flags & (_IOLBF | _IONBF | _IOFBF); -#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 HAVE___FLBF /* Solaris >= 7 */ if (__flbf (fp)) return _IOLBF; diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h --- a/lib/fcntl.in.h +++ b/lib/fcntl.in.h @@ -43,7 +43,13 @@ #ifndef _GL_FCNTL_H #include -#ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems. */ +/* On some systems other than glibc, is a prerequisite of + . On glibc systems, we would like to avoid namespace pollution. + But on glibc systems, includes inside an + extern "C" { ... } block, which leads to errors in C++ mode with the + overridden 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 #endif /* The include_next requires a split double-inclusion guard. */ diff --git a/lib/fflush.c b/lib/fflush.c --- a/lib/fflush.c +++ b/lib/fflush.c @@ -60,7 +60,7 @@ fp->_ungetc_count = 0; fp->_rcount = - fp->_rcount; } -# 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 */ /* Nothing to do. */ # else /* other implementations */ fseeko (fp, 0, SEEK_CUR); diff --git a/lib/floor.c b/lib/floor.c --- a/lib/floor.c +++ b/lib/floor.c @@ -1,5 +1,5 @@ /* Round towards negative infinity. - Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. + 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 @@ -65,8 +65,12 @@ if (z > L_(0.0)) { + /* For 0 < x < 1, return +0.0 even if the current rounding mode is + FE_DOWNWARD. */ + if (z < L_(1.0)) + z = L_(0.0); /* Avoid rounding errors for values near 2^k, where k >= MANT_DIG-1. */ - if (z < TWO_MANT_DIG) + else if (z < TWO_MANT_DIG) { /* Round to the next integer (nearest or up or down, doesn't matter). */ z += TWO_MANT_DIG; diff --git a/lib/fpurge.c b/lib/fpurge.c --- a/lib/fpurge.c +++ b/lib/fpurge.c @@ -91,7 +91,7 @@ fp->_wcount = 0; fp->_ungetc_count = 0; return 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 */ fp->_ptr = fp->_base; if (fp->_ptr != NULL) fp->_cnt = 0; diff --git a/lib/freadable.c b/lib/freadable.c --- a/lib/freadable.c +++ b/lib/freadable.c @@ -33,7 +33,7 @@ return (fp_->_flags & (__SRW | __SRD)) != 0; #elif defined __EMX__ /* emx+gcc */ return (fp->_flags & (_IORW | _IOREAD)) != 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 */ return (fp->_flag & (_IORW | _IOREAD)) != 0; #elif defined __QNX__ /* QNX */ return (fp->_Mode & 0x1 /* _MOPENR */) != 0; diff --git a/lib/freadahead.c b/lib/freadahead.c --- a/lib/freadahead.c +++ b/lib/freadahead.c @@ -48,7 +48,7 @@ /* equivalent to (fp->_ungetc_count == 0 ? fp->_rcount : fp->_ungetc_count - fp->_rcount) */ return (fp->_rcount > 0 ? fp->_rcount : fp->_ungetc_count - fp->_rcount); -#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_->_flag & _IOWRT) != 0) return 0; return fp_->_cnt; diff --git a/lib/freading.c b/lib/freading.c --- a/lib/freading.c +++ b/lib/freading.c @@ -39,7 +39,7 @@ return (fp_->_flags & __SRD) != 0; #elif defined __EMX__ /* emx+gcc */ return (fp->_flags & _IOREAD) != 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 defined __sun /* Solaris */ return (fp->_flag & _IOREAD) != 0 && (fp->_flag & _IOWRT) == 0; # else diff --git a/lib/freadptr.c b/lib/freadptr.c --- a/lib/freadptr.c +++ b/lib/freadptr.c @@ -56,7 +56,7 @@ abort (); *sizep = fp->_rcount; return fp->_ptr; -#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_->_flag & _IOWRT) != 0) return NULL; size = fp_->_cnt; diff --git a/lib/freadseek.c b/lib/freadseek.c --- a/lib/freadseek.c +++ b/lib/freadseek.c @@ -42,7 +42,7 @@ #elif defined __EMX__ /* emx+gcc */ fp->_ptr += increment; fp->_rcount -= increment; -#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_->_ptr += increment; fp_->_cnt -= increment; #elif defined __UCLIBC__ /* uClibc */ diff --git a/lib/fseeko.c b/lib/fseeko.c --- a/lib/fseeko.c +++ b/lib/fseeko.c @@ -69,7 +69,7 @@ && 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 @@ 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/fseterr.c b/lib/fseterr.c --- a/lib/fseterr.c +++ b/lib/fseterr.c @@ -35,7 +35,7 @@ fp_->_flags |= __SERR; #elif defined __EMX__ /* emx+gcc */ fp->_flags |= _IOERR; -#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 |= _IOERR; #elif defined __UCLIBC__ /* uClibc */ fp->__modeflags |= __FLAG_ERROR; diff --git a/lib/ftoastr.c b/lib/ftoastr.c --- a/lib/ftoastr.c +++ b/lib/ftoastr.c @@ -69,7 +69,7 @@ /* On hosts where it's not known that snprintf works, use sprintf to implement the subset needed here. Typically BUFSIZE is big enough and there's little or no performance hit. */ -#if ! GNULIB_SNPRINTF_POSIX +#if ! GNULIB_SNPRINTF # undef snprintf # define snprintf ftoastr_snprintf static int diff --git a/lib/ftoastr.h b/lib/ftoastr.h --- a/lib/ftoastr.h +++ b/lib/ftoastr.h @@ -39,8 +39,8 @@ Example: - char buf[DBL_ABUFSIZE_BOUND]; - int r = dtoastr (buf, sizeof buf, "%*.*g", 0, 0.1); + char buf[DBL_BUFSIZE_BOUND]; + int r = dtoastr (buf, sizeof buf, 0, 0, 0.1); In the C locale, this sets R to 3 and stores "0.1" into BUF. */ diff --git a/lib/fwritable.c b/lib/fwritable.c --- a/lib/fwritable.c +++ b/lib/fwritable.c @@ -33,7 +33,7 @@ return (fp_->_flags & (__SRW | __SWR)) != 0; #elif defined __EMX__ /* emx+gcc */ return (fp->_flags & (_IORW | _IOWRT)) != 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 */ return (fp->_flag & (_IORW | _IOWRT)) != 0; #elif defined __QNX__ /* QNX */ return (fp->_Mode & 0x2 /* _MOPENW */) != 0; diff --git a/lib/fwriting.c b/lib/fwriting.c --- a/lib/fwriting.c +++ b/lib/fwriting.c @@ -33,7 +33,7 @@ return (fp_->_flags & __SWR) != 0; #elif defined __EMX__ /* emx+gcc */ return (fp->_flags & _IOWRT) != 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 */ return (fp->_flag & _IOWRT) != 0; #elif defined __UCLIBC__ /* uClibc */ return (fp->__modeflags & __FLAG_WRITING) != 0; diff --git a/lib/gen-uni-tables.c b/lib/gen-uni-tables.c --- a/lib/gen-uni-tables.c +++ b/lib/gen-uni-tables.c @@ -27,6 +27,7 @@ /usr/local/share/Unidata/EastAsianWidth.txt \ /usr/local/share/Unidata/LineBreak.txt \ /usr/local/share/Unidata/WordBreakProperty.txt \ + /usr/local/share/Unidata/GraphemeBreakProperty.txt \ /usr/local/share/Unidata/CompositionExclusions.txt \ /usr/local/share/Unidata/SpecialCasing.txt \ /usr/local/share/Unidata/CaseFolding.txt \ @@ -5141,6 +5142,8 @@ } } +/* ========================================================================= */ + /* Line breaking classification. */ enum @@ -6743,6 +6746,234 @@ /* ========================================================================= */ +/* Grapheme break property. */ + +/* Possible values of the Grapheme_Cluster_Break property. */ +enum +{ + GBP_OTHER = 0, + GBP_CR = 1, + GBP_LF = 2, + GBP_CONTROL = 3, + GBP_EXTEND = 4, + GBP_PREPEND = 5, + GBP_SPACINGMARK = 6, + GBP_L = 7, + GBP_V = 8, + GBP_T = 9, + GBP_LV = 10, + GBP_LVT = 11 +}; + +/* Construction of sparse 3-level tables. */ +#define TABLE gbp_table +#define ELEMENT unsigned char +#define DEFAULT GBP_OTHER +#define xmalloc malloc +#define xrealloc realloc +#include "3level.h" + +/* The grapheme break property from the GraphemeBreakProperty.txt file. */ +int unicode_org_gbp[0x110000]; + +/* Output the per-character grapheme break property table. */ +static void +output_gbp_table (const char *filename, const char *version) +{ + FILE *stream; + unsigned int ch, i; + struct gbp_table t; + unsigned int level1_offset, level2_offset, level3_offset; + + stream = fopen (filename, "w"); + if (stream == NULL) + { + fprintf (stderr, "cannot open '%s' for writing\n", filename); + exit (1); + } + + fprintf (stream, "/* DO NOT EDIT! GENERATED AUTOMATICALLY! */\n"); + fprintf (stream, "/* Grapheme break property of Unicode characters. */\n"); + fprintf (stream, "/* Generated automatically by gen-uni-tables.c for Unicode %s. */\n", + version); + + t.p = 7; + t.q = 9; + gbp_table_init (&t); + + for (ch = 0; ch < 0x110000; ch++) + gbp_table_add (&t, ch, unicode_org_gbp[ch]); + + gbp_table_finalize (&t); + + /* Offsets in t.result, in memory of this process. */ + level1_offset = + 5 * sizeof (uint32_t); + level2_offset = + 5 * sizeof (uint32_t) + + t.level1_size * sizeof (uint32_t); + level3_offset = + 5 * sizeof (uint32_t) + + t.level1_size * sizeof (uint32_t) + + (t.level2_size << t.q) * sizeof (uint32_t); + + for (i = 0; i < 5; i++) + fprintf (stream, "#define gbrkprop_header_%d %d\n", i, + ((uint32_t *) t.result)[i]); + fprintf (stream, "static const\n"); + fprintf (stream, "struct\n"); + fprintf (stream, " {\n"); + fprintf (stream, " int level1[%zu];\n", t.level1_size); + fprintf (stream, " short level2[%zu << %d];\n", t.level2_size, t.q); + fprintf (stream, " unsigned char level3[(%zu << %d) / 2];\n", + t.level3_size, t.p); + fprintf (stream, " }\n"); + fprintf (stream, "unigbrkprop =\n"); + fprintf (stream, "{\n"); + fprintf (stream, " {"); + if (t.level1_size > 8) + fprintf (stream, "\n "); + for (i = 0; i < t.level1_size; i++) + { + uint32_t offset; + if (i > 0 && (i % 8) == 0) + fprintf (stream, "\n "); + offset = ((uint32_t *) (t.result + level1_offset))[i]; + if (offset == 0) + fprintf (stream, " %5d", -1); + else + fprintf (stream, " %5zu", + (offset - level2_offset) / sizeof (uint32_t)); + if (i+1 < t.level1_size) + fprintf (stream, ","); + } + if (t.level1_size > 8) + fprintf (stream, "\n "); + fprintf (stream, " },\n"); + fprintf (stream, " {"); + if (t.level2_size << t.q > 8) + fprintf (stream, "\n "); + for (i = 0; i < t.level2_size << t.q; i++) + { + uint32_t offset; + if (i > 0 && (i % 8) == 0) + fprintf (stream, "\n "); + offset = ((uint32_t *) (t.result + level2_offset))[i]; + if (offset == 0) + fprintf (stream, " %5d", -1); + else + fprintf (stream, " %5zu", + (offset - level3_offset) / sizeof (uint8_t) / 2); + if (i+1 < t.level2_size << t.q) + fprintf (stream, ","); + } + if (t.level2_size << t.q > 8) + fprintf (stream, "\n "); + fprintf (stream, " },\n"); + fprintf (stream, " {"); + if (t.level3_size << t.p > 8) + fprintf (stream, "\n "); + for (i = 0; i < (t.level3_size << t.p) / 2; i++) + { + unsigned char *p = (unsigned char *) (t.result + level3_offset); + unsigned char value0 = p[i * 2]; + unsigned char value1 = p[i * 2 + 1]; + if (i > 0 && (i % 8) == 0) + fprintf (stream, "\n "); + fprintf (stream, " 0x%02x%s", (value1 << 4) + value0, + (i+1 < (t.level3_size << t.p) / 2 ? "," : "")); + } + if (t.level3_size << t.p > 8) + fprintf (stream, "\n "); + fprintf (stream, " }\n"); + fprintf (stream, "};\n"); + + if (ferror (stream) || fclose (stream)) + { + fprintf (stderr, "error writing to '%s'\n", filename); + exit (1); + } +} + +/* Stores in unicode_org_gbp[] the grapheme breaking property from the + GraphemeBreakProperty.txt file. */ +static void +fill_org_gbp (const char *graphemebreakproperty_filename) +{ + unsigned int i; + FILE *stream; + int lineno = 0; + + for (i = 0; i < 0x110000; i++) + unicode_org_gbp[i] = GBP_OTHER; + + stream = fopen (graphemebreakproperty_filename, "r"); + if (stream == NULL) + { + fprintf (stderr, "error during fopen of '%s'\n", + graphemebreakproperty_filename); + exit (1); + } + + for (;;) + { + char buf[200+1]; + unsigned int i1, i2; + char padding[200+1]; + char propname[200+1]; + int propvalue; + + lineno++; + if (fscanf (stream, "%200[^\n]\n", buf) < 1) + break; + + if (buf[0] == '\0' || buf[0] == '#') + continue; + + if (sscanf (buf, "%X..%X%[ ;]%[^ ]", &i1, &i2, padding, propname) != 4) + { + if (sscanf (buf, "%X%[ ;]%[^ ]", &i1, padding, propname) != 3) + { + fprintf (stderr, "parse error in '%s'\n", + graphemebreakproperty_filename); + exit (1); + } + i2 = i1; + } +#define PROP(name,value) \ + if (strcmp (propname, name) == 0) propvalue = value; else + PROP ("CR", GBP_CR) + PROP ("LF", GBP_LF) + PROP ("Control", GBP_CONTROL) + PROP ("Extend", GBP_EXTEND) + PROP ("Prepend", GBP_PREPEND) + PROP ("SpacingMark", GBP_SPACINGMARK) + PROP ("L", GBP_L) + PROP ("V", GBP_V) + PROP ("T", GBP_T) + PROP ("LV", GBP_LV) + PROP ("LVT", GBP_LVT) +#undef PROP + { + fprintf (stderr, "unknown property value '%s' in %s:%d\n", propname, + graphemebreakproperty_filename, lineno); + exit (1); + } + if (!(i1 <= i2 && i2 < 0x110000)) + abort (); + + for (i = i1; i <= i2; i++) + unicode_org_gbp[i] = propvalue; + } + if (ferror (stream) || fclose (stream)) + { + fprintf (stderr, "error reading from '%s'\n", graphemebreakproperty_filename); + exit (1); + } +} + +/* ========================================================================= */ + /* Maximum number of characters into which a single Unicode character can be decomposed. */ #define MAX_DECOMP_LENGTH 18 @@ -8279,14 +8510,15 @@ const char *eastasianwidth_filename; const char *linebreak_filename; const char *wordbreakproperty_filename; + const char *graphemebreakproperty_filename; const char *compositionexclusions_filename; const char *specialcasing_filename; const char *casefolding_filename; const char *version; - if (argc != 14) - { - fprintf (stderr, "Usage: %s UnicodeData.txt PropList.txt DerivedCoreProperties.txt Scripts.txt Blocks.txt PropList-3.0.1.txt EastAsianWidth.txt LineBreak.txt WordBreakProperty.txt CompositionExclusions.txt SpecialCasing.txt CaseFolding.txt version\n", + if (argc != 15) + { + fprintf (stderr, "Usage: %s UnicodeData.txt PropList.txt DerivedCoreProperties.txt Scripts.txt Blocks.txt PropList-3.0.1.txt EastAsianWidth.txt LineBreak.txt WordBreakProperty.txt GraphemeBreakProperty.txt CompositionExclusions.txt SpecialCasing.txt CaseFolding.txt version\n", argv[0]); exit (1); } @@ -8300,10 +8532,11 @@ eastasianwidth_filename = argv[7]; linebreak_filename = argv[8]; wordbreakproperty_filename = argv[9]; - compositionexclusions_filename = argv[10]; - specialcasing_filename = argv[11]; - casefolding_filename = argv[12]; - version = argv[13]; + graphemebreakproperty_filename = argv[10]; + compositionexclusions_filename = argv[11]; + specialcasing_filename = argv[12]; + casefolding_filename = argv[13]; + version = argv[14]; fill_attributes (unicodedata_filename); clear_properties (); @@ -8315,6 +8548,7 @@ fill_width (eastasianwidth_filename); fill_org_lbp (linebreak_filename); fill_org_wbp (wordbreakproperty_filename); + fill_org_gbp (graphemebreakproperty_filename); fill_composition_exclusions (compositionexclusions_filename); fill_casing_rules (specialcasing_filename); fill_casefolding_rules (casefolding_filename); @@ -8347,6 +8581,8 @@ debug_output_org_wbrk_tables ("uniwbrk/wbrkprop_org.txt"); output_wbrk_tables ("uniwbrk/wbrkprop.h", version); + output_gbp_table ("unigbrk/gbrkprop.h", version); + output_decomposition_tables ("uninorm/decomposition-table1.h", "uninorm/decomposition-table2.h", version); debug_output_composition_tables ("uninorm/composition.txt"); output_composition_tables ("uninorm/composition-table.gperf", version); @@ -8379,6 +8615,7 @@ /gfs/petix/Volumes/ExtData/www-archive/software/i18n/unicode/ftp.unicode.org/ArchiveVersions/5.1.0/ucd/EastAsianWidth.txt \ /gfs/petix/Volumes/ExtData/www-archive/software/i18n/unicode/ftp.unicode.org/ArchiveVersions/5.1.0/ucd/LineBreak.txt \ /gfs/petix/Volumes/ExtData/www-archive/software/i18n/unicode/ftp.unicode.org/ArchiveVersions/5.1.0/ucd/auxiliary/WordBreakProperty.txt \ + /gfs/petix/Volumes/ExtData/www-archive/software/i18n/unicode/ftp.unicode.org/ArchiveVersions/5.1.0/ucd/auxiliary/GraphemeBreakProperty.txt \ /gfs/petix/Volumes/ExtData/www-archive/software/i18n/unicode/ftp.unicode.org/ArchiveVersions/5.1.0/ucd/CompositionExclusions.txt \ /gfs/petix/Volumes/ExtData/www-archive/software/i18n/unicode/ftp.unicode.org/ArchiveVersions/5.1.0/ucd/SpecialCasing.txt \ /gfs/petix/Volumes/ExtData/www-archive/software/i18n/unicode/ftp.unicode.org/ArchiveVersions/5.1.0/ucd/CaseFolding.txt \ diff --git a/lib/getlogin_r.c b/lib/getlogin_r.c --- a/lib/getlogin_r.c +++ b/lib/getlogin_r.c @@ -1,6 +1,6 @@ /* Provide a working getlogin_r for systems which lack it. - Copyright (C) 2005-2007, 2009-2010 Free Software Foundation, Inc. + Copyright (C) 2005-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 @@ -39,6 +39,7 @@ int getlogin_r (char *name, size_t size) { +#undef getlogin_r #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ /* Native Windows platform. */ DWORD sz; @@ -59,6 +60,14 @@ return ENOENT; } return 0; +#elif HAVE_GETLOGIN_R + /* Platform with a getlogin_r() function. */ + int ret = getlogin_r (name, size); + + if (ret == 0 && memchr (name, '\0', size) == NULL) + /* name contains a truncated result. */ + return ERANGE; + return ret; #else /* Platform with a getlogin() function. */ char *n; diff --git a/lib/iswblank.c b/lib/iswblank.c new file mode 100644 --- /dev/null +++ b/lib/iswblank.c @@ -0,0 +1,27 @@ +/* Test wide character for being blank. + Copyright (C) 2008-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 2, 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 + +/* Specification. */ +#include + +int +iswblank (wint_t wc) +{ + return wc == ' ' || wc == '\t'; +} diff --git a/lib/linkat.c b/lib/linkat.c --- a/lib/linkat.c +++ b/lib/linkat.c @@ -166,6 +166,36 @@ } # endif /* 0 < LINK_FOLLOWS_SYMLINKS */ +/* On Solaris, link() doesn't follow symlinks by default, but does so as soon + as a library or executable takes part in the program that has been compiled + with "c99" or "cc -xc99=all" or "cc ... /usr/lib/values-xpg4.o ...". */ +# if LINK_FOLLOWS_SYMLINKS == -1 + +/* Reduce the penalty of link_immediate and link_follow by incorporating the + knowledge that link()'s behaviour depends on the __xpg4 variable. */ +extern int __xpg4; + +static int +solaris_optimized_link_immediate (char const *file1, char const *file2) +{ + if (__xpg4 == 0) + return link (file1, file2); + return link_immediate (file1, file2); +} + +static int +solaris_optimized_link_follow (char const *file1, char const *file2) +{ + if (__xpg4 != 0) + return link (file1, file2); + return link_follow (file1, file2); +} + +# define link_immediate solaris_optimized_link_immediate +# define link_follow solaris_optimized_link_follow + +# endif + /* Create a link to FILE1, in the directory open on descriptor FD1, to FILE2, in the directory open on descriptor FD2. If FILE1 is a symlink, FLAG controls whether to dereference FILE1 first. If possible, do it without diff --git a/lib/math.in.h b/lib/math.in.h --- a/lib/math.in.h +++ b/lib/math.in.h @@ -202,6 +202,19 @@ # endif #endif +#if @GNULIB_CEIL@ +# if @REPLACE_CEIL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define ceil rpl_ceil +# endif +_GL_FUNCDECL_RPL (ceil, double, (double x)); +_GL_CXXALIAS_RPL (ceil, double, (double x)); +# else +_GL_CXXALIAS_SYS (ceil, double, (double x)); +# endif +_GL_CXXALIASWARN (ceil); +#endif + #if @GNULIB_CEILL@ # if @REPLACE_CEILL@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -262,7 +275,7 @@ # endif _GL_FUNCDECL_RPL (floorf, float, (float x)); _GL_CXXALIAS_RPL (floorf, float, (float x)); -#else +# else # if !@HAVE_DECL_FLOORF@ _GL_FUNCDECL_SYS (floorf, float, (float x)); # endif @@ -277,6 +290,19 @@ # endif #endif +#if @GNULIB_FLOOR@ +# if @REPLACE_FLOOR@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define floor rpl_floor +# endif +_GL_FUNCDECL_RPL (floor, double, (double x)); +_GL_CXXALIAS_RPL (floor, double, (double x)); +# else +_GL_CXXALIAS_SYS (floor, double, (double x)); +# endif +_GL_CXXALIASWARN (floor); +#endif + #if @GNULIB_FLOORL@ # if @REPLACE_FLOORL@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -493,10 +519,18 @@ #if @GNULIB_TRUNCF@ -# if !@HAVE_DECL_TRUNCF@ +# if @REPLACE_TRUNCF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define truncf rpl_truncf +# endif +_GL_FUNCDECL_RPL (truncf, float, (float x)); +_GL_CXXALIAS_RPL (truncf, float, (float x)); +# else +# if !@HAVE_DECL_TRUNCF@ _GL_FUNCDECL_SYS (truncf, float, (float x)); +# endif +_GL_CXXALIAS_SYS (truncf, float, (float x)); # endif -_GL_CXXALIAS_SYS (truncf, float, (float x)); _GL_CXXALIASWARN (truncf); #elif defined GNULIB_POSIXCHECK # undef truncf @@ -507,10 +541,18 @@ #endif #if @GNULIB_TRUNC@ -# if !@HAVE_DECL_TRUNC@ +# if @REPLACE_TRUNC@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define trunc rpl_trunc +# endif +_GL_FUNCDECL_RPL (trunc, double, (double x)); +_GL_CXXALIAS_RPL (trunc, double, (double x)); +# else +# if !@HAVE_DECL_TRUNC@ _GL_FUNCDECL_SYS (trunc, double, (double x)); +# endif +_GL_CXXALIAS_SYS (trunc, double, (double x)); # endif -_GL_CXXALIAS_SYS (trunc, double, (double x)); _GL_CXXALIASWARN (trunc); #elif defined GNULIB_POSIXCHECK # undef trunc @@ -680,6 +722,10 @@ sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \ gl_isnan_f (x)) # endif +/* Ensure isnan is a macro. */ +# ifndef isnan +# define isnan isnan +# endif #elif defined GNULIB_POSIXCHECK # if defined isnan _GL_WARN_REAL_FLOATING_DECL (isnan); diff --git a/lib/mbrtowc.c b/lib/mbrtowc.c --- a/lib/mbrtowc.c +++ b/lib/mbrtowc.c @@ -321,7 +321,7 @@ size_t rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) { -# if MBRTOWC_NULL_ARG_BUG || MBRTOWC_RETVAL_BUG +# if MBRTOWC_NULL_ARG2_BUG || MBRTOWC_RETVAL_BUG if (s == NULL) { pwc = NULL; @@ -379,7 +379,16 @@ return ret; } # else - return mbrtowc (pwc, s, n, ps); + { +# if MBRTOWC_NULL_ARG1_BUG + wchar_t dummy; + + if (pwc == NULL) + pwc = &dummy; +# endif + + return mbrtowc (pwc, s, n, ps); + } # endif } diff --git a/lib/mountlist.c b/lib/mountlist.c --- a/lib/mountlist.c +++ b/lib/mountlist.c @@ -156,6 +156,31 @@ || strcmp (Fs_type, "ignore") == 0) #endif +#ifdef __CYGWIN__ +# include +# define ME_REMOTE me_remote +/* All cygwin mount points include `:' or start with `//'; so it + requires a native Windows call to determine remote disks. */ +static bool +me_remote (char const *fs_name, char const *fs_type _GL_UNUSED) +{ + if (fs_name[0] && fs_name[1] == ':') + { + char drive[4]; + sprintf (drive, "%c:\\", fs_name[0]); + switch (GetDriveType (drive)) + { + case DRIVE_REMOVABLE: + case DRIVE_FIXED: + case DRIVE_CDROM: + case DRIVE_RAMDISK: + return false; + } + } + return true; +} +#endif + #ifndef ME_REMOTE /* A file system is `remote' if its Fs_name contains a `:' or if (it is of type (smbfs or cifs) and its Fs_name starts with `//'). */ diff --git a/lib/pipe.h b/lib/pipe.h new file mode 100644 --- /dev/null +++ b/lib/pipe.h @@ -0,0 +1,2 @@ +/* Obsolete; consider using spawn-pipe.h instead. */ +#include "spawn-pipe.h" diff --git a/lib/ptsname.c b/lib/ptsname.c --- a/lib/ptsname.c +++ b/lib/ptsname.c @@ -43,7 +43,7 @@ /* Static buffer for `ptsname'. */ -static char buffer[sizeof (_PATH_TTY) + 2]; +static char buffer[64]; /* Return the pathname of the pseudo terminal slave associated with diff --git a/lib/read-file.c b/lib/read-file.c --- a/lib/read-file.c +++ b/lib/read-file.c @@ -41,7 +41,7 @@ *LENGTH. On errors, *LENGTH is undefined, errno preserves the 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 = BUFSIZ; @@ -136,7 +136,7 @@ } 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; @@ -170,7 +170,7 @@ 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"); } @@ -183,7 +183,7 @@ 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/regexec.c b/lib/regexec.c --- a/lib/regexec.c +++ b/lib/regexec.c @@ -3402,6 +3402,8 @@ { state->trtable = (re_dfastate_t **) calloc (sizeof (re_dfastate_t *), SBC_MAX); + if (BE (state->trtable == NULL, 0)) + return false; return true; } return false; diff --git a/lib/round.c b/lib/round.c --- a/lib/round.c +++ b/lib/round.c @@ -1,5 +1,5 @@ /* Round toward nearest, breaking ties away from zero. - Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. + 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 @@ -20,8 +20,12 @@ #include +/* Specification. */ +#include + #include -#include + +#undef MIN #ifdef USE_LONG_DOUBLE # define ROUND roundl @@ -29,6 +33,7 @@ # define CEIL ceill # define DOUBLE long double # define MANT_DIG LDBL_MANT_DIG +# define MIN LDBL_MIN # define L_(literal) literal##L # define HAVE_FLOOR_AND_CEIL HAVE_FLOORL_AND_CEILL #elif ! defined USE_FLOAT @@ -37,6 +42,7 @@ # define CEIL ceil # define DOUBLE double # define MANT_DIG DBL_MANT_DIG +# define MIN DBL_MIN # define L_(literal) literal # define HAVE_FLOOR_AND_CEIL 1 #else /* defined USE_FLOAT */ @@ -45,10 +51,18 @@ # define CEIL ceilf # define DOUBLE float # define MANT_DIG FLT_MANT_DIG +# define MIN FLT_MIN # define L_(literal) literal##f # define HAVE_FLOOR_AND_CEIL HAVE_FLOORF_AND_CEILF #endif +/* -0.0. See minus-zero.h. */ +#if defined __hpux || defined __sgi || defined __ICC +# define MINUS_ZERO (-MIN * MIN) +#else +# define MINUS_ZERO L_(-0.0) +#endif + /* If we're being included from test-round2[f].c, it already defined names for our round implementations. Otherwise, pick the preferred implementation for this machine. */ @@ -133,7 +147,7 @@ { /* Avoid rounding error for x = -(0.5 - 2^(-MANT_DIG-1)). */ if (z > - L_(0.5)) - z = L_(0.0); + z = MINUS_ZERO; /* Avoid rounding errors for values near -2^k, where k >= MANT_DIG-1. */ else if (z > -TWO_MANT_DIG) { diff --git a/lib/signal.in.h b/lib/signal.in.h --- a/lib/signal.in.h +++ b/lib/signal.in.h @@ -72,6 +72,14 @@ #endif +/* Maximum signal number + 1. */ +#ifndef NSIG +# if defined __TANDEM +# define NSIG 32 +# endif +#endif + + #if @GNULIB_SIGPROCMASK@ # if !@HAVE_POSIX_SIGNALBLOCKING@ diff --git a/lib/stdint.in.h b/lib/stdint.in.h --- a/lib/stdint.in.h +++ b/lib/stdint.in.h @@ -137,9 +137,10 @@ /* 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 +163,7 @@ # endif #endif -#if UINT64_MAX +#ifdef UINT64_MAX # define GL_UINT64_T #else # if ULONG_MAX >> 31 >> 31 >> 1 == 1 diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h --- a/lib/stdio-impl.h +++ b/lib/stdio-impl.h @@ -75,6 +75,17 @@ /* SystemV derived implementations. */ +#ifdef __TANDEM /* NonStop Kernel */ +# ifndef _IOERR +/* These values were determined by the program 'stdioext-flags' at + . */ +# 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/stdio.in.h b/lib/stdio.in.h --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -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 + -> -> -> -> + -> -> -> . + 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 @@ -345,7 +355,7 @@ _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 @@ -421,7 +431,7 @@ _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)); @@ -666,6 +676,9 @@ _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))) diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -584,7 +584,7 @@ _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 +592,9 @@ _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 +704,14 @@ _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/strsignal.c b/lib/strsignal.c --- a/lib/strsignal.c +++ b/lib/strsignal.c @@ -108,7 +108,7 @@ #ifdef SIGRTMIN if (signum >= SIGRTMIN && signum <= SIGRTMAX) len = __snprintf (buffer, BUFFERSIZ - 1, _("Real-time signal %d"), - signum - SIGRTMIN); + signum - (int) SIGRTMIN); else #endif len = __snprintf (buffer, BUFFERSIZ - 1, _("Unknown signal %d"), diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h --- a/lib/sys_select.in.h +++ b/lib/sys_select.in.h @@ -44,6 +44,8 @@ /* On OSF/1 4.0, 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 . But avoid namespace pollution on glibc systems. */ # ifndef __GLIBC__ # include @@ -65,8 +67,14 @@ #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 . */ +/* Get the 'struct timeval' and 'fd_set' types and the FD_* macros + on most platforms. */ +# include +/* On native Windows platforms: + Get the 'fd_set' type. Also, gnulib's redefines select + so as to hide the declaration from . */ # include #endif diff --git a/lib/sys_socket.in.h b/lib/sys_socket.in.h --- a/lib/sys_socket.in.h +++ b/lib/sys_socket.in.h @@ -245,8 +245,11 @@ _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 +303,11 @@ _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 +528,11 @@ (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 +558,11 @@ _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/sys_stat.in.h b/lib/sys_stat.in.h --- a/lib/sys_stat.in.h +++ b/lib/sys_stat.in.h @@ -550,7 +550,8 @@ _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/termios.in.h b/lib/termios.in.h --- a/lib/termios.in.h +++ b/lib/termios.in.h @@ -47,7 +47,7 @@ The argument is a descriptor if this controlling terminal. Return -1, with errno set, upon failure. errno = ENOSYS means that the function is unsupported. */ -# if !@HAVE_TCGETSID@ +# if !@HAVE_DECL_TCGETSID@ _GL_FUNCDECL_SYS (tcgetsid, pid_t, (int fd)); # endif _GL_CXXALIAS_SYS (tcgetsid, pid_t, (int fd)); diff --git a/lib/trunc.c b/lib/trunc.c --- a/lib/trunc.c +++ b/lib/trunc.c @@ -1,5 +1,5 @@ /* Round towards zero. - Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. + 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 @@ -23,23 +23,35 @@ #include +#undef MIN + #ifdef USE_LONG_DOUBLE # define FUNC truncl # define DOUBLE long double # define MANT_DIG LDBL_MANT_DIG +# define MIN LDBL_MIN # define L_(literal) literal##L #elif ! defined USE_FLOAT # define FUNC trunc # define DOUBLE double # define MANT_DIG DBL_MANT_DIG +# define MIN DBL_MIN # define L_(literal) literal #else /* defined USE_FLOAT */ # define FUNC truncf # define DOUBLE float # define MANT_DIG FLT_MANT_DIG +# define MIN FLT_MIN # define L_(literal) literal##f #endif +/* -0.0. See minus-zero.h. */ +#if defined __hpux || defined __sgi || defined __ICC +# define MINUS_ZERO (-MIN * MIN) +#else +# define MINUS_ZERO L_(-0.0) +#endif + /* 2^(MANT_DIG-1). */ static const DOUBLE TWO_MANT_DIG = /* Assume MANT_DIG <= 5 * 31. @@ -65,8 +77,12 @@ if (z > L_(0.0)) { + /* For 0 < x < 1, return +0.0 even if the current rounding mode is + FE_DOWNWARD. */ + if (z < L_(1.0)) + z = L_(0.0); /* Avoid rounding errors for values near 2^k, where k >= MANT_DIG-1. */ - if (z < TWO_MANT_DIG) + else if (z < TWO_MANT_DIG) { /* Round to the next integer (nearest or up or down, doesn't matter). */ z += TWO_MANT_DIG; @@ -78,8 +94,12 @@ } else if (z < L_(0.0)) { + /* For -1 < x < 0, return -0.0 regardless of the current rounding + mode. */ + if (z > L_(-1.0)) + z = MINUS_ZERO; /* Avoid rounding errors for values near -2^k, where k >= MANT_DIG-1. */ - if (z > - TWO_MANT_DIG) + else if (z > - TWO_MANT_DIG) { /* Round to the next integer (nearest or up or down, doesn't matter). */ z -= TWO_MANT_DIG; diff --git a/lib/ttyname_r.c b/lib/ttyname_r.c --- a/lib/ttyname_r.c +++ b/lib/ttyname_r.c @@ -32,8 +32,9 @@ /* When ttyname_r exists, use it. */ #if HAVE_TTYNAME_R /* This code is multithread-safe. */ - /* On Solaris, ttyname_r always fails if buflen < 128. So provide a buffer - that is large enough. */ + /* On Solaris, ttyname_r always fails if buflen < 128. On OSF/1 5.1, + ttyname_r ignores the buffer size and assumes the buffer is large enough. + So provide a buffer that is large enough. */ char largerbuf[512]; # if HAVE_POSIXDECL_TTYNAME_R int err = diff --git a/lib/unigbrk.in.h b/lib/unigbrk.in.h new file mode 100644 --- /dev/null +++ b/lib/unigbrk.in.h @@ -0,0 +1,85 @@ +/* Grapheme cluster breaks in Unicode strings. + Copyright (C) 2010 Free Software Foundation, Inc. + Written by Ben Pfaff , 2010. + + 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 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 + 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, see . */ + +#ifndef _UNIGBRK_H +#define _UNIGBRK_H + +/* Get bool. */ +#include + +#include "unitypes.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* ========================================================================= */ + +/* Property defined in Unicode Standard Annex #29, section "Grapheme Cluster + Boundaries" + */ + +/* Possible values of the Grapheme_Cluster_Break property. + This enumeration may be extended in the future. */ +enum +{ + GBP_OTHER = 0, + GBP_CR = 1, + GBP_LF = 2, + GBP_CONTROL = 3, + GBP_EXTEND = 4, + GBP_PREPEND = 5, + GBP_SPACINGMARK = 6, + GBP_L = 7, + GBP_V = 8, + GBP_T = 9, + GBP_LV = 10, + GBP_LVT = 11 +}; + +/* Return the Grapheme_Cluster_Break property of a Unicode character. */ +extern int + uc_graphemeclusterbreak_property (ucs4_t uc); + +/* ========================================================================= */ + +/* Grapheme cluster breaks. */ + +/* Returns true if there is an grapheme cluster boundary between Unicode code + points A and B. A "grapheme cluster" is an approximation to a + user-perceived character, which sometimes corresponds to multiple code + points. For example, an English letter followed by an acute accent can be + expressed as two consecutive Unicode code points, but it is perceived by the + user as only a single character and therefore constitutes a single grapheme + cluster. + + Implements extended (not legacy) grapheme cluster rules, because UAX #29 + indicates that they are preferred. + + Use A == 0 or B == 0 to indicate start of text or end of text, + respectively. */ +extern bool + uc_is_grapheme_cluster_break (ucs4_t a, ucs4_t b); + +/* ========================================================================= */ + +#ifdef __cplusplus +} +#endif + + +#endif /* _UNIGBRK_H */ diff --git a/lib/unigbrk/gbrkprop.h b/lib/unigbrk/gbrkprop.h new file mode 100644 --- /dev/null +++ b/lib/unigbrk/gbrkprop.h @@ -0,0 +1,762 @@ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +/* Grapheme break property of Unicode characters. */ +/* Generated automatically by gen-uni-tables.c for Unicode 5.1.0. */ +#define gbrkprop_header_0 16 +#define gbrkprop_header_1 15 +#define gbrkprop_header_2 7 +#define gbrkprop_header_3 511 +#define gbrkprop_header_4 127 +static const +struct + { + int level1[15]; + short level2[3 << 9]; + unsigned char level3[(68 << 7) / 2]; + } +unigbrkprop = +{ + { + 0, 512, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 1024 + }, + { + 0, 128, -1, -1, -1, -1, 256, -1, + -1, 384, -1, 512, 640, 768, 896, 1024, + -1, -1, 1152, 1280, 1408, 1536, 1664, 1792, + 1920, 2048, 2176, 2304, 2432, 2560, 2688, 2816, + 2944, 3072, 3200, 3328, -1, -1, 3456, -1, + -1, -1, -1, -1, -1, -1, 3584, 3712, + 3840, 3968, 4096, 4224, 4352, -1, 4480, 4608, + 4736, -1, -1, 4864, -1, -1, -1, -1, + 4992, 5120, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 5248, -1, -1, -1, -1, + 5376, 5504, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 5632, -1, -1, -1, + 5760, 5888, 6016, -1, 6144, -1, -1, -1, + 6272, 6400, 6528, 6656, 6784, 6912, 7040, 6272, + 6400, 6528, 6656, 6784, 6912, 7040, 6272, 6400, + 6528, 6656, 6784, 6912, 7040, 6272, 6400, 6528, + 6656, 6784, 6912, 7040, 6272, 6400, 6528, 6656, + 6784, 6912, 7040, 6272, 6400, 6528, 6656, 6784, + 6912, 7040, 6272, 6400, 6528, 6656, 6784, 6912, + 7040, 6272, 6400, 6528, 6656, 6784, 6912, 7040, + 6272, 6400, 6528, 6656, 6784, 6912, 7040, 6272, + 6400, 6528, 6656, 6784, 6912, 7040, 6272, 6400, + 6528, 6656, 6784, 6912, 7040, 6272, 6400, 6528, + 6656, 6784, 6912, 7040, 6272, 6400, 6528, 7168, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 7296, -1, + -1, -1, -1, -1, 7424, 7552, -1, 7680, + -1, -1, -1, 7808, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 7936, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 8064, 8192, 8320, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + 8448, -1, 8576, 256, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1 + }, + { + 0x33, 0x33, 0x33, 0x33, 0x33, 0x32, 0x13, 0x33, + 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, + 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x40, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, + 0x40, 0x04, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x33, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x34, 0x44, + 0x44, 0x44, 0x04, 0x40, 0x04, 0x44, 0x44, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x44, 0x44, + 0x44, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x40, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x66, + 0x46, 0x44, 0x44, 0x44, 0x64, 0x66, 0x46, 0x00, + 0x40, 0x44, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x40, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x64, + 0x46, 0x44, 0x04, 0x60, 0x06, 0x60, 0x46, 0x00, + 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x40, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x66, + 0x46, 0x04, 0x00, 0x40, 0x04, 0x40, 0x44, 0x00, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x40, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x66, + 0x46, 0x44, 0x44, 0x40, 0x64, 0x60, 0x46, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x40, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x44, + 0x46, 0x44, 0x04, 0x60, 0x06, 0x60, 0x46, 0x00, + 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x64, 0x06, 0x00, 0x66, 0x06, 0x66, 0x46, 0x00, + 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x60, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, + 0x64, 0x66, 0x06, 0x44, 0x04, 0x44, 0x44, 0x00, + 0x00, 0x00, 0x40, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x46, + 0x66, 0x64, 0x06, 0x64, 0x06, 0x66, 0x44, 0x00, + 0x00, 0x00, 0x40, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, + 0x46, 0x44, 0x04, 0x66, 0x06, 0x66, 0x46, 0x00, + 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x40, + 0x66, 0x44, 0x04, 0x04, 0x66, 0x66, 0x66, 0x46, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x04, 0x00, 0x00, + 0x55, 0x55, 0x45, 0x40, 0x44, 0x44, 0x44, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x04, 0x00, + 0x55, 0x55, 0x05, 0x00, 0x44, 0x44, 0x44, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x40, 0x40, 0x40, 0x00, 0x00, 0x66, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x40, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x64, + 0x44, 0x44, 0x04, 0x44, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x44, 0x44, 0x44, 0x40, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x46, 0x44, + 0x64, 0x44, 0x44, 0x44, 0x46, 0x64, 0x46, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x66, 0x44, 0x00, 0x00, 0x44, + 0x04, 0x66, 0x06, 0x60, 0x66, 0x66, 0x66, 0x00, + 0x40, 0x44, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x64, 0x46, 0x64, 0x66, 0x66, 0x46, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x00, 0x00, 0x70, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x08, 0x00, 0x00, 0x99, 0x99, 0x99, 0x99, + 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, + 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, + 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, + 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, + 0x99, 0x99, 0x99, 0x99, 0x99, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x44, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x44, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x33, 0x46, 0x44, 0x44, 0x44, 0x66, + 0x66, 0x66, 0x66, 0x64, 0x46, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x44, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x64, 0x66, 0x46, 0x64, 0x66, 0x00, 0x00, + 0x66, 0x64, 0x66, 0x66, 0x46, 0x44, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x06, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x40, 0x64, 0x66, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x44, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x64, 0x44, 0x44, 0x64, 0x64, 0x66, + 0x66, 0x64, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x44, 0x44, + 0x44, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x60, 0x44, 0x44, 0x66, 0x44, 0x06, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x44, 0x44, + 0x44, 0x44, 0x66, 0x44, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x44, 0x33, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x33, 0x33, 0x33, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x33, 0x33, 0x03, 0x00, 0x00, 0x33, 0x33, 0x33, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x40, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, + 0x44, 0x04, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00, + 0x00, 0x04, 0x00, 0x04, 0x00, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x60, 0x46, 0x64, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x40, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x40, 0x44, 0x44, 0x64, + 0x46, 0x64, 0x46, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xba, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xba, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xba, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xba, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xba, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xba, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xba, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xba, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xba, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xba, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xba, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xba, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xba, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xba, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xba, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xba, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xba, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xba, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xba, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xba, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xba, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xba, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xba, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xba, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xba, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xba, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xba, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xba, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xba, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xba, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xba, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xba, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xba, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xbb, 0xbb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x44, 0x44, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x30, 0x33, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, + 0x40, 0x44, 0x40, 0x04, 0x00, 0x00, 0x44, 0x44, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x44, 0x04, 0x00, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x40, 0x46, 0x44, 0x00, 0x60, 0x44, + 0x44, 0x34, 0x33, 0x33, 0x33, 0x43, 0x44, 0x44, + 0x44, 0x04, 0x40, 0x44, 0x44, 0x44, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x44, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 + } +}; diff --git a/lib/unigbrk/uc-gbrk-prop.c b/lib/unigbrk/uc-gbrk-prop.c new file mode 100644 --- /dev/null +++ b/lib/unigbrk/uc-gbrk-prop.c @@ -0,0 +1,45 @@ +/* Grapheme cluster break property function. + Copyright (C) 2010 Free Software Foundation, Inc. + Written by Ben Pfaff , 2010. + + 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 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 + 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, see . */ + +#include + +/* Specification. */ +#include "unigbrk.h" + +#include "gbrkprop.h" + +int +uc_graphemeclusterbreak_property (ucs4_t uc) +{ + unsigned int index1 = uc >> gbrkprop_header_0; + if (index1 < gbrkprop_header_1) + { + int lookup1 = unigbrkprop.level1[index1]; + if (lookup1 >= 0) + { + unsigned int index2 = (uc >> gbrkprop_header_2) & gbrkprop_header_3; + int lookup2 = unigbrkprop.level2[lookup1 + index2] / 2; + if (lookup2 >= 0) + { + unsigned int index3 = uc & gbrkprop_header_4; + unsigned char lookup3 = unigbrkprop.level3[lookup2 + index3 / 2]; + return (lookup3 >> ((uc & 1) << 2)) & 0x0f; + } + } + } + return GBP_OTHER; +} diff --git a/lib/unigbrk/uc-is-grapheme-break.c b/lib/unigbrk/uc-is-grapheme-break.c new file mode 100644 --- /dev/null +++ b/lib/unigbrk/uc-is-grapheme-break.c @@ -0,0 +1,106 @@ +/* Grapheme cluster break function. + Copyright (C) 2010 Free Software Foundation, Inc. + Written by Ben Pfaff , 2010. + + 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 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 + 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, see . */ + +#include + +/* Specification. */ +#include "unigbrk.h" + +/* Evaluates to true if there is an extended grapheme cluster break between + code points with GBP_* values A and B, false if there is not. The comments + are the grapheme cluster boundary rules from in UAX #29. */ +#define UC_IS_GRAPHEME_BREAK(A, B) \ + (/* GB1 and GB2 are covered--just use a GBP_CONTROL character, such \ + as 0, for sot and eot. */ \ + \ + /* GB3 */ \ + (A) == GBP_CR && (B) == GBP_LF ? false : \ + \ + /* GB4 */ \ + (A) == GBP_CONTROL || (A) == GBP_CR || (A) == GBP_LF ? true : \ + \ + /* GB5 */ \ + (B) == GBP_CONTROL || (B) == GBP_CR || (B) == GBP_LF ? true : \ + \ + /* GB6 */ \ + (A) == GBP_L && ((B) == GBP_L || (B) == GBP_V \ + || (B) == GBP_LV || (B) == GBP_LVT) ? false : \ + \ + /* GB7 */ \ + ((A) == GBP_LV || (A) == GBP_V) \ + && ((B) == GBP_V || (B) == GBP_T) ? false : \ + \ + /* GB8 */ \ + ((A) == GBP_LVT || (A) == GBP_T) && (B) == GBP_T ? false : \ + \ + /* GB9 */ \ + (B) == GBP_EXTEND ? false : \ + \ + /* GB9a */ \ + (B) == GBP_SPACINGMARK ? false : \ + \ + /* GB9b */ \ + (A) == GBP_PREPEND ? false \ + \ + /* GB10 */ \ + : true) + +#define UC_GRAPHEME_BREAKS_FOR(A) \ + ( (UC_IS_GRAPHEME_BREAK(A, GBP_OTHER) << GBP_OTHER) \ + | (UC_IS_GRAPHEME_BREAK(A, GBP_CR) << GBP_CR) \ + | (UC_IS_GRAPHEME_BREAK(A, GBP_LF) << GBP_LF) \ + | (UC_IS_GRAPHEME_BREAK(A, GBP_CONTROL) << GBP_CONTROL) \ + | (UC_IS_GRAPHEME_BREAK(A, GBP_EXTEND) << GBP_EXTEND) \ + | (UC_IS_GRAPHEME_BREAK(A, GBP_PREPEND) << GBP_PREPEND) \ + | (UC_IS_GRAPHEME_BREAK(A, GBP_SPACINGMARK) << GBP_SPACINGMARK) \ + | (UC_IS_GRAPHEME_BREAK(A, GBP_L) << GBP_L) \ + | (UC_IS_GRAPHEME_BREAK(A, GBP_V) << GBP_V) \ + | (UC_IS_GRAPHEME_BREAK(A, GBP_T) << GBP_T) \ + | (UC_IS_GRAPHEME_BREAK(A, GBP_LV) << GBP_LV) \ + | (UC_IS_GRAPHEME_BREAK(A, GBP_LVT) << GBP_LVT)) + +static const unsigned short int gb_table[12] = + { + UC_GRAPHEME_BREAKS_FOR(0), /* GBP_OTHER */ + UC_GRAPHEME_BREAKS_FOR(1), /* GBP_CR */ + UC_GRAPHEME_BREAKS_FOR(2), /* GBP_LF */ + UC_GRAPHEME_BREAKS_FOR(3), /* GBP_CONTROL */ + UC_GRAPHEME_BREAKS_FOR(4), /* GBP_EXTEND */ + UC_GRAPHEME_BREAKS_FOR(5), /* GBP_PREPEND */ + UC_GRAPHEME_BREAKS_FOR(6), /* GBP_SPACINGMARK */ + UC_GRAPHEME_BREAKS_FOR(7), /* GBP_L */ + UC_GRAPHEME_BREAKS_FOR(8), /* GBP_V */ + UC_GRAPHEME_BREAKS_FOR(9), /* GBP_T */ + UC_GRAPHEME_BREAKS_FOR(10), /* GBP_LV */ + UC_GRAPHEME_BREAKS_FOR(11), /* GBP_LVT */ + }; + +bool +uc_is_grapheme_cluster_break (ucs4_t a, ucs4_t b) +{ + int a_gcp, b_gcp; + + if ((a | b) < 0x300) + { + /* GB3 is the only relevant rule for this case. */ + return a != '\r' || b != '\n'; + } + + a_gcp = uc_graphemeclusterbreak_property (a); + b_gcp = uc_graphemeclusterbreak_property (b); + return (gb_table[a_gcp] >> b_gcp) & 1; +} diff --git a/lib/unistd.in.h b/lib/unistd.in.h --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -88,9 +88,11 @@ # include #endif -/* AIX and OSF/1 5.1 declare getdomainname in , not in . */ +/* AIX and OSF/1 5.1 declare getdomainname in , not in . + NonStop Kernel declares gethostname in , not in . */ /* 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 #endif @@ -435,6 +437,10 @@ _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_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 @@ ${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 @@ -1244,7 +1260,7 @@ _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/utimens.c b/lib/utimens.c --- a/lib/utimens.c +++ b/lib/utimens.c @@ -330,12 +330,53 @@ worth optimizing, and who knows what other messed-up systems are out there? So play it safe and fall back on the code below. */ -# if HAVE_FUTIMESAT && !FUTIMESAT_NULL_BUG - if (futimesat (fd, NULL, t) == 0) - return 0; -# elif HAVE_FUTIMES + +# if (HAVE_FUTIMESAT && !FUTIMESAT_NULL_BUG) || HAVE_FUTIMES +# if HAVE_FUTIMESAT && !FUTIMESAT_NULL_BUG +# undef futimes +# define futimes(fd, t) futimesat (fd, NULL, t) +# endif if (futimes (fd, t) == 0) - return 0; + { +# if __linux__ && __GLIBC__ + /* Work around a longstanding glibc bug, still present as + of 2010-12-27. On older Linux kernels that lack both + utimensat and utimes, glibc's futimes rounds instead of + truncating when falling back on utime. The same bug + occurs in futimesat with a null 2nd arg. */ + if (t) + { + bool abig = 500000 <= t[0].tv_usec; + bool mbig = 500000 <= t[1].tv_usec; + if ((abig | mbig) && fstat (fd, &st) == 0) + { + /* If these two subtractions overflow, they'll + track the overflows inside the buggy glibc. */ + time_t adiff = st.st_atime - t[0].tv_sec; + time_t mdiff = st.st_mtime - t[1].tv_sec; + + struct timeval *tt = NULL; + struct timeval truncated_timeval[2]; + truncated_timeval[0] = t[0]; + truncated_timeval[1] = t[1]; + if (abig && adiff == 1 && get_stat_atime_ns (&st) == 0) + { + tt = truncated_timeval; + tt[0].tv_usec = 0; + } + if (mbig && mdiff == 1 && get_stat_mtime_ns (&st) == 0) + { + tt = truncated_timeval; + tt[1].tv_usec = 0; + } + if (tt) + futimes (fd, tt); + } + } +# endif + + return 0; + } # endif } #endif /* HAVE_FUTIMESAT || HAVE_WORKING_UTIMES */ diff --git a/lib/wcsrtombs.c b/lib/wcsrtombs.c --- a/lib/wcsrtombs.c +++ b/lib/wcsrtombs.c @@ -1,5 +1,5 @@ /* Convert wide string to string. - Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2008, 2010 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This program is free software: you can redistribute it and/or modify @@ -22,7 +22,7 @@ extern mbstate_t _gl_wcsrtombs_state; -#if HAVE_WCSRTOMBS && !WCSRTOMBS_TERMINATION_BUG +#if HAVE_WCSRTOMBS && !WCSRTOMBS_TERMINATION_BUG && !defined GNULIB_defined_mbstate_t /* Override the system's wcsrtombs() function. */ # undef wcsrtombs diff --git a/lib/wctype.in.h b/lib/wctype.in.h --- a/lib/wctype.in.h +++ b/lib/wctype.in.h @@ -284,18 +284,10 @@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define iswblank rpl_iswblank # endif -# endif - -static inline int -# if @REPLACE_ISWBLANK@ -rpl_iswblank +_GL_FUNCDECL_RPL (iswblank, int, (wint_t wc)); # else -iswblank +_GL_FUNCDECL_SYS (iswblank, int, (wint_t wc)); # endif - (wint_t wc) -{ - return wc == ' ' || wc == '\t'; -} #endif diff --git a/m4/arpa_inet_h.m4 b/m4/arpa_inet_h.m4 --- a/m4/arpa_inet_h.m4 +++ b/m4/arpa_inet_h.m4 @@ -1,4 +1,4 @@ -# arpa_inet_h.m4 serial 10 +# arpa_inet_h.m4 serial 11 dnl Copyright (C) 2006, 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -31,6 +31,9 @@ #if !(defined __GLIBC__ || defined __UCLIBC__) # include #endif +#ifdef __TANDEM +# include +#endif #include ]], [inet_ntop inet_pton]) ]) diff --git a/m4/btowc.m4 b/m4/btowc.m4 --- a/m4/btowc.m4 +++ b/m4/btowc.m4 @@ -1,4 +1,4 @@ -# btowc.m4 serial 7 +# btowc.m4 serial 8 dnl Copyright (C) 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -28,8 +28,14 @@ [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include #include -#include +#include #include int main () { @@ -69,8 +75,14 @@ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include #include -#include +#include #include int main () { diff --git a/m4/ceil-ieee.m4 b/m4/ceil-ieee.m4 new file mode 100644 --- /dev/null +++ b/m4/ceil-ieee.m4 @@ -0,0 +1,15 @@ +# ceil-ieee.m4 serial 1 +dnl Copyright (C) 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 This macro is in a separate file (not in ceil.m4 and not inlined in the +dnl module description), so that gl_FUNC_CEIL can test whether 'aclocal' has +dnl found uses of this macro. + +AC_DEFUN([gl_FUNC_CEIL_IEEE], +[ + m4_divert_text([INIT_PREPARE], [gl_ceil_required=ieee]) + AC_REQUIRE([gl_FUNC_CEIL]) +]) diff --git a/m4/ceil.m4 b/m4/ceil.m4 --- a/m4/ceil.m4 +++ b/m4/ceil.m4 @@ -1,16 +1,56 @@ -# ceil.m4 serial 4 -dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. +# ceil.m4 serial 5 +dnl Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_CEIL], [ + m4_divert_text([DEFAULTS], [gl_ceil_required=plain]) + AC_REQUIRE([gl_MATH_H_DEFAULTS]) dnl Test whether ceil() can be used without libm. gl_FUNC_CEIL_LIBS if test "$CEIL_LIBM" = "?"; then CEIL_LIBM= fi + m4_ifdef([gl_FUNC_CEIL_IEEE], [ + if test $gl_ceil_required = ieee && test $REPLACE_CEIL = 0; then + AC_CACHE_CHECK([whether ceil works according to ISO C 99 with IEC 60559], + [gl_cv_func_ceil_ieee], + [ + save_LIBS="$LIBS" + LIBS="$LIBS $CEIL_LIBM" + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#ifndef __NO_MATH_INLINES +# define __NO_MATH_INLINES 1 /* for glibc */ +#endif +#include +]gl_DOUBLE_MINUS_ZERO_CODE[ +]gl_DOUBLE_SIGNBIT_CODE[ +int main() +{ + /* Test whether ceil (-0.0) is -0.0. */ + if (signbitd (minus_zerod) && !signbitd (ceil (minus_zerod))) + return 1; + return 0; +} + ]])], + [gl_cv_func_ceil_ieee=yes], + [gl_cv_func_ceil_ieee=no], + [gl_cv_func_ceil_ieee="guessing no"]) + LIBS="$save_LIBS" + ]) + case "$gl_cv_func_ceil_ieee" in + *yes) ;; + *) REPLACE_CEIL=1 ;; + esac + fi + ]) + if test $REPLACE_CEIL = 1; then + AC_LIBOBJ([ceil]) + CEIL_LIBM= + fi AC_SUBST([CEIL_LIBM]) ]) diff --git a/m4/ceilf-ieee.m4 b/m4/ceilf-ieee.m4 new file mode 100644 --- /dev/null +++ b/m4/ceilf-ieee.m4 @@ -0,0 +1,15 @@ +# ceilf-ieee.m4 serial 1 +dnl Copyright (C) 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 This macro is in a separate file (not in ceilf.m4 and not inlined in the +dnl module description), so that gl_FUNC_CEILF can test whether 'aclocal' has +dnl found uses of this macro. + +AC_DEFUN([gl_FUNC_CEILF_IEEE], +[ + m4_divert_text([INIT_PREPARE], [gl_ceilf_required=ieee]) + AC_REQUIRE([gl_FUNC_CEILF]) +]) diff --git a/m4/ceilf.m4 b/m4/ceilf.m4 --- a/m4/ceilf.m4 +++ b/m4/ceilf.m4 @@ -1,4 +1,4 @@ -# ceilf.m4 serial 7 +# ceilf.m4 serial 8 dnl Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -6,6 +6,7 @@ AC_DEFUN([gl_FUNC_CEILF], [ + m4_divert_text([DEFAULTS], [gl_ceilf_required=plain]) AC_REQUIRE([gl_MATH_H_DEFAULTS]) dnl Persuade glibc to declare ceilf(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) @@ -19,6 +20,40 @@ dnl libm.so, but not in the libm.so that the compiler uses. REPLACE_CEILF=1 fi + m4_ifdef([gl_FUNC_CEILF_IEEE], [ + if test $gl_ceilf_required = ieee && test $REPLACE_CEILF = 0; then + AC_CACHE_CHECK([whether ceilf works according to ISO C 99 with IEC 60559], + [gl_cv_func_ceilf_ieee], + [ + save_LIBS="$LIBS" + LIBS="$LIBS $CEILF_LIBM" + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#ifndef __NO_MATH_INLINES +# define __NO_MATH_INLINES 1 /* for glibc */ +#endif +#include +]gl_FLOAT_MINUS_ZERO_CODE[ +]gl_FLOAT_SIGNBIT_CODE[ +int main() +{ + /* Test whether ceilf (-0.0f) is -0.0f. */ + if (signbitf (minus_zerof) && !signbitf (ceilf (minus_zerof))) + return 1; + return 0; +} + ]])], + [gl_cv_func_ceilf_ieee=yes], + [gl_cv_func_ceilf_ieee=no], + [gl_cv_func_ceilf_ieee="guessing no"]) + LIBS="$save_LIBS" + ]) + case "$gl_cv_func_ceilf_ieee" in + *yes) ;; + *) REPLACE_CEILF=1 ;; + esac + fi + ]) else HAVE_DECL_CEILF=0 fi diff --git a/m4/ceill-ieee.m4 b/m4/ceill-ieee.m4 new file mode 100644 --- /dev/null +++ b/m4/ceill-ieee.m4 @@ -0,0 +1,15 @@ +# ceill-ieee.m4 serial 1 +dnl Copyright (C) 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 This macro is in a separate file (not in ceill.m4 and not inlined in the +dnl module description), so that gl_FUNC_CEILL can test whether 'aclocal' has +dnl found uses of this macro. + +AC_DEFUN([gl_FUNC_CEILL_IEEE], +[ + m4_divert_text([INIT_PREPARE], [gl_ceill_required=ieee]) + AC_REQUIRE([gl_FUNC_CEILL]) +]) diff --git a/m4/ceill.m4 b/m4/ceill.m4 --- a/m4/ceill.m4 +++ b/m4/ceill.m4 @@ -1,4 +1,4 @@ -# ceill.m4 serial 7 +# ceill.m4 serial 8 dnl Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -6,6 +6,7 @@ AC_DEFUN([gl_FUNC_CEILL], [ + m4_divert_text([DEFAULTS], [gl_ceill_required=plain]) AC_REQUIRE([gl_MATH_H_DEFAULTS]) dnl Persuade glibc to declare ceill(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) @@ -19,6 +20,40 @@ dnl libm.so, but not in the libm.so that the compiler uses. REPLACE_CEILL=1 fi + m4_ifdef([gl_FUNC_CEILL_IEEE], [ + if test $gl_ceill_required = ieee && test $REPLACE_CEILL = 0; then + AC_CACHE_CHECK([whether ceill works according to ISO C 99 with IEC 60559], + [gl_cv_func_ceill_ieee], + [ + save_LIBS="$LIBS" + LIBS="$LIBS $CEILL_LIBM" + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#ifndef __NO_MATH_INLINES +# define __NO_MATH_INLINES 1 /* for glibc */ +#endif +#include +]gl_LONG_DOUBLE_MINUS_ZERO_CODE[ +]gl_LONG_DOUBLE_SIGNBIT_CODE[ +int main() +{ + /* Test whether ceill (-0.3L) is -0.0L. */ + if (signbitl (minus_zerol) && !signbitl (ceill (-0.3L))) + return 1; + return 0; +} + ]])], + [gl_cv_func_ceill_ieee=yes], + [gl_cv_func_ceill_ieee=no], + [gl_cv_func_ceill_ieee="guessing no"]) + LIBS="$save_LIBS" + ]) + case "$gl_cv_func_ceill_ieee" in + *yes) ;; + *) REPLACE_CEILL=1 ;; + esac + fi + ]) else HAVE_DECL_CEILL=0 fi diff --git a/m4/configmake.m4 b/m4/configmake.m4 new file mode 100644 --- /dev/null +++ b/m4/configmake.m4 @@ -0,0 +1,50 @@ +# configmake.m4 serial 1 +dnl Copyright (C) 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. + +# gl_CONFIGMAKE_PREP +# ------------------ +# Guarantee all of the standard directory variables, even when used with +# autoconf 2.59 (datarootdir wasn't supported until 2.59c) or automake +# 1.9.6 (pkglibexecdir wasn't supported until 1.10b.). +AC_DEFUN([gl_CONFIGMAKE_PREP], +[ + dnl Technically, datadir should default to datarootdir. But if + dnl autoconf is too old to provide datarootdir, then reversing the + dnl definition is a reasonable compromise. Only AC_SUBST a variable + dnl if it was not already defined earlier by autoconf. + if test "x$datarootdir" = x; then + AC_SUBST([datarootdir], ['${datadir}']) + fi + dnl Copy the approach used in autoconf 2.60. + if test "x$docdir" = x; then + AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], + ['${datarootdir}/doc/${PACKAGE_TARNAME}'], + ['${datarootdir}/doc/${PACKAGE}'])]) + fi + dnl The remaining variables missing from autoconf 2.59 are easier. + if test "x$htmldir" = x; then + AC_SUBST([htmldir], ['${docdir}']) + fi + if test "x$dvidir" = x; then + AC_SUBST([dvidir], ['${docdir}']) + fi + if test "x$pdfdir" = x; then + AC_SUBST([pdfdir], ['${docdir}']) + fi + if test "x$psdir" = x; then + AC_SUBST([psdir], ['${docdir}']) + fi + if test "x$lispdir" = x; then + AC_SUBST([lispdir], ['${datarootdir}/emacs/site-lisp']) + fi + if test "x$localedir" = x; then + AC_SUBST([localedir], ['${datarootdir}/locale']) + fi + + dnl Automake 1.9.6 only lacks pkglibexecdir; and since 1.11 merely + dnl provides it without AC_SUBST, this blind use of AC_SUBST is safe. + AC_SUBST([pkglibexecdir], ['${libexecdir}/${PACKAGE}']) +]) diff --git a/m4/fchdir.m4 b/m4/fchdir.m4 --- a/m4/fchdir.m4 +++ b/m4/fchdir.m4 @@ -1,4 +1,4 @@ -# fchdir.m4 serial 14 +# fchdir.m4 serial 15 dnl Copyright (C) 2006-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, @@ -9,6 +9,12 @@ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) AC_REQUIRE([gl_DIRENT_H_DEFAULTS]) AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) + + AC_CHECK_DECLS_ONCE([fchdir]) + if test $ac_cv_have_decl_fchdir = no; then + HAVE_DECL_FCHDIR=0 + fi + AC_CHECK_FUNCS_ONCE([fchdir]) if test $ac_cv_func_fchdir = no; then HAVE_FCHDIR=0 diff --git a/m4/floor-ieee.m4 b/m4/floor-ieee.m4 new file mode 100644 --- /dev/null +++ b/m4/floor-ieee.m4 @@ -0,0 +1,15 @@ +# floor-ieee.m4 serial 1 +dnl Copyright (C) 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 This macro is in a separate file (not in floor.m4 and not inlined in the +dnl module description), so that gl_FUNC_FLOOR can test whether 'aclocal' has +dnl found uses of this macro. + +AC_DEFUN([gl_FUNC_FLOOR_IEEE], +[ + m4_divert_text([INIT_PREPARE], [gl_floor_required=ieee]) + AC_REQUIRE([gl_FUNC_FLOOR]) +]) diff --git a/m4/floor.m4 b/m4/floor.m4 --- a/m4/floor.m4 +++ b/m4/floor.m4 @@ -1,16 +1,56 @@ -# floor.m4 serial 4 -dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. +# floor.m4 serial 5 +dnl Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_FLOOR], [ + m4_divert_text([DEFAULTS], [gl_floor_required=plain]) + AC_REQUIRE([gl_MATH_H_DEFAULTS]) dnl Test whether floor() can be used without libm. gl_FUNC_FLOOR_LIBS if test "$FLOOR_LIBM" = "?"; then FLOOR_LIBM= fi + m4_ifdef([gl_FUNC_FLOOR_IEEE], [ + if test $gl_floor_required = ieee && test $REPLACE_FLOOR = 0; then + AC_CACHE_CHECK([whether floor works according to ISO C 99 with IEC 60559], + [gl_cv_func_floor_ieee], + [ + save_LIBS="$LIBS" + LIBS="$LIBS $FLOOR_LIBM" + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#ifndef __NO_MATH_INLINES +# define __NO_MATH_INLINES 1 /* for glibc */ +#endif +#include +]gl_DOUBLE_MINUS_ZERO_CODE[ +]gl_DOUBLE_SIGNBIT_CODE[ +int main() +{ + /* Test whether floor (-0.0) is -0.0. */ + if (signbitd (minus_zerod) && !signbitd (floor (minus_zerod))) + return 1; + return 0; +} + ]])], + [gl_cv_func_floor_ieee=yes], + [gl_cv_func_floor_ieee=no], + [gl_cv_func_floor_ieee="guessing no"]) + LIBS="$save_LIBS" + ]) + case "$gl_cv_func_floor_ieee" in + *yes) ;; + *) REPLACE_FLOOR=1 ;; + esac + fi + ]) + if test $REPLACE_FLOOR = 1; then + AC_LIBOBJ([floor]) + FLOOR_LIBM= + fi AC_SUBST([FLOOR_LIBM]) ]) diff --git a/m4/floorf-ieee.m4 b/m4/floorf-ieee.m4 new file mode 100644 --- /dev/null +++ b/m4/floorf-ieee.m4 @@ -0,0 +1,15 @@ +# floorf-ieee.m4 serial 1 +dnl Copyright (C) 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 This macro is in a separate file (not in floorf.m4 and not inlined in the +dnl module description), so that gl_FUNC_FLOORF can test whether 'aclocal' has +dnl found uses of this macro. + +AC_DEFUN([gl_FUNC_FLOORF_IEEE], +[ + m4_divert_text([INIT_PREPARE], [gl_floorf_required=ieee]) + AC_REQUIRE([gl_FUNC_FLOORF]) +]) diff --git a/m4/floorf.m4 b/m4/floorf.m4 --- a/m4/floorf.m4 +++ b/m4/floorf.m4 @@ -1,4 +1,4 @@ -# floorf.m4 serial 7 +# floorf.m4 serial 8 dnl Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -6,6 +6,7 @@ AC_DEFUN([gl_FUNC_FLOORF], [ + m4_divert_text([DEFAULTS], [gl_floorf_required=plain]) AC_REQUIRE([gl_MATH_H_DEFAULTS]) dnl Persuade glibc to declare floorf(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) @@ -19,6 +20,40 @@ dnl libm.so, but not in the libm.so that the compiler uses. REPLACE_FLOORF=1 fi + m4_ifdef([gl_FUNC_FLOORF_IEEE], [ + if test $gl_floorf_required = ieee && test $REPLACE_FLOORF = 0; then + AC_CACHE_CHECK([whether floorf works according to ISO C 99 with IEC 60559], + [gl_cv_func_floorf_ieee], + [ + save_LIBS="$LIBS" + LIBS="$LIBS $FLOORF_LIBM" + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#ifndef __NO_MATH_INLINES +# define __NO_MATH_INLINES 1 /* for glibc */ +#endif +#include +]gl_FLOAT_MINUS_ZERO_CODE[ +]gl_FLOAT_SIGNBIT_CODE[ +int main() +{ + /* Test whether floorf (-0.0f) is -0.0f. */ + if (signbitf (minus_zerof) && !signbitf (floorf (minus_zerof))) + return 1; + return 0; +} + ]])], + [gl_cv_func_floorf_ieee=yes], + [gl_cv_func_floorf_ieee=no], + [gl_cv_func_floorf_ieee="guessing no"]) + LIBS="$save_LIBS" + ]) + case "$gl_cv_func_floorf_ieee" in + *yes) ;; + *) REPLACE_FLOORF=1 ;; + esac + fi + ]) else HAVE_DECL_FLOORF=0 fi diff --git a/m4/fopen.m4 b/m4/fopen.m4 --- a/m4/fopen.m4 +++ b/m4/fopen.m4 @@ -1,4 +1,4 @@ -# fopen.m4 serial 6 +# fopen.m4 serial 7 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, @@ -34,7 +34,7 @@ [ changequote(,)dnl case "$host_os" in - aix* | hpux* | solaris2.[0-9]*) + aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*) gl_cv_func_fopen_slash="guessing no" ;; *) gl_cv_func_fopen_slash="guessing yes" ;; diff --git a/m4/fseeko.m4 b/m4/fseeko.m4 --- a/m4/fseeko.m4 +++ b/m4/fseeko.m4 @@ -1,4 +1,4 @@ -# fseeko.m4 serial 9 +# fseeko.m4 serial 10 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, @@ -10,6 +10,11 @@ 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/m4/ftello.m4 b/m4/ftello.m4 --- a/m4/ftello.m4 +++ b/m4/ftello.m4 @@ -1,4 +1,4 @@ -# ftello.m4 serial 8 +# ftello.m4 serial 9 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, @@ -13,6 +13,11 @@ dnl Persuade glibc 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/m4/gethostname.m4 b/m4/gethostname.m4 --- a/m4/gethostname.m4 +++ b/m4/gethostname.m4 @@ -1,5 +1,5 @@ -# gethostname.m4 serial 9 -dnl Copyright (C) 2002, 2008, 2009, 2010 Free Software Foundation, Inc. +# gethostname.m4 serial 10 +dnl Copyright (C) 2002, 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -83,7 +83,11 @@ #if HAVE_NETDB_H # include #endif -]) +], + [dnl The system does not define MAXHOSTNAMELEN in any of the common + dnl headers. Use a safe fallback. + gl_cv_decl_HOST_NAME_MAX=256 + ]) fi fi ]) diff --git a/m4/getlogin_r.m4 b/m4/getlogin_r.m4 --- a/m4/getlogin_r.m4 +++ b/m4/getlogin_r.m4 @@ -1,4 +1,4 @@ -#serial 7 +#serial 9 # Copyright (C) 2005-2007, 2009-2010 Free Software Foundation, Inc. # @@ -20,14 +20,65 @@ dnl getlogin_r(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_DECLS_ONCE([getlogin_r]) + if test $ac_cv_have_decl_getlogin_r = no; then + HAVE_DECL_GETLOGIN_R=0 + fi + AC_CHECK_FUNCS_ONCE([getlogin_r]) if test $ac_cv_func_getlogin_r = no; then + HAVE_GETLOGIN_R=0 + else + HAVE_GETLOGIN_R=1 + dnl On OSF/1 5.1, getlogin_r returns a truncated result if the buffer is + dnl not large enough. + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CACHE_CHECK([whether getlogin_r works with small buffers], + [gl_cv_func_getlogin_r_works], + [ + dnl Initial guess, used when cross-compiling. +changequote(,)dnl + case "$host_os" in + # Guess no on OSF/1. + osf*) gl_cv_func_getlogin_r_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_getlogin_r_works="guessing yes" ;; + esac +changequote([,])dnl + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#if !HAVE_DECL_GETLOGIN_R +extern int getlogin_r (char *, size_t); +#endif +int +main (void) +{ + int result = 0; + char buf[100]; + + if (getlogin_r (buf, 0) == 0) + result |= 16; + if (getlogin_r (buf, 1) == 0) + result |= 17; + return result; +}]])], + [gl_cv_func_getlogin_r_works=yes], + [case $? in + 16 | 17) gl_cv_func_getlogin_r_works=no ;; + esac + ], + [:]) + ]) + case "$gl_cv_func_getlogin_r_works" in + *yes) ;; + *) REPLACE_GETLOGIN_R=1 ;; + esac + fi + if test $HAVE_GETLOGIN_R = 0 || test $REPLACE_GETLOGIN_R = 1; then AC_LIBOBJ([getlogin_r]) gl_PREREQ_GETLOGIN_R - AC_CHECK_DECLS_ONCE([getlogin_r]) - if test $ac_cv_have_decl_getlogin_r = no; then - HAVE_DECL_GETLOGIN_R=0 - fi fi ]) diff --git a/m4/iconv_open.m4 b/m4/iconv_open.m4 --- a/m4/iconv_open.m4 +++ b/m4/iconv_open.m4 @@ -1,4 +1,4 @@ -# iconv_open.m4 serial 11 +# iconv_open.m4 serial 12 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, @@ -203,7 +203,7 @@ result |= 8; else if (!(memcmp (buf, expected, sizeof (expected) - 1) == 0)) result |= 8; - else if ((iconv_close (cd) == 0)) + else if (!(iconv_close (cd) == 0)) result |= 8; } } diff --git a/m4/inet_ntop.m4 b/m4/inet_ntop.m4 --- a/m4/inet_ntop.m4 +++ b/m4/inet_ntop.m4 @@ -1,4 +1,4 @@ -# inet_ntop.m4 serial 12 +# inet_ntop.m4 serial 13 dnl Copyright (C) 2005, 2006, 2008, 2009, 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -29,7 +29,13 @@ # Prerequisites of lib/inet_ntop.c. AC_DEFUN([gl_PREREQ_INET_NTOP], [ - AC_CHECK_DECLS([inet_ntop],,,[#include ]) + AC_CHECK_HEADERS_ONCE([netdb.h]) + AC_CHECK_DECLS([inet_ntop],,, + [#include + #if HAVE_NETDB_H + # include + #endif + ]) if test $ac_cv_have_decl_inet_ntop = no; then HAVE_DECL_INET_NTOP=0 fi diff --git a/m4/inet_pton.m4 b/m4/inet_pton.m4 --- a/m4/inet_pton.m4 +++ b/m4/inet_pton.m4 @@ -1,4 +1,4 @@ -# inet_pton.m4 serial 10 +# inet_pton.m4 serial 11 dnl Copyright (C) 2006, 2008, 2009, 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -29,7 +29,13 @@ # Prerequisites of lib/inet_pton.c. AC_DEFUN([gl_PREREQ_INET_PTON], [ - AC_CHECK_DECLS([inet_pton],,,[#include ]) + AC_CHECK_HEADERS_ONCE([netdb.h]) + AC_CHECK_DECLS([inet_pton],,, + [#include + #if HAVE_NETDB_H + # include + #endif + ]) if test $ac_cv_have_decl_inet_pton = no; then HAVE_DECL_INET_PTON=0 fi diff --git a/m4/link-follow.m4 b/m4/link-follow.m4 --- a/m4/link-follow.m4 +++ b/m4/link-follow.m4 @@ -1,4 +1,4 @@ -# serial 15 +# serial 16 dnl Run a program to determine whether link(2) follows symlinks. dnl Set LINK_FOLLOWS_SYMLINKS accordingly. @@ -12,7 +12,8 @@ dnl linkat(,AT_SYMLINK_FOLLOW) requires a readlink. If it is 1, dnl link matches linkat(,AT_SYMLINK_FOLLOW), and there is no way dnl to do linkat(,0) on symlinks (on all other file types, -dnl link() is sufficient). If it is -1, use a runtime test. +dnl link() is sufficient). If it is -1, use a Solaris specific +dnl runtime test. If it is -2, use a generic runtime test. AC_DEFUN([gl_FUNC_LINK_FOLLOWS_SYMLINK], [dnl AC_CHECK_FUNCS_ONCE([readlink]) @@ -22,12 +23,27 @@ dnl linkat variants. So, we set LINK_FOLLOWS_SYMLINKS to 0. gl_link_follows_symlinks=0 # assume GNU behavior if test $ac_cv_func_readlink = yes; then - AC_CACHE_CHECK([whether link(2) dereferences a symlink], - gl_cv_func_link_follows_symlink, - [ - # Create a regular file. - echo > conftest.file - AC_RUN_IFELSE([AC_LANG_SOURCE([[ + dnl Solaris has an __xpg4 variable in libc, and it determines the + dnl behaviour of link(): It dereferences a symlink if and only if + dnl __xpg4 != 0. + AC_CACHE_CHECK([for __xpg4], [gl_cv_have___xpg4], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[extern int __xpg4;]], + [[return __xpg4;]])], + [gl_cv_have___xpg4=yes], + [gl_cv_have___xpg4=no]) + ]) + if test $gl_cv_have___xpg4 = yes; then + gl_link_follows_symlinks=-1 + else + AC_CACHE_CHECK([whether link(2) dereferences a symlink], + [gl_cv_func_link_follows_symlink], + [ + # Create a regular file. + echo > conftest.file + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ # include # include # include @@ -62,20 +78,22 @@ the link call followed the symlink. */ return SAME_INODE (sb_hard, sb_file) ? 1 : 0; } - ]])], - [gl_cv_func_link_follows_symlink=no], dnl GNU behavior - [gl_cv_func_link_follows_symlink=yes], dnl Followed link/compile failed - [gl_cv_func_link_follows_symlink=unknown] dnl We're cross compiling. - ) - rm -f conftest.file conftest.sym conftest.hard - ]) - case $gl_cv_func_link_follows_symlink in - yes) gl_link_follows_symlinks=1 ;; - no) ;; # already defaulted to 0 - *) gl_link_follows_symlinks=-1 ;; - esac + ]])], + [gl_cv_func_link_follows_symlink=no], dnl GNU behavior + [gl_cv_func_link_follows_symlink=yes], dnl Followed link/compile failed + [gl_cv_func_link_follows_symlink=unknown] dnl We're cross compiling. + ) + rm -f conftest.file conftest.sym conftest.hard + ]) + case $gl_cv_func_link_follows_symlink in + yes) gl_link_follows_symlinks=1 ;; + no) ;; # already defaulted to 0 + *) gl_link_follows_symlinks=-2 ;; + esac + fi fi AC_DEFINE_UNQUOTED([LINK_FOLLOWS_SYMLINKS], [$gl_link_follows_symlinks], [Define to 1 if `link(2)' dereferences symbolic links, 0 if it - creates hard links to symlinks, and -1 if unknown.]) + creates hard links to symlinks, -1 if it depends on the variable __xpg4, + and -2 if unknown.]) ]) diff --git a/m4/math_h.m4 b/m4/math_h.m4 --- a/m4/math_h.m4 +++ b/m4/math_h.m4 @@ -1,4 +1,4 @@ -# math_h.m4 serial 21 +# math_h.m4 serial 25 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, @@ -57,10 +57,12 @@ GNULIB_ACOSL=0; AC_SUBST([GNULIB_ACOSL]) GNULIB_ASINL=0; AC_SUBST([GNULIB_ASINL]) GNULIB_ATANL=0; AC_SUBST([GNULIB_ATANL]) + GNULIB_CEIL=0; AC_SUBST([GNULIB_CEIL]) GNULIB_CEILF=0; AC_SUBST([GNULIB_CEILF]) GNULIB_CEILL=0; AC_SUBST([GNULIB_CEILL]) GNULIB_COSL=0; AC_SUBST([GNULIB_COSL]) GNULIB_EXPL=0; AC_SUBST([GNULIB_EXPL]) + GNULIB_FLOOR=0; AC_SUBST([GNULIB_FLOOR]) GNULIB_FLOORF=0; AC_SUBST([GNULIB_FLOORF]) GNULIB_FLOORL=0; AC_SUBST([GNULIB_FLOORL]) GNULIB_FREXP=0; AC_SUBST([GNULIB_FREXP]) @@ -119,8 +121,10 @@ HAVE_DECL_TRUNC=1; AC_SUBST([HAVE_DECL_TRUNC]) HAVE_DECL_TRUNCF=1; AC_SUBST([HAVE_DECL_TRUNCF]) HAVE_DECL_TRUNCL=1; AC_SUBST([HAVE_DECL_TRUNCL]) + REPLACE_CEIL=0; AC_SUBST([REPLACE_CEIL]) REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF]) REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL]) + REPLACE_FLOOR=0; AC_SUBST([REPLACE_FLOOR]) REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF]) REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL]) REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP]) @@ -136,5 +140,7 @@ REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL]) REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT]) REPLACE_SIGNBIT_USING_GCC=0; AC_SUBST([REPLACE_SIGNBIT_USING_GCC]) + REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC]) + REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF]) REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL]) ]) diff --git a/m4/mbrlen.m4 b/m4/mbrlen.m4 --- a/m4/mbrlen.m4 +++ b/m4/mbrlen.m4 @@ -1,4 +1,4 @@ -# mbrlen.m4 serial 4 +# mbrlen.m4 serial 5 dnl Copyright (C) 2008, 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -56,6 +56,13 @@ [AC_LANG_SOURCE([[ #include #include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include #include int main () { @@ -107,6 +114,13 @@ [AC_LANG_SOURCE([[ #include #include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include #include int main () { @@ -174,6 +188,13 @@ [AC_LANG_SOURCE([[ #include #include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include #include int main () { diff --git a/m4/mbrtowc.m4 b/m4/mbrtowc.m4 --- a/m4/mbrtowc.m4 +++ b/m4/mbrtowc.m4 @@ -1,4 +1,4 @@ -# mbrtowc.m4 serial 19 +# mbrtowc.m4 serial 21 dnl Copyright (C) 2001-2002, 2004-2005, 2008-2010 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -19,12 +19,20 @@ if test $REPLACE_MBSTATE_T = 1; then REPLACE_MBRTOWC=1 else - gl_MBRTOWC_NULL_ARG + gl_MBRTOWC_NULL_ARG1 + gl_MBRTOWC_NULL_ARG2 gl_MBRTOWC_RETVAL gl_MBRTOWC_NUL_RETVAL - case "$gl_cv_func_mbrtowc_null_arg" in + case "$gl_cv_func_mbrtowc_null_arg1" in *yes) ;; - *) AC_DEFINE([MBRTOWC_NULL_ARG_BUG], [1], + *) AC_DEFINE([MBRTOWC_NULL_ARG1_BUG], [1], + [Define if the mbrtowc function has the NULL pwc argument bug.]) + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_null_arg2" in + *yes) ;; + *) AC_DEFINE([MBRTOWC_NULL_ARG2_BUG], [1], [Define if the mbrtowc function has the NULL string argument bug.]) REPLACE_MBRTOWC=1 ;; @@ -112,6 +120,13 @@ [AC_LANG_SOURCE([[ #include #include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include #include int main () { @@ -162,6 +177,13 @@ #include #include #include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include #include int main () { @@ -188,25 +210,95 @@ ]) ]) +dnl Test whether mbrtowc supports a NULL pwc argument correctly. +dnl Result is gl_cv_func_mbrtowc_null_arg1. + +AC_DEFUN([gl_MBRTOWC_NULL_ARG1], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR_UTF8]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbrtowc handles a NULL pwc argument], + [gl_cv_func_mbrtowc_null_arg1], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on Solaris. + solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR_UTF8 != none; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int main () +{ + int result = 0; + + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + char input[] = "\303\237er"; + mbstate_t state; + wchar_t wc; + size_t ret; + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 5, &state); + if (ret != 2) + result |= 1; + if (!mbsinit (&state)) + result |= 2; + + memset (&state, '\0', sizeof (mbstate_t)); + ret = mbrtowc (NULL, input, 5, &state); + if (ret != 2) /* Solaris 7 fails here: ret is -1. */ + result |= 4; + if (!mbsinit (&state)) + result |= 8; + } + return result; +}]])], + [gl_cv_func_mbrtowc_null_arg1=yes], + [gl_cv_func_mbrtowc_null_arg1=no], + [:]) + fi + ]) +]) + dnl Test whether mbrtowc supports a NULL string argument correctly. -dnl Result is gl_cv_func_mbrtowc_null_arg. +dnl Result is gl_cv_func_mbrtowc_null_arg2. -AC_DEFUN([gl_MBRTOWC_NULL_ARG], +AC_DEFUN([gl_MBRTOWC_NULL_ARG2], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gt_LOCALE_FR_UTF8]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether mbrtowc handles a NULL string argument], - [gl_cv_func_mbrtowc_null_arg], + [gl_cv_func_mbrtowc_null_arg2], [ dnl Initial guess, used when cross-compiling or when no suitable locale dnl is present. changequote(,)dnl case "$host_os" in # Guess no on OSF/1. - osf*) gl_cv_func_mbrtowc_null_arg="guessing no" ;; + osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;; # Guess yes otherwise. - *) gl_cv_func_mbrtowc_null_arg="guessing yes" ;; + *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_FR_UTF8 != none; then @@ -214,6 +306,13 @@ [AC_LANG_SOURCE([[ #include #include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include #include int main () { @@ -232,8 +331,8 @@ } return 0; }]])], - [gl_cv_func_mbrtowc_null_arg=yes], - [gl_cv_func_mbrtowc_null_arg=no], + [gl_cv_func_mbrtowc_null_arg2=yes], + [gl_cv_func_mbrtowc_null_arg2=no], [:]) fi ]) @@ -268,6 +367,13 @@ [AC_LANG_SOURCE([[ #include #include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include #include int main () { @@ -337,6 +443,13 @@ [AC_LANG_SOURCE([[ #include #include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include #include int main () { @@ -367,10 +480,8 @@ dnl From Paul Eggert -dnl This override of an autoconf macro can be removed when autoconf 2.60 or -dnl newer can be assumed everywhere. +dnl This is an override of an autoconf macro. -m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.60]),[-1],[ AC_DEFUN([AC_FUNC_MBRTOWC], [ dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60. @@ -378,7 +489,14 @@ gl_cv_func_mbrtowc, [AC_LINK_IFELSE( [AC_LANG_PROGRAM( - [[#include ]], + [[/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include ]], [[wchar_t wc; char const s[] = ""; size_t n = 1; @@ -391,4 +509,3 @@ [Define to 1 if mbrtowc and mbstate_t are properly declared.]) fi ]) -]) diff --git a/m4/mbsrtowcs.m4 b/m4/mbsrtowcs.m4 --- a/m4/mbsrtowcs.m4 +++ b/m4/mbsrtowcs.m4 @@ -1,4 +1,4 @@ -# mbsrtowcs.m4 serial 8 +# mbsrtowcs.m4 serial 9 dnl Copyright (C) 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -61,6 +61,13 @@ [AC_LANG_SOURCE([[ #include #include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include #include int main () { diff --git a/m4/mbstate_t.m4 b/m4/mbstate_t.m4 --- a/m4/mbstate_t.m4 +++ b/m4/mbstate_t.m4 @@ -1,4 +1,4 @@ -# mbstate_t.m4 serial 12 +# mbstate_t.m4 serial 13 dnl Copyright (C) 2000-2002, 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,14 @@ [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [AC_INCLUDES_DEFAULT[ -# include ]], +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include ]], [[mbstate_t x; return sizeof x;]])], [ac_cv_type_mbstate_t=yes], [ac_cv_type_mbstate_t=no])]) diff --git a/m4/memmem.m4 b/m4/memmem.m4 --- a/m4/memmem.m4 +++ b/m4/memmem.m4 @@ -1,11 +1,11 @@ -# memmem.m4 serial 20 +# memmem.m4 serial 22 dnl Copyright (C) 2002, 2003, 2004, 2007, 2008, 2009, 2010 Free Software dnl 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 to declare memmem(). @@ -18,6 +18,7 @@ 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 +26,32 @@ #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 - #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 +75,7 @@ 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 +107,23 @@ 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 #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 - #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/m4/minus-zero.m4 b/m4/minus-zero.m4 new file mode 100644 --- /dev/null +++ b/m4/minus-zero.m4 @@ -0,0 +1,76 @@ +# minus-zero.m4 serial 1 +dnl Copyright (C) 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. + +# Macros for floating-point negative zero. +# Keep in sync with tests/minus-zero.h! + +# Expands to code that defines a variable or macro minus_zerof. +AC_DEFUN([gl_FLOAT_MINUS_ZERO_CODE], +[[ +#include +/* minus_zerof represents the value -0.0f. */ +/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0f. + ICC 10.0 has a bug when optimizing the expression -zero. + The expression -FLT_MIN * FLT_MIN does not work when cross-compiling + to PowerPC on MacOS X 10.5. */ +#if defined __hpux || defined __sgi || defined __ICC +static float +compute_minus_zerof (void) +{ + return -FLT_MIN * FLT_MIN; +} +# define minus_zerof compute_minus_zerof () +#else +float minus_zerof = -0.0f; +#endif +]]) + +# Expands to code that defines a variable or macro minus_zerod. +AC_DEFUN([gl_DOUBLE_MINUS_ZERO_CODE], +[[ +#include +/* minus_zerod represents the value -0.0. */ +/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. + ICC 10.0 has a bug when optimizing the expression -zero. + The expression -DBL_MIN * DBL_MIN does not work when cross-compiling + to PowerPC on MacOS X 10.5. */ +#if defined __hpux || defined __sgi || defined __ICC +static double +compute_minus_zerod (void) +{ + return -DBL_MIN * DBL_MIN; +} +# define minus_zerod compute_minus_zerod () +#else +double minus_zerod = -0.0; +#endif +]]) + +# Expands to code that defines a variable or macro minus_zerol. +AC_DEFUN([gl_LONG_DOUBLE_MINUS_ZERO_CODE], +[[ +#include +#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__) +# undef LDBL_MIN +# define LDBL_MIN 3.3621031431120935063E-4932L +#endif +/* minus_zerol represents the value -0.0L. */ +/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0L. + IRIX cc can't put -0.0L into .data, but can compute at runtime. + ICC 10.0 has a bug when optimizing the expression -zero. + The expression -LDBL_MIN * LDBL_MIN does not work when cross-compiling + to PowerPC on MacOS X 10.5. */ +#if defined __hpux || defined __sgi || defined __ICC +static long double +compute_minus_zerol (void) +{ + return -LDBL_MIN * LDBL_MIN; +} +# define minus_zerol compute_minus_zerol () +#else +long double minus_zerol = -0.0L; +#endif +]]) diff --git a/m4/open.m4 b/m4/open.m4 --- a/m4/open.m4 +++ b/m4/open.m4 @@ -1,4 +1,4 @@ -# open.m4 serial 10 +# open.m4 serial 11 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, @@ -44,7 +44,7 @@ [ changequote(,)dnl case "$host_os" in - freebsd* | aix* | hpux* | solaris2.[0-9]*) + freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*) gl_cv_func_open_slash="guessing no" ;; *) gl_cv_func_open_slash="guessing yes" ;; diff --git a/m4/printf.m4 b/m4/printf.m4 --- a/m4/printf.m4 +++ b/m4/printf.m4 @@ -1,4 +1,4 @@ -# printf.m4 serial 40 +# printf.m4 serial 42 dnl Copyright (C) 2003, 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, @@ -71,8 +71,8 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ # 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.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 NetBSD 5.0 . . . # # . . . . . . # . # . . . . . . dnl NetBSD 4.0 . ? ? ? ? ? . ? . ? ? ? ? ? . . . ? ? ? dnl NetBSD 3.0 . . . . # # . ? # # ? # . # . . . . . . -dnl Haiku . . . # # # . # . . . . . ? . . . . . . -dnl BeOS # # . # # # . ? # . ? . # ? . . . . . . +dnl Haiku . . . # # # . # . . . . . ? . . ? . . . +dnl BeOS # # . # # # . ? # . ? . # ? . . ? . . . dnl mingw # # # # # # . . # # . # # ? . # # # . . diff --git a/m4/round-ieee.m4 b/m4/round-ieee.m4 new file mode 100644 --- /dev/null +++ b/m4/round-ieee.m4 @@ -0,0 +1,15 @@ +# round-ieee.m4 serial 1 +dnl Copyright (C) 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 This macro is in a separate file (not in round.m4 and not inlined in the +dnl module description), so that gl_FUNC_ROUND can test whether 'aclocal' has +dnl found uses of this macro. + +AC_DEFUN([gl_FUNC_ROUND_IEEE], +[ + m4_divert_text([INIT_PREPARE], [gl_round_required=ieee]) + AC_REQUIRE([gl_FUNC_ROUND]) +]) diff --git a/m4/round.m4 b/m4/round.m4 --- a/m4/round.m4 +++ b/m4/round.m4 @@ -1,4 +1,4 @@ -# round.m4 serial 9 +# round.m4 serial 10 dnl Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -6,6 +6,7 @@ AC_DEFUN([gl_FUNC_ROUND], [ + m4_divert_text([DEFAULTS], [gl_round_required=plain]) AC_REQUIRE([gl_MATH_H_DEFAULTS]) dnl Persuade glibc to declare round(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) @@ -53,6 +54,40 @@ if test "$ROUND_LIBM" = missing; then REPLACE_ROUND=1 fi + m4_ifdef([gl_FUNC_ROUND_IEEE], [ + if test $gl_round_required = ieee && test $REPLACE_ROUND = 0; then + AC_CACHE_CHECK([whether round works according to ISO C 99 with IEC 60559], + [gl_cv_func_round_ieee], + [ + save_LIBS="$LIBS" + LIBS="$LIBS $ROUND_LIBM" + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#ifndef __NO_MATH_INLINES +# define __NO_MATH_INLINES 1 /* for glibc */ +#endif +#include +]gl_DOUBLE_MINUS_ZERO_CODE[ +]gl_DOUBLE_SIGNBIT_CODE[ +int main() +{ + /* Test whether round (-0.0) is -0.0. */ + if (signbitd (minus_zerod) && !signbitd (round (minus_zerod))) + return 1; + return 0; +} + ]])], + [gl_cv_func_round_ieee=yes], + [gl_cv_func_round_ieee=no], + [gl_cv_func_round_ieee="guessing no"]) + LIBS="$save_LIBS" + ]) + case "$gl_cv_func_round_ieee" in + *yes) ;; + *) REPLACE_ROUND=1 ;; + esac + fi + ]) else HAVE_DECL_ROUND=0 fi diff --git a/m4/roundf-ieee.m4 b/m4/roundf-ieee.m4 new file mode 100644 --- /dev/null +++ b/m4/roundf-ieee.m4 @@ -0,0 +1,15 @@ +# roundf-ieee.m4 serial 1 +dnl Copyright (C) 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 This macro is in a separate file (not in roundf.m4 and not inlined in the +dnl module description), so that gl_FUNC_ROUNDF can test whether 'aclocal' has +dnl found uses of this macro. + +AC_DEFUN([gl_FUNC_ROUNDF_IEEE], +[ + m4_divert_text([INIT_PREPARE], [gl_roundf_required=ieee]) + AC_REQUIRE([gl_FUNC_ROUNDF]) +]) diff --git a/m4/roundf.m4 b/m4/roundf.m4 --- a/m4/roundf.m4 +++ b/m4/roundf.m4 @@ -1,4 +1,4 @@ -# roundf.m4 serial 9 +# roundf.m4 serial 10 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, @@ -6,6 +6,7 @@ AC_DEFUN([gl_FUNC_ROUNDF], [ + m4_divert_text([DEFAULTS], [gl_roundf_required=plain]) AC_REQUIRE([gl_MATH_H_DEFAULTS]) dnl Persuade glibc to declare roundf(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) @@ -50,6 +51,40 @@ if test "$ROUNDF_LIBM" = missing; then REPLACE_ROUNDF=1 fi + m4_ifdef([gl_FUNC_ROUNDF_IEEE], [ + if test $gl_roundf_required = ieee && test $REPLACE_ROUNDF = 0; then + AC_CACHE_CHECK([whether roundf works according to ISO C 99 with IEC 60559], + [gl_cv_func_roundf_ieee], + [ + save_LIBS="$LIBS" + LIBS="$LIBS $ROUNDF_LIBM" + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#ifndef __NO_MATH_INLINES +# define __NO_MATH_INLINES 1 /* for glibc */ +#endif +#include +]gl_FLOAT_MINUS_ZERO_CODE[ +]gl_FLOAT_SIGNBIT_CODE[ +int main() +{ + /* Test whether roundf (-0.0f) is -0.0f. */ + if (signbitf (minus_zerof) && !signbitf (roundf (minus_zerof))) + return 1; + return 0; +} + ]])], + [gl_cv_func_roundf_ieee=yes], + [gl_cv_func_roundf_ieee=no], + [gl_cv_func_roundf_ieee="guessing no"]) + LIBS="$save_LIBS" + ]) + case "$gl_cv_func_roundf_ieee" in + *yes) ;; + *) REPLACE_ROUNDF=1 ;; + esac + fi + ]) else HAVE_DECL_ROUNDF=0 fi diff --git a/m4/roundl-ieee.m4 b/m4/roundl-ieee.m4 new file mode 100644 --- /dev/null +++ b/m4/roundl-ieee.m4 @@ -0,0 +1,15 @@ +# roundl-ieee.m4 serial 1 +dnl Copyright (C) 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 This macro is in a separate file (not in roundl.m4 and not inlined in the +dnl module description), so that gl_FUNC_ROUNDL can test whether 'aclocal' has +dnl found uses of this macro. + +AC_DEFUN([gl_FUNC_ROUNDL_IEEE], +[ + m4_divert_text([INIT_PREPARE], [gl_roundl_required=ieee]) + AC_REQUIRE([gl_FUNC_ROUNDL]) +]) diff --git a/m4/roundl.m4 b/m4/roundl.m4 --- a/m4/roundl.m4 +++ b/m4/roundl.m4 @@ -1,4 +1,4 @@ -# roundl.m4 serial 7 +# roundl.m4 serial 8 dnl Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -6,6 +6,7 @@ AC_DEFUN([gl_FUNC_ROUNDL], [ + m4_divert_text([DEFAULTS], [gl_roundl_required=plain]) AC_REQUIRE([gl_MATH_H_DEFAULTS]) dnl Persuade glibc to declare roundl(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) @@ -15,6 +16,40 @@ if test "$ROUNDL_LIBM" = missing; then REPLACE_ROUNDL=1 fi + m4_ifdef([gl_FUNC_ROUNDL_IEEE], [ + if test $gl_roundl_required = ieee && test $REPLACE_ROUNDL = 0; then + AC_CACHE_CHECK([whether roundl works according to ISO C 99 with IEC 60559], + [gl_cv_func_roundl_ieee], + [ + save_LIBS="$LIBS" + LIBS="$LIBS $ROUNDL_LIBM" + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#ifndef __NO_MATH_INLINES +# define __NO_MATH_INLINES 1 /* for glibc */ +#endif +#include +]gl_LONG_DOUBLE_MINUS_ZERO_CODE[ +]gl_LONG_DOUBLE_SIGNBIT_CODE[ +int main() +{ + /* Test whether roundl (-0.0L) is -0.0L. */ + if (signbitl (minus_zerol) && !signbitl (roundl (minus_zerol))) + return 1; + return 0; +} + ]])], + [gl_cv_func_roundl_ieee=yes], + [gl_cv_func_roundl_ieee=no], + [gl_cv_func_roundl_ieee="guessing no"]) + LIBS="$save_LIBS" + ]) + case "$gl_cv_func_roundl_ieee" in + *yes) ;; + *) REPLACE_ROUNDL=1 ;; + esac + fi + ]) else HAVE_DECL_ROUNDL=0 fi diff --git a/m4/setenv.m4 b/m4/setenv.m4 --- a/m4/setenv.m4 +++ b/m4/setenv.m4 @@ -1,4 +1,4 @@ -# setenv.m4 serial 19 +# setenv.m4 serial 20 dnl Copyright (C) 2001-2004, 2006-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, @@ -16,6 +16,10 @@ AC_DEFUN([gl_FUNC_SETENV_SEPARATE], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_CHECK_DECLS_ONCE([setenv]) + if test $ac_cv_have_decl_setenv = no; then + HAVE_DECL_SETENV=0 + fi AC_CHECK_FUNCS_ONCE([setenv]) if test $ac_cv_func_setenv = no; then HAVE_SETENV=0 @@ -55,9 +59,12 @@ AC_DEFUN([gl_FUNC_UNSETENV], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_CHECK_DECLS_ONCE([unsetenv]) + if test $ac_cv_have_decl_unsetenv = no; then + HAVE_DECL_UNSETENV=0 + fi AC_CHECK_FUNCS([unsetenv]) if test $ac_cv_func_unsetenv = no; then - HAVE_UNSETENV=0 AC_LIBOBJ([unsetenv]) gl_PREREQ_UNSETENV else @@ -66,6 +73,8 @@ [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ +#undef _BSD +#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 */ #include extern #ifdef __cplusplus diff --git a/m4/signbit.m4 b/m4/signbit.m4 --- a/m4/signbit.m4 +++ b/m4/signbit.m4 @@ -1,4 +1,4 @@ -# signbit.m4 serial 8 +# signbit.m4 serial 9 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, @@ -306,3 +306,43 @@ ;; esac ]) + +# Expands to code that defines a function signbitf(float). +# It extracts the sign bit of a non-NaN value. +AC_DEFUN([gl_FLOAT_SIGNBIT_CODE], +[ + gl_FLOATTYPE_SIGNBIT_CODE([float], [f], [f]) +]) + +# Expands to code that defines a function signbitd(double). +# It extracts the sign bit of a non-NaN value. +AC_DEFUN([gl_DOUBLE_SIGNBIT_CODE], +[ + gl_FLOATTYPE_SIGNBIT_CODE([double], [d], []) +]) + +# Expands to code that defines a function signbitl(long double). +# It extracts the sign bit of a non-NaN value. +AC_DEFUN([gl_LONG_DOUBLE_SIGNBIT_CODE], +[ + gl_FLOATTYPE_SIGNBIT_CODE([long double], [l], [L]) +]) + +AC_DEFUN([gl_FLOATTYPE_SIGNBIT_CODE], +[[ +static int +signbit$2 ($1 value) +{ + typedef union { $1 f; unsigned char b[sizeof ($1)]; } float_union; + static float_union plus_one = { 1.0$3 }; /* unused bits are zero here */ + static float_union minus_one = { -1.0$3 }; /* unused bits are zero here */ + /* Compute the sign bit mask as the XOR of plus_one and minus_one. */ + float_union u; + unsigned int i; + u.f = value; + for (i = 0; i < sizeof ($1); i++) + if (u.b[i] & (plus_one.b[i] ^ minus_one.b[i])) + return 1; + return 0; +} +]]) diff --git a/m4/snprintf.m4 b/m4/snprintf.m4 --- a/m4/snprintf.m4 +++ b/m4/snprintf.m4 @@ -13,7 +13,12 @@ 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/m4/stdio_h.m4 b/m4/stdio_h.m4 --- a/m4/stdio_h.m4 +++ b/m4/stdio_h.m4 @@ -1,4 +1,4 @@ -# stdio_h.m4 serial 31 +# stdio_h.m4 serial 32 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, @@ -95,6 +95,8 @@ 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/m4/stdlib_h.m4 b/m4/stdlib_h.m4 --- a/m4/stdlib_h.m4 +++ b/m4/stdlib_h.m4 @@ -1,4 +1,4 @@ -# stdlib_h.m4 serial 31 +# stdlib_h.m4 serial 33 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, @@ -93,13 +93,14 @@ 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/m4/strcasestr.m4 b/m4/strcasestr.m4 --- a/m4/strcasestr.m4 +++ b/m4/strcasestr.m4 @@ -1,4 +1,4 @@ -# strcasestr.m4 serial 18 +# strcasestr.m4 serial 19 dnl Copyright (C) 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -32,14 +32,17 @@ ]])], [gl_cv_func_strcasestr_works_always=yes], [gl_cv_func_strcasestr_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.12 and cygwin 1.7.7 have a known bug. uClibc is not + dnl affected, since it uses different source code for strcasestr + dnl than glibc. + dnl Assume that it works on all other platforms, even if it is not + dnl linear. AC_EGREP_CPP([Lucky user], [ #ifdef __GNU_LIBRARY__ #include #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \ - && !defined __UCLIBC__ + || defined __UCLIBC__ Lucky user #endif #elif defined __CYGWIN__ diff --git a/m4/strstr.m4 b/m4/strstr.m4 --- a/m4/strstr.m4 +++ b/m4/strstr.m4 @@ -1,4 +1,4 @@ -# strstr.m4 serial 12 +# strstr.m4 serial 13 dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -25,14 +25,17 @@ ]])], [gl_cv_func_strstr_works_always=yes], [gl_cv_func_strstr_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.12 and cygwin 1.7.7 have a known bug. uClibc is not + dnl affected, since it uses different source code for strstr than + dnl glibc. + dnl Assume that it works on all other platforms, even if it is not + dnl linear. AC_EGREP_CPP([Lucky user], [ #ifdef __GNU_LIBRARY__ #include #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \ - && !defined __UCLIBC__ + || defined __UCLIBC__ Lucky user #endif #elif defined __CYGWIN__ diff --git a/m4/strtok_r.m4 b/m4/strtok_r.m4 --- a/m4/strtok_r.m4 +++ b/m4/strtok_r.m4 @@ -1,4 +1,4 @@ -# strtok_r.m4 serial 11 +# strtok_r.m4 serial 12 dnl Copyright (C) 2002-2004, 2006-2007, 2009-2010 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -16,7 +16,7 @@ if test $ac_cv_func_strtok_r = yes; then dnl glibc 2.7 has a bug in strtok_r that causes a segmentation fault dnl when the second argument to strtok_r is a constant string that has - dnl exactly one byte and compiling with optimization.  This bug is, for + dnl exactly one byte and compiling with optimization. This bug is, for dnl example, present in the glibc 2.7-18 package in Debian "lenny". dnl See . AC_CACHE_CHECK([whether strtok_r works], [gl_cv_func_strtok_r_works], @@ -32,10 +32,10 @@ ]], [[static const char dummy[] = "\177\01a"; char delimiters[] = "xxxxxxxx"; -             char *save_ptr = (char *) dummy; -             strtok_r (delimiters, "x", &save_ptr); -             strtok_r (NULL, "x", &save_ptr); -             return 0; + char *save_ptr = (char *) dummy; + strtok_r (delimiters, "x", &save_ptr); + strtok_r (NULL, "x", &save_ptr); + return 0; ]]) ], [gl_cv_func_strtok_r_works=yes], diff --git a/m4/sys_socket_h.m4 b/m4/sys_socket_h.m4 --- a/m4/sys_socket_h.m4 +++ b/m4/sys_socket_h.m4 @@ -1,4 +1,4 @@ -# sys_socket_h.m4 serial 20 +# sys_socket_h.m4 serial 21 dnl Copyright (C) 2005-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, @@ -9,8 +9,20 @@ 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 is self-contained], [gl_cv_header_sys_socket_h_selfcontained], [ diff --git a/m4/tcgetsid.m4 b/m4/tcgetsid.m4 --- a/m4/tcgetsid.m4 +++ b/m4/tcgetsid.m4 @@ -1,4 +1,4 @@ -# tcgetsid.m4 serial 1 +# tcgetsid.m4 serial 2 dnl Copyright (C) 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, @@ -11,9 +11,13 @@ dnl Persuade glibc to declare tcgetsid(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_DECLS_ONCE([tcgetsid]) + if test $ac_cv_have_decl_tcgetsid = no; then + HAVE_DECL_TCGETSID=0 + fi + AC_CHECK_FUNCS([tcgetsid]) if test $ac_cv_func_tcgetsid = no; then - HAVE_TCGETSID=0 AC_LIBOBJ([tcgetsid]) gl_PREREQ_TCGETSID fi diff --git a/m4/termios_h.m4 b/m4/termios_h.m4 --- a/m4/termios_h.m4 +++ b/m4/termios_h.m4 @@ -1,4 +1,4 @@ -# termios_h.m4 serial 1 +# termios_h.m4 serial 2 dnl Copyright (C) 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, @@ -37,6 +37,6 @@ [ GNULIB_TCGETSID=0; AC_SUBST([GNULIB_TCGETSID]) dnl Assume proper GNU behavior unless another module says otherwise. - HAVE_TCGETSID=1; AC_SUBST([HAVE_TCGETSID]) + HAVE_DECL_TCGETSID=1; AC_SUBST([HAVE_DECL_TCGETSID]) HAVE_TERMIOS_H=1; AC_SUBST([HAVE_TERMIOS_H]) ]) diff --git a/m4/trunc-ieee.m4 b/m4/trunc-ieee.m4 new file mode 100644 --- /dev/null +++ b/m4/trunc-ieee.m4 @@ -0,0 +1,15 @@ +# trunc-ieee.m4 serial 1 +dnl Copyright (C) 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 This macro is in a separate file (not in trunc.m4 and not inlined in the +dnl module description), so that gl_FUNC_TRUNC can test whether 'aclocal' has +dnl found uses of this macro. + +AC_DEFUN([gl_FUNC_TRUNC_IEEE], +[ + m4_divert_text([INIT_PREPARE], [gl_trunc_required=ieee]) + AC_REQUIRE([gl_FUNC_TRUNC]) +]) diff --git a/m4/trunc.m4 b/m4/trunc.m4 --- a/m4/trunc.m4 +++ b/m4/trunc.m4 @@ -1,4 +1,4 @@ -# trunc.m4 serial 4 +# trunc.m4 serial 5 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, @@ -6,6 +6,7 @@ AC_DEFUN([gl_FUNC_TRUNC], [ + m4_divert_text([DEFAULTS], [gl_trunc_required=plain]) AC_REQUIRE([gl_MATH_H_DEFAULTS]) dnl Persuade glibc to declare trunc(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) @@ -40,8 +41,44 @@ if test "$TRUNC_LIBM" = "?"; then TRUNC_LIBM= fi + m4_ifdef([gl_FUNC_TRUNC_IEEE], [ + if test $gl_trunc_required = ieee && test $REPLACE_TRUNC = 0; then + AC_CACHE_CHECK([whether trunc works according to ISO C 99 with IEC 60559], + [gl_cv_func_trunc_ieee], + [ + save_LIBS="$LIBS" + LIBS="$LIBS $TRUNC_LIBM" + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#ifndef __NO_MATH_INLINES +# define __NO_MATH_INLINES 1 /* for glibc */ +#endif +#include +]gl_DOUBLE_MINUS_ZERO_CODE[ +]gl_DOUBLE_SIGNBIT_CODE[ +int main() +{ + /* Test whether trunc (-0.0) is -0.0. */ + if (signbitd (minus_zerod) && !signbitd (trunc (minus_zerod))) + return 1; + return 0; +} + ]])], + [gl_cv_func_trunc_ieee=yes], + [gl_cv_func_trunc_ieee=no], + [gl_cv_func_trunc_ieee="guessing no"]) + LIBS="$save_LIBS" + ]) + case "$gl_cv_func_trunc_ieee" in + *yes) ;; + *) REPLACE_TRUNC=1 ;; + esac + fi + ]) else HAVE_DECL_TRUNC=0 + fi + if test $HAVE_DECL_TRUNC = 0 || test $REPLACE_TRUNC = 1; then AC_LIBOBJ([trunc]) TRUNC_LIBM= fi diff --git a/m4/truncf-ieee.m4 b/m4/truncf-ieee.m4 new file mode 100644 --- /dev/null +++ b/m4/truncf-ieee.m4 @@ -0,0 +1,15 @@ +# truncf-ieee.m4 serial 1 +dnl Copyright (C) 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 This macro is in a separate file (not in truncf.m4 and not inlined in the +dnl module description), so that gl_FUNC_TRUNCF can test whether 'aclocal' has +dnl found uses of this macro. + +AC_DEFUN([gl_FUNC_TRUNCF_IEEE], +[ + m4_divert_text([INIT_PREPARE], [gl_truncf_required=ieee]) + AC_REQUIRE([gl_FUNC_TRUNCF]) +]) diff --git a/m4/truncf.m4 b/m4/truncf.m4 --- a/m4/truncf.m4 +++ b/m4/truncf.m4 @@ -1,4 +1,4 @@ -# truncf.m4 serial 3 +# truncf.m4 serial 4 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, @@ -6,6 +6,7 @@ AC_DEFUN([gl_FUNC_TRUNCF], [ + m4_divert_text([DEFAULTS], [gl_truncf_required=plain]) AC_REQUIRE([gl_MATH_H_DEFAULTS]) dnl Persuade glibc to declare truncf(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) @@ -40,8 +41,44 @@ if test "$TRUNCF_LIBM" = "?"; then TRUNCF_LIBM= fi + m4_ifdef([gl_FUNC_TRUNCF_IEEE], [ + if test $gl_truncf_required = ieee && test $REPLACE_TRUNCF = 0; then + AC_CACHE_CHECK([whether truncf works according to ISO C 99 with IEC 60559], + [gl_cv_func_truncf_ieee], + [ + save_LIBS="$LIBS" + LIBS="$LIBS $TRUNCF_LIBM" + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#ifndef __NO_MATH_INLINES +# define __NO_MATH_INLINES 1 /* for glibc */ +#endif +#include +]gl_FLOAT_MINUS_ZERO_CODE[ +]gl_FLOAT_SIGNBIT_CODE[ +int main() +{ + /* Test whether truncf (-0.0f) is -0.0f. */ + if (signbitf (minus_zerof) && !signbitf (truncf (minus_zerof))) + return 1; + return 0; +} + ]])], + [gl_cv_func_truncf_ieee=yes], + [gl_cv_func_truncf_ieee=no], + [gl_cv_func_truncf_ieee="guessing no"]) + LIBS="$save_LIBS" + ]) + case "$gl_cv_func_truncf_ieee" in + *yes) ;; + *) REPLACE_TRUNCF=1 ;; + esac + fi + ]) else HAVE_DECL_TRUNCF=0 + fi + if test $HAVE_DECL_TRUNCF = 0 || test $REPLACE_TRUNCF = 1; then AC_LIBOBJ([truncf]) TRUNCF_LIBM= fi diff --git a/m4/truncl-ieee.m4 b/m4/truncl-ieee.m4 new file mode 100644 --- /dev/null +++ b/m4/truncl-ieee.m4 @@ -0,0 +1,15 @@ +# truncl-ieee.m4 serial 1 +dnl Copyright (C) 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 This macro is in a separate file (not in truncl.m4 and not inlined in the +dnl module description), so that gl_FUNC_TRUNCL can test whether 'aclocal' has +dnl found uses of this macro. + +AC_DEFUN([gl_FUNC_TRUNCL_IEEE], +[ + m4_divert_text([INIT_PREPARE], [gl_truncl_required=ieee]) + AC_REQUIRE([gl_FUNC_TRUNCL]) +]) diff --git a/m4/truncl.m4 b/m4/truncl.m4 --- a/m4/truncl.m4 +++ b/m4/truncl.m4 @@ -1,4 +1,4 @@ -# truncl.m4 serial 5 +# truncl.m4 serial 6 dnl Copyright (C) 2007-2008, 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -6,6 +6,7 @@ AC_DEFUN([gl_FUNC_TRUNCL], [ + m4_divert_text([DEFAULTS], [gl_truncl_required=plain]) AC_REQUIRE([gl_MATH_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Persuade glibc to declare truncl(). @@ -68,6 +69,40 @@ *yes) ;; *) REPLACE_TRUNCL=1 ;; esac + m4_ifdef([gl_FUNC_TRUNCL_IEEE], [ + if test $gl_truncl_required = ieee && test $REPLACE_TRUNCL = 0; then + AC_CACHE_CHECK([whether truncl works according to ISO C 99 with IEC 60559], + [gl_cv_func_truncl_ieee], + [ + save_LIBS="$LIBS" + LIBS="$LIBS $TRUNCL_LIBM" + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#ifndef __NO_MATH_INLINES +# define __NO_MATH_INLINES 1 /* for glibc */ +#endif +#include +]gl_LONG_DOUBLE_MINUS_ZERO_CODE[ +]gl_LONG_DOUBLE_SIGNBIT_CODE[ +int main() +{ + /* Test whether truncl (-0.3L) is -0.0L. */ + if (signbitl (minus_zerol) && !signbitl (truncl (-0.3L))) + return 1; + return 0; +} + ]])], + [gl_cv_func_truncl_ieee=yes], + [gl_cv_func_truncl_ieee=no], + [gl_cv_func_truncl_ieee="guessing no"]) + LIBS="$save_LIBS" + ]) + case "$gl_cv_func_truncl_ieee" in + *yes) ;; + *) REPLACE_TRUNCL=1 ;; + esac + fi + ]) else HAVE_DECL_TRUNCL=0 fi diff --git a/m4/ttyname_r.m4 b/m4/ttyname_r.m4 --- a/m4/ttyname_r.m4 +++ b/m4/ttyname_r.m4 @@ -1,4 +1,4 @@ -# ttyname_r.m4 serial 5 +# ttyname_r.m4 serial 7 dnl Copyright (C) 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, @@ -12,10 +12,16 @@ dnl ttyname_r(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_DECLS_ONCE([ttyname_r]) + if test $ac_cv_have_decl_ttyname_r = no; then + HAVE_DECL_TTYNAME_R=0 + fi + AC_CHECK_FUNCS([ttyname_r]) if test $ac_cv_func_ttyname_r = no; then HAVE_TTYNAME_R=0 else + HAVE_TTYNAME_R=1 dnl On MacOS X 10.4 (and Solaris 10 without gl_USE_SYSTEM_EXTENSIONS) dnl the return type is 'char *', not 'int'. AC_CACHE_CHECK([whether ttyname_r is compatible with its POSIX signature], @@ -37,6 +43,8 @@ dnl On Solaris 10, both ttyname_r functions (the one with the non-POSIX dnl declaration and the one with the POSIX declaration) refuse to do dnl anything when the output buffer is less than 128 bytes large. + dnl On OSF/1 5.1, ttyname_r ignores the buffer size and assumes the + dnl buffer is large enough. AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether ttyname_r works with small buffers], [gl_cv_func_ttyname_r_works], @@ -47,6 +55,8 @@ case "$host_os" in # Guess no on Solaris. solaris*) gl_cv_func_ttyname_r_works="guessing no" ;; + # Guess no on OSF/1. + osf*) gl_cv_func_ttyname_r_works="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_ttyname_r_works="guessing yes" ;; esac @@ -64,13 +74,17 @@ fd = open ("/dev/tty", O_RDONLY); if (fd < 0) - result |= 1; + result |= 16; else if (ttyname_r (fd, buf, sizeof (buf)) != 0) - result |= 2; + result |= 17; + else if (ttyname_r (fd, buf, 1) == 0) + result |= 18; return result; }]])], [gl_cv_func_ttyname_r_works=yes], - [:], + [case $? in + 17 | 18) gl_cv_func_ttyname_r_works=no ;; + esac], [:]) ]) case "$gl_cv_func_ttyname_r_works" in diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4 --- a/m4/unistd_h.m4 +++ b/m4/unistd_h.m4 @@ -1,4 +1,4 @@ -# unistd_h.m4 serial 49 +# unistd_h.m4 serial 52 dnl Copyright (C) 2006-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, @@ -122,14 +122,15 @@ 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]) @@ -139,6 +140,7 @@ 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/m4/utimes.m4 b/m4/utimes.m4 --- a/m4/utimes.m4 +++ b/m4/utimes.m4 @@ -34,15 +34,21 @@ #include #include +static int +inorder (time_t a, time_t b, time_t c) +{ + return a <= b && b <= c; +} + int main () { int result = 0; char const *file = "conftest.utimes"; + static struct timeval timeval[2] = {{9, 10}, {999999, 999999}}; /* Test whether utimes() essentially works. */ { - static struct timeval timeval[2] = {{9, 10}, {999999, 999999}}; struct stat sbuf; FILE *f = fopen (file, "w"); if (f == NULL) @@ -56,37 +62,52 @@ else if (!(sbuf.st_atime == timeval[0].tv_sec && sbuf.st_mtime == timeval[1].tv_sec)) result |= 4; - unlink (file); + if (unlink (file) != 0) + result |= 1; } /* Test whether utimes() with a NULL argument sets the file's timestamp - to the current time. Note that this test fails on NFS file systems + to the current time. Use 'fstat' as well as 'time' to + determine the "current" time, to accommodate NFS file systems if there is a time skew between the host and the NFS server. */ { - struct stat sbuf; - FILE *f = fopen (file, "w"); - if (f == NULL) - result |= 1; - else if (fclose (f) != 0) + int fd = open (file, O_WRONLY|O_CREAT, 0644); + if (fd < 0) result |= 1; else { - time_t now; - if (time (&now) == (time_t)-1) + time_t t0, t2; + struct stat st0, st1, st2; + if (time (&t0) == (time_t) -1) result |= 1; + else if (fstat (fd, &st0) != 0) + result |= 1; + else if (utimes (file, timeval) != 0) + result |= 2; else if (utimes (file, NULL) != 0) result |= 8; - else if (lstat (file, &sbuf) != 0) + else if (fstat (fd, &st1) != 0) + result |= 1; + else if (write (fd, "\n", 1) != 1) + result |= 1; + else if (fstat (fd, &st2) != 0) + result |= 1; + else if (time (&t2) == (time_t) -1) result |= 1; else { - if (!(now - sbuf.st_atime <= 2)) + int m_ok_POSIX = inorder (t0, st1.st_mtime, t2); + int m_ok_NFS = inorder (st0.st_mtime, st1.st_mtime, st2.st_mtime); + if (! (st1.st_atime == st1.st_mtime)) result |= 16; - if (!(now - sbuf.st_mtime <= 2)) + if (! (m_ok_POSIX || m_ok_NFS)) result |= 32; } + if (close (fd) != 0) + result |= 1; } - unlink (file); + if (unlink (file) != 0) + result |= 1; } /* Test whether utimes() with a NULL argument works on read-only files. */ @@ -98,7 +119,8 @@ result |= 1; else if (utimes (file, NULL) != 0) result |= 64; - unlink (file); + if (unlink (file) != 0) + result |= 1; } return result; diff --git a/m4/vsnprintf.m4 b/m4/vsnprintf.m4 --- a/m4/vsnprintf.m4 +++ b/m4/vsnprintf.m4 @@ -13,7 +13,12 @@ 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/m4/wchar_h.m4 b/m4/wchar_h.m4 --- a/m4/wchar_h.m4 +++ b/m4/wchar_h.m4 @@ -7,7 +7,7 @@ dnl Written by Eric Blake. -# wchar_h.m4 serial 35 +# wchar_h.m4 serial 36 AC_DEFUN([gl_WCHAR_H], [ @@ -39,7 +39,10 @@ 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. */ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ #if !(defined __GLIBC__ && !defined __UCLIBC__) # include # include @@ -63,6 +66,13 @@ [gl_cv_header_wchar_h_correct_inline=yes AC_LANG_CONFTEST([ AC_LANG_SOURCE([[#define wcstod renamed_wcstod +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include #include extern int zero (void); int main () { return zero(); } @@ -71,6 +81,13 @@ mv conftest.$ac_objext conftest1.$ac_objext AC_LANG_CONFTEST([ AC_LANG_SOURCE([[#define wcstod renamed_wcstod +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include #include int zero (void) { return 0; } ]])]) diff --git a/m4/wcrtomb.m4 b/m4/wcrtomb.m4 --- a/m4/wcrtomb.m4 +++ b/m4/wcrtomb.m4 @@ -1,4 +1,4 @@ -# wcrtomb.m4 serial 7 +# wcrtomb.m4 serial 8 dnl Copyright (C) 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -43,8 +43,14 @@ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include #include -#include +#include #include int main () { diff --git a/m4/wcsrtombs.m4 b/m4/wcsrtombs.m4 --- a/m4/wcsrtombs.m4 +++ b/m4/wcsrtombs.m4 @@ -1,4 +1,4 @@ -# wcsrtombs.m4 serial 6 +# wcsrtombs.m4 serial 7 dnl Copyright (C) 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -72,6 +72,13 @@ [AC_LANG_SOURCE([[ #include #include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include #include int main () { @@ -127,6 +134,13 @@ [AC_LANG_SOURCE([[ #include #include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include #include int main () { diff --git a/m4/wctob.m4 b/m4/wctob.m4 --- a/m4/wctob.m4 +++ b/m4/wctob.m4 @@ -1,4 +1,4 @@ -# wctob.m4 serial 6 +# wctob.m4 serial 7 dnl Copyright (C) 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -41,6 +41,13 @@ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include #include register long global __asm__ ("%ebx"); @@ -66,6 +73,13 @@ [AC_LANG_SOURCE([[ #include #include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include #include int main () { diff --git a/m4/wctype_h.m4 b/m4/wctype_h.m4 --- a/m4/wctype_h.m4 +++ b/m4/wctype_h.m4 @@ -1,4 +1,4 @@ -# wctype_h.m4 serial 8 +# wctype_h.m4 serial 10 dnl A placeholder for ISO C99 , for platforms that lack it. @@ -53,13 +53,19 @@ dnl The other functions are likely broken in the same way. AC_CACHE_CHECK([whether iswcntrl works], [gl_cv_func_iswcntrl_works], [ - AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include - #include - #include - #include - #include - int main () { return iswprint ('x') == 0; }]])], + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ + /* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #include + int main () { return iswprint ('x') == 0; } + ]])], [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #if __GNU_LIBRARY__ == 1 @@ -82,4 +88,14 @@ REPLACE_ISWCNTRL=0 fi AC_SUBST([REPLACE_ISWCNTRL]) + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + dnl Redefine all of iswcntrl, ..., towupper in . + : + else + if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then + dnl Redefine only iswblank. + AC_LIBOBJ([iswblank]) + fi + fi ]) diff --git a/modules/arpa_inet b/modules/arpa_inet --- a/modules/arpa_inet +++ b/modules/arpa_inet @@ -7,6 +7,7 @@ Depends-on: arg-nonnull +c++defs include_next sys_socket warn-on-use @@ -22,7 +23,7 @@ # We need the following in order to create 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! */'; \ @@ -36,6 +37,7 @@ -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; \ diff --git a/modules/arpa_inet-c++-tests b/modules/arpa_inet-c++-tests new file mode 100644 --- /dev/null +++ b/modules/arpa_inet-c++-tests @@ -0,0 +1,19 @@ +Files: +tests/test-arpa_inet-c++.cc +tests/signature.h + +Status: +c++-test + +Depends-on: +ansi-c++-opt + +configure.ac: + +Makefile.am: +if ANSICXX +TESTS += test-arpa_inet-c++ +check_PROGRAMS += test-arpa_inet-c++ +test_arpa_inet_c___SOURCES = test-arpa_inet-c++.cc +test_arpa_inet_c___LDADD = $(LDADD) $(INET_NTOP_LIB) $(INET_PTON_LIB) $(LIBSOCKET) +endif diff --git a/modules/arpa_inet-tests b/modules/arpa_inet-tests --- a/modules/arpa_inet-tests +++ b/modules/arpa_inet-tests @@ -2,6 +2,7 @@ tests/test-arpa_inet.c Depends-on: +arpa_inet-c++-tests configure.ac: diff --git a/modules/ceil b/modules/ceil --- a/modules/ceil +++ b/modules/ceil @@ -2,13 +2,16 @@ ceil() function: round towards positive infinity. Files: +lib/ceil.c m4/ceil.m4 Depends-on: math +float configure.ac: gl_FUNC_CEIL +gl_MATH_MODULE_INDICATOR([ceil]) Makefile.am: diff --git a/modules/ceil-ieee b/modules/ceil-ieee new file mode 100644 --- /dev/null +++ b/modules/ceil-ieee @@ -0,0 +1,27 @@ +Description: +ceil() function according to ISO C 99 with IEC 60559. + +Files: +m4/ceil-ieee.m4 +m4/minus-zero.m4 +m4/signbit.m4 + +Depends-on: +ceil + +configure.ac: +gl_FUNC_CEIL_IEEE + +Makefile.am: + +Include: + + +Link: +$(CEIL_LIBM) + +License: +LGPL + +Maintainer: +Bruno Haible diff --git a/modules/ceil-ieee-tests b/modules/ceil-ieee-tests new file mode 100644 --- /dev/null +++ b/modules/ceil-ieee-tests @@ -0,0 +1,15 @@ +Files: +tests/test-ceil-ieee.c +tests/minus-zero.h +tests/macros.h + +Depends-on: +float +signbit + +configure.ac: + +Makefile.am: +TESTS += test-ceil-ieee +check_PROGRAMS += test-ceil-ieee +test_ceil_ieee_LDADD = $(LDADD) @FLOOR_LIBM@ diff --git a/modules/ceil-tests b/modules/ceil-tests new file mode 100644 --- /dev/null +++ b/modules/ceil-tests @@ -0,0 +1,21 @@ +Files: +tests/test-ceil1.c +tests/test-ceil2.c +tests/minus-zero.h +tests/nan.h +tests/signature.h +tests/macros.h + +Depends-on: +float +isnand-nolibm +stdbool +stdint + +configure.ac: + +Makefile.am: +TESTS += test-ceil1 test-ceil2 +check_PROGRAMS += test-ceil1 test-ceil2 +test_ceil1_LDADD = $(LDADD) @CEIL_LIBM@ +test_ceil2_LDADD = $(LDADD) @CEIL_LIBM@ diff --git a/modules/ceilf-ieee b/modules/ceilf-ieee new file mode 100644 --- /dev/null +++ b/modules/ceilf-ieee @@ -0,0 +1,27 @@ +Description: +ceilf() function according to ISO C 99 with IEC 60559. + +Files: +m4/ceilf-ieee.m4 +m4/minus-zero.m4 +m4/signbit.m4 + +Depends-on: +ceilf + +configure.ac: +gl_FUNC_CEILF_IEEE + +Makefile.am: + +Include: + + +Link: +$(CEILF_LIBM) + +License: +LGPL + +Maintainer: +Bruno Haible diff --git a/modules/ceilf-ieee-tests b/modules/ceilf-ieee-tests new file mode 100644 --- /dev/null +++ b/modules/ceilf-ieee-tests @@ -0,0 +1,15 @@ +Files: +tests/test-ceilf-ieee.c +tests/minus-zero.h +tests/macros.h + +Depends-on: +float +signbit + +configure.ac: + +Makefile.am: +TESTS += test-ceilf-ieee +check_PROGRAMS += test-ceilf-ieee +test_ceilf_ieee_LDADD = $(LDADD) @CEILF_LIBM@ diff --git a/modules/ceilf-tests b/modules/ceilf-tests --- a/modules/ceilf-tests +++ b/modules/ceilf-tests @@ -9,7 +9,6 @@ Depends-on: float isnanf-nolibm -signbit stdbool stdint diff --git a/modules/ceill-ieee b/modules/ceill-ieee new file mode 100644 --- /dev/null +++ b/modules/ceill-ieee @@ -0,0 +1,27 @@ +Description: +ceill() function according to ISO C 99 with IEC 60559. + +Files: +m4/ceill-ieee.m4 +m4/minus-zero.m4 +m4/signbit.m4 + +Depends-on: +ceill + +configure.ac: +gl_FUNC_CEILL_IEEE + +Makefile.am: + +Include: + + +Link: +$(CEILL_LIBM) + +License: +LGPL + +Maintainer: +Bruno Haible diff --git a/modules/ceill-ieee-tests b/modules/ceill-ieee-tests new file mode 100644 --- /dev/null +++ b/modules/ceill-ieee-tests @@ -0,0 +1,16 @@ +Files: +tests/test-ceill-ieee.c +tests/minus-zero.h +tests/macros.h + +Depends-on: +fpucw +float +signbit + +configure.ac: + +Makefile.am: +TESTS += test-ceill-ieee +check_PROGRAMS += test-ceill-ieee +test_ceill_ieee_LDADD = $(LDADD) @CEILL_LIBM@ diff --git a/modules/ceill-tests b/modules/ceill-tests --- a/modules/ceill-tests +++ b/modules/ceill-tests @@ -9,7 +9,6 @@ fpucw isnanl-nolibm float -signbit configure.ac: diff --git a/modules/configmake b/modules/configmake --- a/modules/configmake +++ b/modules/configmake @@ -2,10 +2,12 @@ Variables set by "configure" or "make". Files: +m4/configmake.m4 Depends-on: configure.ac: +gl_CONFIGMAKE_PREP Makefile.am: # Retrieve values of the variables through 'configure' followed by @@ -22,7 +24,8 @@ # # Another advantage is that 'make' output is shorter. # -# Listed in the same order as the GNU makefile conventions. +# Listed in the same order as the GNU makefile conventions, and +# provided by autoconf 2.59c+. # The Automake-defined pkg* macros are appended, in the order # listed in the Automake 1.10a+ documentation. configmake.h: Makefile diff --git a/modules/fcntl-h-c++-tests b/modules/fcntl-h-c++-tests --- a/modules/fcntl-h-c++-tests +++ b/modules/fcntl-h-c++-tests @@ -15,5 +15,5 @@ TESTS += test-fcntl-h-c++ check_PROGRAMS += test-fcntl-h-c++ test_fcntl_h_c___SOURCES = test-fcntl-h-c++.cc -test_fcntl_h_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_CLOCK_GETTIME) $(LIBSOCKET) +test_fcntl_h_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS) $(LIBSOCKET) endif diff --git a/modules/floor b/modules/floor --- a/modules/floor +++ b/modules/floor @@ -2,13 +2,16 @@ floor() function: round towards negative infinity. Files: +lib/floor.c m4/floor.m4 Depends-on: math +float configure.ac: gl_FUNC_FLOOR +gl_MATH_MODULE_INDICATOR([floor]) Makefile.am: diff --git a/modules/floor-ieee b/modules/floor-ieee new file mode 100644 --- /dev/null +++ b/modules/floor-ieee @@ -0,0 +1,27 @@ +Description: +floor() function according to ISO C 99 with IEC 60559. + +Files: +m4/floor-ieee.m4 +m4/minus-zero.m4 +m4/signbit.m4 + +Depends-on: +floor + +configure.ac: +gl_FUNC_FLOOR_IEEE + +Makefile.am: + +Include: + + +Link: +$(FLOOR_LIBM) + +License: +LGPL + +Maintainer: +Bruno Haible diff --git a/modules/floor-ieee-tests b/modules/floor-ieee-tests new file mode 100644 --- /dev/null +++ b/modules/floor-ieee-tests @@ -0,0 +1,15 @@ +Files: +tests/test-floor-ieee.c +tests/minus-zero.h +tests/macros.h + +Depends-on: +float +signbit + +configure.ac: + +Makefile.am: +TESTS += test-floor-ieee +check_PROGRAMS += test-floor-ieee +test_floor_ieee_LDADD = $(LDADD) @FLOOR_LIBM@ diff --git a/modules/floor-tests b/modules/floor-tests new file mode 100644 --- /dev/null +++ b/modules/floor-tests @@ -0,0 +1,21 @@ +Files: +tests/test-floor1.c +tests/test-floor2.c +tests/minus-zero.h +tests/nan.h +tests/signature.h +tests/macros.h + +Depends-on: +float +isnand-nolibm +stdbool +stdint + +configure.ac: + +Makefile.am: +TESTS += test-floor1 test-floor2 +check_PROGRAMS += test-floor1 test-floor2 +test_floor1_LDADD = $(LDADD) @FLOOR_LIBM@ +test_floor2_LDADD = $(LDADD) @FLOOR_LIBM@ diff --git a/modules/floorf-ieee b/modules/floorf-ieee new file mode 100644 --- /dev/null +++ b/modules/floorf-ieee @@ -0,0 +1,27 @@ +Description: +floorf() function according to ISO C 99 with IEC 60559. + +Files: +m4/floorf-ieee.m4 +m4/minus-zero.m4 +m4/signbit.m4 + +Depends-on: +floorf + +configure.ac: +gl_FUNC_FLOORF_IEEE + +Makefile.am: + +Include: + + +Link: +$(FLOORF_LIBM) + +License: +LGPL + +Maintainer: +Bruno Haible diff --git a/modules/floorf-ieee-tests b/modules/floorf-ieee-tests new file mode 100644 --- /dev/null +++ b/modules/floorf-ieee-tests @@ -0,0 +1,15 @@ +Files: +tests/test-floorf-ieee.c +tests/minus-zero.h +tests/macros.h + +Depends-on: +float +signbit + +configure.ac: + +Makefile.am: +TESTS += test-floorf-ieee +check_PROGRAMS += test-floorf-ieee +test_floorf_ieee_LDADD = $(LDADD) @FLOORF_LIBM@ diff --git a/modules/floorf-tests b/modules/floorf-tests --- a/modules/floorf-tests +++ b/modules/floorf-tests @@ -9,7 +9,6 @@ Depends-on: float isnanf-nolibm -signbit stdbool stdint diff --git a/modules/floorl-ieee b/modules/floorl-ieee new file mode 100644 --- /dev/null +++ b/modules/floorl-ieee @@ -0,0 +1,23 @@ +Description: +floorl() function according to ISO C 99 with IEC 60559. + +Files: + +Depends-on: +floorl + +configure.ac: + +Makefile.am: + +Include: + + +Link: +$(FLOORL_LIBM) + +License: +LGPL + +Maintainer: +Bruno Haible diff --git a/modules/floorl-ieee-tests b/modules/floorl-ieee-tests new file mode 100644 --- /dev/null +++ b/modules/floorl-ieee-tests @@ -0,0 +1,16 @@ +Files: +tests/test-floorl-ieee.c +tests/minus-zero.h +tests/macros.h + +Depends-on: +fpucw +float +signbit + +configure.ac: + +Makefile.am: +TESTS += test-floorl-ieee +check_PROGRAMS += test-floorl-ieee +test_floorl_ieee_LDADD = $(LDADD) @FLOORL_LIBM@ diff --git a/modules/floorl-tests b/modules/floorl-tests --- a/modules/floorl-tests +++ b/modules/floorl-tests @@ -9,7 +9,6 @@ fpucw isnanl-nolibm float -signbit configure.ac: diff --git a/modules/getlogin_r b/modules/getlogin_r --- a/modules/getlogin_r +++ b/modules/getlogin_r @@ -8,6 +8,7 @@ Depends-on: extensions unistd +memchr configure.ac: gl_FUNC_GETLOGIN_R diff --git a/modules/iconv b/modules/iconv --- a/modules/iconv +++ b/modules/iconv @@ -9,7 +9,8 @@ configure.ac: AM_ICONV -gl_ICONV_MODULE_INDICATOR([iconv]) +m4_ifdef([gl_ICONV_MODULE_INDICATOR], + [gl_ICONV_MODULE_INDICATOR([iconv])]) Makefile.am: diff --git a/modules/ldexpl-tests b/modules/ldexpl-tests --- a/modules/ldexpl-tests +++ b/modules/ldexpl-tests @@ -16,3 +16,4 @@ Makefile.am: TESTS += test-ldexpl check_PROGRAMS += test-ldexpl +test_ldexpl_LDADD = $(LDADD) @LDEXPL_LIBM@ diff --git a/modules/math b/modules/math --- a/modules/math +++ b/modules/math @@ -31,10 +31,12 @@ -e 's|@''GNULIB_ACOSL''@|$(GNULIB_ACOSL)|g' \ -e 's|@''GNULIB_ASINL''@|$(GNULIB_ASINL)|g' \ -e 's|@''GNULIB_ATANL''@|$(GNULIB_ATANL)|g' \ + -e 's|@''GNULIB_CEIL''@|$(GNULIB_CEIL)|g' \ -e 's|@''GNULIB_CEILF''@|$(GNULIB_CEILF)|g' \ -e 's|@''GNULIB_CEILL''@|$(GNULIB_CEILL)|g' \ -e 's|@''GNULIB_COSL''@|$(GNULIB_COSL)|g' \ -e 's|@''GNULIB_EXPL''@|$(GNULIB_EXPL)|g' \ + -e 's|@''GNULIB_FLOOR''@|$(GNULIB_FLOOR)|g' \ -e 's|@''GNULIB_FLOORF''@|$(GNULIB_FLOORF)|g' \ -e 's|@''GNULIB_FLOORL''@|$(GNULIB_FLOORL)|g' \ -e 's|@''GNULIB_FREXP''@|$(GNULIB_FREXP)|g' \ @@ -92,8 +94,10 @@ -e 's|@''HAVE_DECL_TRUNC''@|$(HAVE_DECL_TRUNC)|g' \ -e 's|@''HAVE_DECL_TRUNCF''@|$(HAVE_DECL_TRUNCF)|g' \ -e 's|@''HAVE_DECL_TRUNCL''@|$(HAVE_DECL_TRUNCL)|g' \ + -e 's|@''REPLACE_CEIL''@|$(REPLACE_CEIL)|g' \ -e 's|@''REPLACE_CEILF''@|$(REPLACE_CEILF)|g' \ -e 's|@''REPLACE_CEILL''@|$(REPLACE_CEILL)|g' \ + -e 's|@''REPLACE_FLOOR''@|$(REPLACE_FLOOR)|g' \ -e 's|@''REPLACE_FLOORF''@|$(REPLACE_FLOORF)|g' \ -e 's|@''REPLACE_FLOORL''@|$(REPLACE_FLOORL)|g' \ -e 's|@''REPLACE_FREXP''@|$(REPLACE_FREXP)|g' \ @@ -109,6 +113,8 @@ -e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \ -e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \ -e 's|@''REPLACE_SIGNBIT_USING_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \ + -e 's|@''REPLACE_TRUNC''@|$(REPLACE_TRUNC)|g' \ + -e 's|@''REPLACE_TRUNCF''@|$(REPLACE_TRUNCF)|g' \ -e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ diff --git a/modules/pipe b/modules/pipe --- a/modules/pipe +++ b/modules/pipe @@ -8,6 +8,7 @@ This module is obsolete. Use the module 'spawn-pipe' instead. Files: +lib/pipe.h Depends-on: spawn-pipe @@ -17,7 +18,6 @@ Makefile.am: Include: -"spawn-pipe.h" License: GPL diff --git a/modules/ptsname-tests b/modules/ptsname-tests --- a/modules/ptsname-tests +++ b/modules/ptsname-tests @@ -4,6 +4,7 @@ tests/macros.h Depends-on: +same-inode configure.ac: diff --git a/modules/relocatable-prog b/modules/relocatable-prog --- a/modules/relocatable-prog +++ b/modules/relocatable-prog @@ -29,6 +29,20 @@ Makefile.am: DEFS += -DEXEEXT=\"@EXEEXT@\" +if RELOCATABLE_VIA_WRAPPER +uninstall-hook: uninstall-relocwrapper +uninstall-relocwrapper: + if test $(RELOCATABLE) = yes; then \ + case '$(EXEEXT)' in \ + .bin*) ;; \ + *) cd $(top_builddir) && \ + $(MAKE) $(AM_MAKEFLAGS) EXEEXT=.bin$(EXEEXT) \ + AM_MAKEFLAGS='$(AM_MAKEFLAGS) EXEEXT=.bin$(EXEEXT)' \ + uninstall ;; \ + esac; \ + fi +.PHONY: uninstall-relocwrapper +endif Include: "relocatable.h" diff --git a/modules/relocatable-prog-wrapper b/modules/relocatable-prog-wrapper --- a/modules/relocatable-prog-wrapper +++ b/modules/relocatable-prog-wrapper @@ -53,20 +53,6 @@ gl_FUNC_STRERROR_SEPARATE Makefile.am: -if RELOCATABLE_VIA_WRAPPER -uninstall-hook: uninstall-relocwrapper -uninstall-relocwrapper: - if test $(RELOCATABLE) = yes; then \ - case '$(EXEEXT)' in \ - .bin*) ;; \ - *) cd $(top_builddir) && \ - $(MAKE) $(AM_MAKEFLAGS) EXEEXT=.bin$(EXEEXT) \ - AM_MAKEFLAGS='$(AM_MAKEFLAGS) EXEEXT=.bin$(EXEEXT)' \ - uninstall ;; \ - esac; \ - fi -.PHONY: uninstall-relocwrapper -endif Include: diff --git a/modules/round-ieee b/modules/round-ieee new file mode 100644 --- /dev/null +++ b/modules/round-ieee @@ -0,0 +1,27 @@ +Description: +round() function according to ISO C 99 with IEC 60559. + +Files: +m4/round-ieee.m4 +m4/minus-zero.m4 +m4/signbit.m4 + +Depends-on: +round + +configure.ac: +gl_FUNC_ROUND_IEEE + +Makefile.am: + +Include: + + +Link: +$(ROUND_LIBM) + +License: +LGPL + +Maintainer: +Bruno Haible diff --git a/modules/round-ieee-tests b/modules/round-ieee-tests new file mode 100644 --- /dev/null +++ b/modules/round-ieee-tests @@ -0,0 +1,15 @@ +Files: +tests/test-round-ieee.c +tests/minus-zero.h +tests/macros.h + +Depends-on: +float +signbit + +configure.ac: + +Makefile.am: +TESTS += test-round-ieee +check_PROGRAMS += test-round-ieee +test_round_ieee_LDADD = $(LDADD) @ROUND_LIBM@ diff --git a/modules/round-tests b/modules/round-tests --- a/modules/round-tests +++ b/modules/round-tests @@ -8,7 +8,6 @@ Depends-on: isnand-nolibm -signbit stdbool stdint verify diff --git a/modules/roundf-ieee b/modules/roundf-ieee new file mode 100644 --- /dev/null +++ b/modules/roundf-ieee @@ -0,0 +1,27 @@ +Description: +roundf() function according to ISO C 99 with IEC 60559. + +Files: +m4/roundf-ieee.m4 +m4/minus-zero.m4 +m4/signbit.m4 + +Depends-on: +roundf + +configure.ac: +gl_FUNC_ROUNDF_IEEE + +Makefile.am: + +Include: + + +Link: +$(ROUNDF_LIBM) + +License: +LGPL + +Maintainer: +Bruno Haible diff --git a/modules/roundf-ieee-tests b/modules/roundf-ieee-tests new file mode 100644 --- /dev/null +++ b/modules/roundf-ieee-tests @@ -0,0 +1,15 @@ +Files: +tests/test-roundf-ieee.c +tests/minus-zero.h +tests/macros.h + +Depends-on: +float +signbit + +configure.ac: + +Makefile.am: +TESTS += test-roundf-ieee +check_PROGRAMS += test-roundf-ieee +test_roundf_ieee_LDADD = $(LDADD) @ROUNDF_LIBM@ diff --git a/modules/roundf-tests b/modules/roundf-tests --- a/modules/roundf-tests +++ b/modules/roundf-tests @@ -11,7 +11,6 @@ ceilf floorf isnanf-nolibm -signbit stdbool stdint verify diff --git a/modules/roundl-ieee b/modules/roundl-ieee new file mode 100644 --- /dev/null +++ b/modules/roundl-ieee @@ -0,0 +1,29 @@ +Description: +roundl() function according to ISO C 99 with IEC 60559. + +Files: +m4/roundl-ieee.m4 +m4/minus-zero.m4 +m4/signbit.m4 + +Depends-on: +roundl +floorl-ieee +ceill-ieee + +configure.ac: +gl_FUNC_ROUNDL_IEEE + +Makefile.am: + +Include: + + +Link: +$(ROUNDL_LIBM) + +License: +LGPL + +Maintainer: +Bruno Haible diff --git a/modules/roundl-ieee-tests b/modules/roundl-ieee-tests new file mode 100644 --- /dev/null +++ b/modules/roundl-ieee-tests @@ -0,0 +1,15 @@ +Files: +tests/test-roundl-ieee.c +tests/minus-zero.h +tests/macros.h + +Depends-on: +float +signbit + +configure.ac: + +Makefile.am: +TESTS += test-roundl-ieee +check_PROGRAMS += test-roundl-ieee +test_roundl_ieee_LDADD = $(LDADD) @ROUNDL_LIBM@ diff --git a/modules/roundl-tests b/modules/roundl-tests --- a/modules/roundl-tests +++ b/modules/roundl-tests @@ -9,7 +9,6 @@ fpucw isnanl-nolibm float -signbit configure.ac: diff --git a/modules/select-tests b/modules/select-tests --- a/modules/select-tests +++ b/modules/select-tests @@ -11,11 +11,13 @@ stdbool netinet_in arpa_inet +unistd sys_ioctl extensions inet_pton errno perror +pipe-posix socket bind setsockopt @@ -27,7 +29,7 @@ gettimeofday configure.ac: -AC_CHECK_HEADERS_ONCE([unistd.h sys/wait.h]) +AC_CHECK_HEADERS_ONCE([sys/wait.h]) Makefile.am: TESTS += test-select test-select-in.sh test-select-out.sh diff --git a/modules/sigpipe b/modules/sigpipe --- a/modules/sigpipe +++ b/modules/sigpipe @@ -35,7 +35,7 @@ License: -LGPL +LGPLv2+ Maintainer: Bruno Haible diff --git a/modules/snprintf b/modules/snprintf --- a/modules/snprintf +++ b/modules/snprintf @@ -14,6 +14,7 @@ configure.ac: gl_FUNC_SNPRINTF gl_STDIO_MODULE_INDICATOR([snprintf]) +gl_MODULE_INDICATOR([snprintf]) Makefile.am: diff --git a/modules/stdio b/modules/stdio --- a/modules/stdio +++ b/modules/stdio @@ -75,6 +75,8 @@ -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' \ diff --git a/modules/stdio-c++-tests b/modules/stdio-c++-tests --- a/modules/stdio-c++-tests +++ b/modules/stdio-c++-tests @@ -16,5 +16,5 @@ TESTS += test-stdio-c++ check_PROGRAMS += test-stdio-c++ test_stdio_c___SOURCES = test-stdio-c++.cc test-stdio-c++2.cc -test_stdio_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) +test_stdio_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) $(LIB_EACCESS) endif diff --git a/modules/stdlib b/modules/stdlib --- a/modules/stdlib +++ b/modules/stdlib @@ -73,14 +73,14 @@ -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' \ diff --git a/modules/stdlib-c++-tests b/modules/stdlib-c++-tests --- a/modules/stdlib-c++-tests +++ b/modules/stdlib-c++-tests @@ -16,5 +16,5 @@ TESTS += test-stdlib-c++ check_PROGRAMS += test-stdlib-c++ test_stdlib_c___SOURCES = test-stdlib-c++.cc test-stdlib-c++2.cc -test_stdlib_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_CLOCK_GETTIME) +test_stdlib_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS) endif diff --git a/modules/sys_ioctl-c++-tests b/modules/sys_ioctl-c++-tests --- a/modules/sys_ioctl-c++-tests +++ b/modules/sys_ioctl-c++-tests @@ -15,5 +15,5 @@ TESTS += test-sys_ioctl-c++ check_PROGRAMS += test-sys_ioctl-c++ test_sys_ioctl_c___SOURCES = test-sys_ioctl-c++.cc -test_sys_ioctl_c___LDADD = $(LDADD) $(LIBINTL) $(LIBSOCKET) $(LIB_CLOCK_GETTIME) +test_sys_ioctl_c___LDADD = $(LDADD) $(LIBINTL) $(LIBSOCKET) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS) endif diff --git a/modules/termios b/modules/termios --- a/modules/termios +++ b/modules/termios @@ -28,7 +28,7 @@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_TERMIOS_H''@|$(NEXT_TERMIOS_H)|g' \ -e 's|@''GNULIB_TCGETSID''@|$(GNULIB_TCGETSID)|g' \ - -e 's|@''HAVE_TCGETSID''@|$(HAVE_TCGETSID)|g' \ + -e 's|@''HAVE_DECL_TCGETSID''@|$(HAVE_DECL_TCGETSID)|g' \ -e 's|@''HAVE_TERMIOS_H''@|$(HAVE_TERMIOS_H)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ diff --git a/modules/trunc-ieee b/modules/trunc-ieee new file mode 100644 --- /dev/null +++ b/modules/trunc-ieee @@ -0,0 +1,27 @@ +Description: +trunc() function according to ISO C 99 with IEC 60559. + +Files: +m4/trunc-ieee.m4 +m4/minus-zero.m4 +m4/signbit.m4 + +Depends-on: +trunc + +configure.ac: +gl_FUNC_TRUNC_IEEE + +Makefile.am: + +Include: + + +Link: +$(TRUNC_LIBM) + +License: +LGPL + +Maintainer: +Bruno Haible diff --git a/modules/trunc-ieee-tests b/modules/trunc-ieee-tests new file mode 100644 --- /dev/null +++ b/modules/trunc-ieee-tests @@ -0,0 +1,15 @@ +Files: +tests/test-trunc-ieee.c +tests/minus-zero.h +tests/macros.h + +Depends-on: +float +signbit + +configure.ac: + +Makefile.am: +TESTS += test-trunc-ieee +check_PROGRAMS += test-trunc-ieee +test_trunc_ieee_LDADD = $(LDADD) @TRUNC_LIBM@ diff --git a/modules/trunc-tests b/modules/trunc-tests --- a/modules/trunc-tests +++ b/modules/trunc-tests @@ -9,7 +9,6 @@ Depends-on: float isnand-nolibm -signbit stdbool stdint diff --git a/modules/truncf-ieee b/modules/truncf-ieee new file mode 100644 --- /dev/null +++ b/modules/truncf-ieee @@ -0,0 +1,27 @@ +Description: +truncf() function according to ISO C 99 with IEC 60559. + +Files: +m4/truncf-ieee.m4 +m4/minus-zero.m4 +m4/signbit.m4 + +Depends-on: +truncf + +configure.ac: +gl_FUNC_TRUNCF_IEEE + +Makefile.am: + +Include: + + +Link: +$(TRUNCF_LIBM) + +License: +LGPL + +Maintainer: +Bruno Haible diff --git a/modules/truncf-ieee-tests b/modules/truncf-ieee-tests new file mode 100644 --- /dev/null +++ b/modules/truncf-ieee-tests @@ -0,0 +1,15 @@ +Files: +tests/test-truncf-ieee.c +tests/minus-zero.h +tests/macros.h + +Depends-on: +float +signbit + +configure.ac: + +Makefile.am: +TESTS += test-truncf-ieee +check_PROGRAMS += test-truncf-ieee +test_truncf_ieee_LDADD = $(LDADD) @TRUNCF_LIBM@ diff --git a/modules/truncf-tests b/modules/truncf-tests --- a/modules/truncf-tests +++ b/modules/truncf-tests @@ -9,7 +9,6 @@ Depends-on: float isnanf-nolibm -signbit stdbool stdint diff --git a/modules/truncl-ieee b/modules/truncl-ieee new file mode 100644 --- /dev/null +++ b/modules/truncl-ieee @@ -0,0 +1,27 @@ +Description: +truncl() function according to ISO C 99 with IEC 60559. + +Files: +m4/truncl-ieee.m4 +m4/minus-zero.m4 +m4/signbit.m4 + +Depends-on: +truncl + +configure.ac: +gl_FUNC_TRUNCL_IEEE + +Makefile.am: + +Include: + + +Link: +$(TRUNCL_LIBM) + +License: +LGPL + +Maintainer: +Bruno Haible diff --git a/modules/truncl-ieee-tests b/modules/truncl-ieee-tests new file mode 100644 --- /dev/null +++ b/modules/truncl-ieee-tests @@ -0,0 +1,16 @@ +Files: +tests/test-truncl-ieee.c +tests/minus-zero.h +tests/macros.h + +Depends-on: +fpucw +float +signbit + +configure.ac: + +Makefile.am: +TESTS += test-truncl-ieee +check_PROGRAMS += test-truncl-ieee +test_truncl_ieee_LDADD = $(LDADD) @TRUNCL_LIBM@ diff --git a/modules/truncl-tests b/modules/truncl-tests --- a/modules/truncl-tests +++ b/modules/truncl-tests @@ -9,7 +9,6 @@ fpucw isnanl-nolibm float -signbit configure.ac: diff --git a/modules/unigbrk/base b/modules/unigbrk/base new file mode 100644 --- /dev/null +++ b/modules/unigbrk/base @@ -0,0 +1,33 @@ +Description: +Base layer for grapheme cluster breaking. + +Files: +lib/unigbrk.in.h +m4/libunistring-base.m4 + +Depends-on: +unitypes +stdbool + +configure.ac: +gl_LIBUNISTRING_LIBHEADER([0.9.4], [unigbrk.h]) + +Makefile.am: +BUILT_SOURCES += $(LIBUNISTRING_UNIGBRK_H) + +unigbrk.h: unigbrk.in.h + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(srcdir)/unigbrk.in.h; \ + } > $@-t && \ + mv -f $@-t $@ +MOSTLYCLEANFILES += unigbrk.h unigbrk.h-t + +Include: +"unigbrk.h" + +License: +LGPL + +Maintainer: +Ben Pfaff, Bruno Haible diff --git a/modules/unigbrk/uc-gbrk-prop b/modules/unigbrk/uc-gbrk-prop new file mode 100644 --- /dev/null +++ b/modules/unigbrk/uc-gbrk-prop @@ -0,0 +1,26 @@ +Description: +Determine a Unicode character's Grapheme_Cluster_Break property. + +Files: +lib/unigbrk/gbrkprop.h +lib/unigbrk/uc-gbrk-prop.c + +Depends-on: +unigbrk/base + +configure.ac: +gl_LIBUNISTRING_MODULE([0.9.4], [unigbrk/uc-gbrk-prop]) + +Makefile.am: +if LIBUNISTRING_COMPILE_UNIGBRK_UC_GBRK_PROP +lib_SOURCES += unigbrk/uc-gbrk-prop.c +endif + +Include: +"unigbrk.h" + +License: +LGPL + +Maintainer: +Ben Pfaff, Bruno Haible diff --git a/modules/unigbrk/uc-is-grapheme-break b/modules/unigbrk/uc-is-grapheme-break new file mode 100644 --- /dev/null +++ b/modules/unigbrk/uc-is-grapheme-break @@ -0,0 +1,26 @@ +Description: +Test for grapheme cluster breakpoints. + +Files: +lib/unigbrk/uc-is-grapheme-break.c + +Depends-on: +unigbrk/base +unigbrk/uc-gbrk-prop + +configure.ac: +gl_LIBUNISTRING_MODULE([0.9.4], [unigbrk/uc-is-grapheme-break]) + +Makefile.am: +if LIBUNISTRING_COMPILE_UNIGBRK_UC_IS_GRAPHEME_BREAK +lib_SOURCES += unigbrk/uc-is-grapheme-break.c +endif + +Include: +"unigbrk.h" + +License: +LGPL + +Maintainer: +Ben Pfaff, Bruno Haible diff --git a/modules/unigbrk/uc-is-grapheme-break-tests b/modules/unigbrk/uc-is-grapheme-break-tests new file mode 100644 --- /dev/null +++ b/modules/unigbrk/uc-is-grapheme-break-tests @@ -0,0 +1,14 @@ +Files: +tests/unigbrk/test-uc-is-grapheme-break.c +tests/unigbrk/test-uc-is-grapheme-break.sh +tests/unigbrk/GraphemeBreakTest.txt + +Depends-on: + +configure.ac: + +Makefile.am: +TESTS += unigbrk/test-uc-is-grapheme-break.sh +check_PROGRAMS += test-uc-is-grapheme-break +test_uc_is_grapheme_break_SOURCES = unigbrk/test-uc-is-grapheme-break.c +test_uc_is_grapheme_break_LDADD = $(LDADD) $(LIBUNISTRING) diff --git a/modules/unistd b/modules/unistd --- a/modules/unistd +++ b/modules/unistd @@ -98,14 +98,15 @@ -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' \ @@ -115,6 +116,7 @@ -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' \ diff --git a/modules/unistd-c++-tests b/modules/unistd-c++-tests --- a/modules/unistd-c++-tests +++ b/modules/unistd-c++-tests @@ -15,5 +15,5 @@ TESTS += test-unistd-c++ check_PROGRAMS += test-unistd-c++ test_unistd_c___SOURCES = test-unistd-c++.cc -test_unistd_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_CLOCK_GETTIME) $(LIBSOCKET) +test_unistd_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS) $(LIBSOCKET) endif diff --git a/modules/unistr/u8-mbsnlen b/modules/unistr/u8-mbsnlen --- a/modules/unistr/u8-mbsnlen +++ b/modules/unistr/u8-mbsnlen @@ -7,6 +7,7 @@ Depends-on: unistr/base unistr/u8-mbtoucr +unistr/u8-mbtouc configure.ac: gl_LIBUNISTRING_MODULE([0.9.4], [unistr/u8-mbsnlen]) diff --git a/modules/wchar-c++-tests b/modules/wchar-c++-tests --- a/modules/wchar-c++-tests +++ b/modules/wchar-c++-tests @@ -15,5 +15,5 @@ TESTS += test-wchar-c++ check_PROGRAMS += test-wchar-c++ test_wchar_c___SOURCES = test-wchar-c++.cc -test_wchar_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) +test_wchar_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) $(LIB_EACCESS) endif diff --git a/modules/wctype b/modules/wctype --- a/modules/wctype +++ b/modules/wctype @@ -3,6 +3,7 @@ Files: lib/wctype.in.h +lib/iswblank.c m4/wctype_h.m4 m4/wint_t.m4 diff --git a/modules/wctype-c++-tests b/modules/wctype-c++-tests --- a/modules/wctype-c++-tests +++ b/modules/wctype-c++-tests @@ -15,5 +15,5 @@ TESTS += test-wctype-c++ check_PROGRAMS += test-wctype-c++ test_wctype_c___SOURCES = test-wctype-c++.cc -test_wctype_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) +test_wctype_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) $(LIB_EACCESS) endif diff --git a/tests/init.sh b/tests/init.sh --- a/tests/init.sh +++ b/tests/init.sh @@ -111,7 +111,7 @@ # 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 @@ -324,6 +324,7 @@ fi initial_cwd_=$PWD + fail=0 pfx_=`testdir_prefix_` test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \ @@ -413,11 +414,10 @@ 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/tests/minus-zero.h b/tests/minus-zero.h --- a/tests/minus-zero.h +++ b/tests/minus-zero.h @@ -14,8 +14,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +/* Keep in sync with m4/minus-zero.m4! */ + #include + /* minus_zerof represents the value -0.0f. */ /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0f. @@ -51,6 +54,7 @@ double minus_zerod = -0.0; #endif + /* minus_zerol represents the value -0.0L. */ /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0L. diff --git a/tests/test-arpa_inet-c++.cc b/tests/test-arpa_inet-c++.cc new file mode 100644 --- /dev/null +++ b/tests/test-arpa_inet-c++.cc @@ -0,0 +1,41 @@ +/* Test of substitute in C++ mode. + Copyright (C) 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 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 . */ + +/* Written by Bruno Haible , 2010. */ + +#define GNULIB_NAMESPACE gnulib +#include + +#include + +#include "signature.h" + + +#if GNULIB_TEST_INET_NTOP +SIGNATURE_CHECK (GNULIB_NAMESPACE::inet_ntop, const char *, + (int, const void *, char *, socklen_t)); +#endif + +#if GNULIB_TEST_INET_PTON +SIGNATURE_CHECK (GNULIB_NAMESPACE::inet_pton, int, + (int, const char *, void *)); +#endif + + +int +main () +{ +} diff --git a/tests/test-ceil-ieee.c b/tests/test-ceil-ieee.c new file mode 100644 --- /dev/null +++ b/tests/test-ceil-ieee.c @@ -0,0 +1,43 @@ +/* Test of rounding towards positive infinity. + Copyright (C) 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 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 . */ + +#include + +#include + +#include "minus-zero.h" +#include "macros.h" + +int +main () +{ + /* See IEEE 754, section 6.3: + "the sign of the result of the round floating-point number to + integral value operation is the sign of the operand. These rules + shall apply even when operands or results are zero or infinite." */ + + /* Zero. */ + ASSERT (!signbit (ceil (0.0))); + ASSERT (!!signbit (ceil (minus_zerod)) == !!signbit (minus_zerod)); + /* Positive numbers. */ + ASSERT (!signbit (ceil (0.3))); + ASSERT (!signbit (ceil (0.7))); + /* Negative numbers. */ + ASSERT (!!signbit (ceil (-0.3)) == !!signbit (minus_zerod)); + ASSERT (!!signbit (ceil (-0.7)) == !!signbit (minus_zerod)); + + return 0; +} diff --git a/tests/test-ceil1.c b/tests/test-ceil1.c new file mode 100644 --- /dev/null +++ b/tests/test-ceil1.c @@ -0,0 +1,67 @@ +/* Test of rounding towards positive infinity. + 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 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 . */ + +/* Written by Bruno Haible , 2007. */ + +#include + +#include + +#include "signature.h" +SIGNATURE_CHECK (ceil, double, (double)); + +#include + +#include "isnand-nolibm.h" +#include "minus-zero.h" +#include "nan.h" +#include "macros.h" + +int +main () +{ + /* Zero. */ + ASSERT (ceil (0.0) == 0.0); + ASSERT (ceil (minus_zerod) == 0.0); + /* Positive numbers. */ + ASSERT (ceil (0.3) == 1.0); + ASSERT (ceil (0.7) == 1.0); + ASSERT (ceil (1.0) == 1.0); + ASSERT (ceil (1.001) == 2.0); + ASSERT (ceil (1.5) == 2.0); + ASSERT (ceil (1.999) == 2.0); + ASSERT (ceil (2.0) == 2.0); + ASSERT (ceil (65535.999) == 65536.0); + ASSERT (ceil (65536.0) == 65536.0); + ASSERT (ceil (2.341e31) == 2.341e31); + /* Negative numbers. */ + ASSERT (ceil (-0.3) == 0.0); + ASSERT (ceil (-0.7) == 0.0); + ASSERT (ceil (-1.0) == -1.0); + ASSERT (ceil (-1.5) == -1.0); + ASSERT (ceil (-1.999) == -1.0); + ASSERT (ceil (-2.0) == -2.0); + ASSERT (ceil (-65535.999) == -65535.0); + ASSERT (ceil (-65536.0) == -65536.0); + ASSERT (ceil (-2.341e31) == -2.341e31); + /* Infinite numbers. */ + ASSERT (ceil (1.0 / 0.0) == 1.0 / 0.0); + ASSERT (ceil (-1.0 / 0.0) == -1.0 / 0.0); + /* NaNs. */ + ASSERT (isnand (ceil (NaNd ()))); + + return 0; +} diff --git a/tests/test-ceil2.c b/tests/test-ceil2.c new file mode 100644 --- /dev/null +++ b/tests/test-ceil2.c @@ -0,0 +1,167 @@ +/* Test of rounding towards positive infinity. + 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 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 . */ + +/* Written by Bruno Haible , 2007. */ + +/* When this test fails on some platform, build it together with the gnulib + module 'fprintf-posix' for optimal debugging output. */ + +#include + +#include + +#include +#include +#include +#include + +#include "isnand-nolibm.h" +#include "minus-zero.h" +#include "macros.h" + + +/* The reference implementation, taken from lib/ceil.c. */ + +#define DOUBLE double +#define MANT_DIG DBL_MANT_DIG +#define L_(literal) literal + +/* -0.0. See minus-zero.h. */ +#define MINUS_ZERO minus_zerod + +/* 2^(MANT_DIG-1). */ +static const DOUBLE TWO_MANT_DIG = + /* Assume MANT_DIG <= 5 * 31. + Use the identity + n = floor(n/5) + floor((n+1)/5) + ... + floor((n+4)/5). */ + (DOUBLE) (1U << ((MANT_DIG - 1) / 5)) + * (DOUBLE) (1U << ((MANT_DIG - 1 + 1) / 5)) + * (DOUBLE) (1U << ((MANT_DIG - 1 + 2) / 5)) + * (DOUBLE) (1U << ((MANT_DIG - 1 + 3) / 5)) + * (DOUBLE) (1U << ((MANT_DIG - 1 + 4) / 5)); + +DOUBLE +ceil_reference (DOUBLE x) +{ + /* The use of 'volatile' guarantees that excess precision bits are dropped + at each addition step and before the following comparison at the caller's + site. It is necessary on x86 systems where double-floats are not IEEE + compliant by default, to avoid that the results become platform and compiler + option dependent. 'volatile' is a portable alternative to gcc's + -ffloat-store option. */ + volatile DOUBLE y = x; + volatile DOUBLE z = y; + + if (z > L_(0.0)) + { + /* Work around ICC's desire to optimize denormal floats to 0. */ + if (z < DBL_MIN) + return L_(1.0); + /* Avoid rounding errors for values near 2^k, where k >= MANT_DIG-1. */ + if (z < TWO_MANT_DIG) + { + /* Round to the next integer (nearest or up or down, doesn't matter). */ + z += TWO_MANT_DIG; + z -= TWO_MANT_DIG; + /* Enforce rounding up. */ + if (z < y) + z += L_(1.0); + } + } + else if (z < L_(0.0)) + { + /* For -1 < x < 0, return -0.0 regardless of the current rounding + mode. */ + if (z > L_(-1.0)) + z = MINUS_ZERO; + /* Avoid rounding errors for values near -2^k, where k >= MANT_DIG-1. */ + else if (z > - TWO_MANT_DIG) + { + /* Round to the next integer (nearest or up or down, doesn't matter). */ + z -= TWO_MANT_DIG; + z += TWO_MANT_DIG; + /* Enforce rounding up. */ + if (z < y) + z += L_(1.0); + } + } + return z; +} + + +/* Test for equality. */ +static int +equal (DOUBLE x, DOUBLE y) +{ + return (isnand (x) ? isnand (y) : x == y); +} + +/* Test whether the result for a given argument is correct. */ +static bool +correct_result_p (DOUBLE x, DOUBLE result) +{ + return + (x > 0 && x <= 1 ? result == L_(1.0) : + x + 1 > x ? result >= x && result <= x + 1 && result - x < 1 : + equal (result, x)); +} + +/* Test the function for a given argument. */ +static int +check (double x) +{ + /* If the reference implementation is incorrect, bail out immediately. */ + double reference = ceil_reference (x); + ASSERT (correct_result_p (x, reference)); + /* If the actual implementation is wrong, return an error code. */ + { + double result = ceil (x); + if (correct_result_p (x, result)) + return 0; + else + { +#if GNULIB_TEST_FPRINTF_POSIX + fprintf (stderr, "ceil %g(%a) = %g(%a) or %g(%a)?\n", + x, x, reference, reference, result, result); +#endif + return 1; + } + } +} + +#define NUM_HIGHBITS 12 +#define NUM_LOWBITS 4 + +int +main () +{ + unsigned int highbits; + unsigned int lowbits; + int error = 0; + for (highbits = 0; highbits < (1 << NUM_HIGHBITS); highbits++) + for (lowbits = 0; lowbits < (1 << NUM_LOWBITS); lowbits++) + { + /* Combine highbits and lowbits into a floating-point number, + sign-extending the lowbits to 64-NUM_HIGHBITS bits. */ + union { double f; uint64_t i; } janus; + janus.i = ((uint64_t) highbits << (64 - NUM_HIGHBITS)) + | ((uint64_t) ((int64_t) ((uint64_t) lowbits << (64 - NUM_LOWBITS)) + >> (64 - NUM_LOWBITS - NUM_HIGHBITS)) + >> NUM_HIGHBITS); + error |= check (janus.f); + } + return (error ? 1 : 0); +} diff --git a/tests/test-ceilf-ieee.c b/tests/test-ceilf-ieee.c new file mode 100644 --- /dev/null +++ b/tests/test-ceilf-ieee.c @@ -0,0 +1,56 @@ +/* Test of rounding towards positive infinity. + Copyright (C) 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 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 . */ + +#include + +#include + +#include "minus-zero.h" +#include "macros.h" + +/* If IEEE compliance was not requested, the ICC compiler inlines its + own ceilf assembly that turns -0.0f to 0.0f; but that is a correct + result when IEEE is not enforced. To avoid spurious failure, we + have to provide this dummy function in order to outsmart ICC's + inlining, and call our ceilf through a function pointer. */ +static float +dummy (float f) +{ + return 0; +} + +int +main (int argc, char **argv _GL_UNUSED) +{ + float (*my_ceilf) (float) = argc ? ceilf : dummy; + + /* See IEEE 754, section 6.3: + "the sign of the result of the round floating-point number to + integral value operation is the sign of the operand. These rules + shall apply even when operands or results are zero or infinite." */ + + /* Zero. */ + ASSERT (!signbit (my_ceilf (0.0f))); + ASSERT (!!signbit (my_ceilf (minus_zerof)) == !!signbit (minus_zerof)); + /* Positive numbers. */ + ASSERT (!signbit (my_ceilf (0.3f))); + ASSERT (!signbit (my_ceilf (0.7f))); + /* Negative numbers. */ + ASSERT (!!signbit (my_ceilf (-0.3f)) == !!signbit (minus_zerof)); + ASSERT (!!signbit (my_ceilf (-0.7f)) == !!signbit (minus_zerof)); + + return 0; +} diff --git a/tests/test-ceilf1.c b/tests/test-ceilf1.c --- a/tests/test-ceilf1.c +++ b/tests/test-ceilf1.c @@ -46,9 +46,7 @@ /* Zero. */ ASSERT (my_ceilf (0.0f) == 0.0f); - ASSERT (!signbit (my_ceilf (0.0f))); ASSERT (my_ceilf (minus_zerof) == 0.0f); - ASSERT (!!signbit (minus_zerof) == !!signbit (my_ceilf (minus_zerof))); /* Positive numbers. */ ASSERT (my_ceilf (0.3f) == 1.0f); ASSERT (my_ceilf (0.7f) == 1.0f); diff --git a/tests/test-ceilf2.c b/tests/test-ceilf2.c --- a/tests/test-ceilf2.c +++ b/tests/test-ceilf2.c @@ -29,6 +29,7 @@ #include #include "isnanf-nolibm.h" +#include "minus-zero.h" #include "macros.h" @@ -38,6 +39,9 @@ #define MANT_DIG FLT_MANT_DIG #define L_(literal) literal##f +/* -0.0. See minus-zero.h. */ +#define MINUS_ZERO minus_zerof + /* 2^(MANT_DIG-1). */ static const DOUBLE TWO_MANT_DIG = /* Assume MANT_DIG <= 5 * 31. @@ -79,8 +83,12 @@ } else if (z < L_(0.0)) { + /* For -1 < x < 0, return -0.0 regardless of the current rounding + mode. */ + if (z > L_(-1.0)) + z = MINUS_ZERO; /* Avoid rounding errors for values near -2^k, where k >= MANT_DIG-1. */ - if (z > - TWO_MANT_DIG) + else if (z > - TWO_MANT_DIG) { /* Round to the next integer (nearest or up or down, doesn't matter). */ z -= TWO_MANT_DIG; diff --git a/tests/test-ceill-ieee.c b/tests/test-ceill-ieee.c new file mode 100644 --- /dev/null +++ b/tests/test-ceill-ieee.c @@ -0,0 +1,48 @@ +/* Test of rounding towards positive infinity. + Copyright (C) 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 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 . */ + +#include + +#include + +#include "fpucw.h" +#include "minus-zero.h" +#include "macros.h" + +int +main () +{ + DECL_LONG_DOUBLE_ROUNDING + + BEGIN_LONG_DOUBLE_ROUNDING (); + + /* See IEEE 754, section 6.3: + "the sign of the result of the round floating-point number to + integral value operation is the sign of the operand. These rules + shall apply even when operands or results are zero or infinite." */ + + /* Zero. */ + ASSERT (!signbit (ceill (0.0L))); + ASSERT (!!signbit (ceill (minus_zerol)) == !!signbit (minus_zerol)); + /* Positive numbers. */ + ASSERT (!signbit (ceill (0.3L))); + ASSERT (!signbit (ceill (0.7L))); + /* Negative numbers. */ + ASSERT (!!signbit (ceill (-0.3L)) == !!signbit (minus_zerol)); + ASSERT (!!signbit (ceill (-0.7L)) == !!signbit (minus_zerol)); + + return 0; +} diff --git a/tests/test-ceill.c b/tests/test-ceill.c --- a/tests/test-ceill.c +++ b/tests/test-ceill.c @@ -40,9 +40,7 @@ /* Zero. */ ASSERT (ceill (0.0L) == 0.0L); - ASSERT (!signbit (ceill (0.0L))); ASSERT (ceill (minus_zerol) == 0.0L); - ASSERT (!!signbit (minus_zerol) == !!signbit (ceill (minus_zerol))); /* Positive numbers. */ ASSERT (ceill (0.3L) == 1.0L); ASSERT (ceill (0.7L) == 1.0L); diff --git a/tests/test-fdutimensat.c b/tests/test-fdutimensat.c --- a/tests/test-fdutimensat.c +++ b/tests/test-fdutimensat.c @@ -48,12 +48,17 @@ do_fdutimens (char const *name, struct timespec const times[2]) { int result; + int nofollow_result; + int nofollow_errno; int fd = openat (dfd, name, O_WRONLY); if (fd < 0) fd = openat (dfd, name, O_RDONLY); errno = 0; + nofollow_result = fdutimensat (fd, dfd, name, times, AT_SYMLINK_NOFOLLOW); + nofollow_errno = errno; result = fdutimensat (fd, dfd, name, times, 0); - ASSERT (fdutimensat (fd, dfd, name, times, AT_SYMLINK_NOFOLLOW) == result); + ASSERT (result == nofollow_result + || (nofollow_result == -1 && nofollow_errno == ENOSYS)); if (0 <= fd) { int saved_errno = errno; diff --git a/tests/test-floor-ieee.c b/tests/test-floor-ieee.c new file mode 100644 --- /dev/null +++ b/tests/test-floor-ieee.c @@ -0,0 +1,43 @@ +/* Test of rounding towards negative infinity. + Copyright (C) 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 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 . */ + +#include + +#include + +#include "minus-zero.h" +#include "macros.h" + +int +main () +{ + /* See IEEE 754, section 6.3: + "the sign of the result of the round floating-point number to + integral value operation is the sign of the operand. These rules + shall apply even when operands or results are zero or infinite." */ + + /* Zero. */ + ASSERT (!signbit (floor (0.0))); + ASSERT (!!signbit (floor (minus_zerod)) == !!signbit (minus_zerod)); + /* Positive numbers. */ + ASSERT (!signbit (floor (0.3))); + ASSERT (!signbit (floor (0.7))); + /* Negative numbers. */ + ASSERT (!!signbit (floor (-0.3)) == !!signbit (minus_zerod)); + ASSERT (!!signbit (floor (-0.7)) == !!signbit (minus_zerod)); + + return 0; +} diff --git a/tests/test-floor1.c b/tests/test-floor1.c new file mode 100644 --- /dev/null +++ b/tests/test-floor1.c @@ -0,0 +1,65 @@ +/* Test of rounding towards negative infinity. + 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 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 . */ + +/* Written by Bruno Haible , 2007. */ + +#include + +#include + +#include "signature.h" +SIGNATURE_CHECK (floor, double, (double)); + +#include "isnand-nolibm.h" +#include "minus-zero.h" +#include "nan.h" +#include "macros.h" + +int +main (int argc, char **argv _GL_UNUSED) +{ + /* Zero. */ + ASSERT (floor (0.0) == 0.0); + ASSERT (floor (minus_zerod) == 0.0); + /* Positive numbers. */ + ASSERT (floor (0.3) == 0.0); + ASSERT (floor (0.7) == 0.0); + ASSERT (floor (1.0) == 1.0); + ASSERT (floor (1.5) == 1.0); + ASSERT (floor (1.999) == 1.0); + ASSERT (floor (2.0) == 2.0); + ASSERT (floor (65535.999) == 65535.0); + ASSERT (floor (65536.0) == 65536.0); + ASSERT (floor (2.341e31) == 2.341e31); + /* Negative numbers. */ + ASSERT (floor (-0.3) == -1.0); + ASSERT (floor (-0.7) == -1.0); + ASSERT (floor (-1.0) == -1.0); + ASSERT (floor (-1.001) == -2.0); + ASSERT (floor (-1.5) == -2.0); + ASSERT (floor (-1.999) == -2.0); + ASSERT (floor (-2.0) == -2.0); + ASSERT (floor (-65535.999) == -65536.0); + ASSERT (floor (-65536.0) == -65536.0); + ASSERT (floor (-2.341e31) == -2.341e31); + /* Infinite numbers. */ + ASSERT (floor (1.0 / 0.0) == 1.0 / 0.0); + ASSERT (floor (-1.0 / 0.0) == -1.0 / 0.0); + /* NaNs. */ + ASSERT (isnand (floor (NaNd ()))); + + return 0; +} diff --git a/tests/test-floor2.c b/tests/test-floor2.c new file mode 100644 --- /dev/null +++ b/tests/test-floor2.c @@ -0,0 +1,168 @@ +/* Test of rounding towards negative infinity. + 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 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 . */ + +/* Written by Bruno Haible , 2007. */ + +/* When this test fails on some platform, build it together with the gnulib + module 'fprintf-posix' for optimal debugging output. */ + +#include + +#include + +#include +#include +#include +#include + +#include "isnand-nolibm.h" +#include "macros.h" + + +/* The reference implementation, taken from lib/floor.c. */ + +#define DOUBLE double +#define MANT_DIG DBL_MANT_DIG +#define L_(literal) literal + +/* 2^(MANT_DIG-1). */ +static const DOUBLE TWO_MANT_DIG = + /* Assume MANT_DIG <= 5 * 31. + Use the identity + n = floor(n/5) + floor((n+1)/5) + ... + floor((n+4)/5). */ + (DOUBLE) (1U << ((MANT_DIG - 1) / 5)) + * (DOUBLE) (1U << ((MANT_DIG - 1 + 1) / 5)) + * (DOUBLE) (1U << ((MANT_DIG - 1 + 2) / 5)) + * (DOUBLE) (1U << ((MANT_DIG - 1 + 3) / 5)) + * (DOUBLE) (1U << ((MANT_DIG - 1 + 4) / 5)); + +DOUBLE +floor_reference (DOUBLE x) +{ + /* The use of 'volatile' guarantees that excess precision bits are dropped + at each addition step and before the following comparison at the caller's + site. It is necessary on x86 systems where double-floats are not IEEE + compliant by default, to avoid that the results become platform and compiler + option dependent. 'volatile' is a portable alternative to gcc's + -ffloat-store option. */ + volatile DOUBLE y = x; + volatile DOUBLE z = y; + + if (z > L_(0.0)) + { + /* For 0 < x < 1, return +0.0 even if the current rounding mode is + FE_DOWNWARD. */ + if (z < L_(1.0)) + z = L_(0.0); + /* Avoid rounding errors for values near 2^k, where k >= MANT_DIG-1. */ + else if (z < TWO_MANT_DIG) + { + /* Round to the next integer (nearest or up or down, doesn't matter). */ + z += TWO_MANT_DIG; + z -= TWO_MANT_DIG; + /* Enforce rounding down. */ + if (z > y) + z -= L_(1.0); + } + } + else if (z < L_(0.0)) + { + /* Work around ICC's desire to optimize denormal floats to 0. */ + if (z > -DBL_MIN) + return L_(-1.0); + /* Avoid rounding errors for values near -2^k, where k >= MANT_DIG-1. */ + if (z > - TWO_MANT_DIG) + { + /* Round to the next integer (nearest or up or down, doesn't matter). */ + z -= TWO_MANT_DIG; + z += TWO_MANT_DIG; + /* Enforce rounding down. */ + if (z > y) + z -= L_(1.0); + } + } + return z; +} + + +/* Test for equality. */ +static int +equal (DOUBLE x, DOUBLE y) +{ + return (isnand (x) ? isnand (y) : x == y); +} + +/* Test whether the result for a given argument is correct. */ +static bool +correct_result_p (DOUBLE x, DOUBLE result) +{ + return + (x < 0 && x >= -1 ? result == - L_(1.0) : + x - 1 < x ? result <= x && result >= x - 1 && x - result < 1 : + equal (result, x)); +} + +/* Test the function for a given argument. */ +static int +check (double x) +{ + /* If the reference implementation is incorrect, bail out immediately. */ + double reference = floor_reference (x); + ASSERT (correct_result_p (x, reference)); + /* If the actual implementation is wrong, return an error code. */ + { + double result = floor (x); + if (correct_result_p (x, result)) + return 0; + else + { +#if GNULIB_TEST_FPRINTF_POSIX + fprintf (stderr, "floor %g(%a) = %g(%a) or %g(%a)?\n", + x, x, reference, reference, result, result); +#endif + return 1; + } + } +} + +#define NUM_HIGHBITS 15 +#define NUM_LOWBITS 4 + +int +main () +{ +#ifdef UINT64_MAX + unsigned int highbits; + unsigned int lowbits; + int error = 0; + for (highbits = 0; highbits < (1 << NUM_HIGHBITS); highbits++) + for (lowbits = 0; lowbits < (1 << NUM_LOWBITS); lowbits++) + { + /* Combine highbits and lowbits into a floating-point number, + sign-extending the lowbits to 64-NUM_HIGHBITS bits. */ + union { double f; uint64_t i; } janus; + janus.i = ((uint64_t) highbits << (64 - NUM_HIGHBITS)) + | ((uint64_t) ((int64_t) ((uint64_t) lowbits << (64 - NUM_LOWBITS)) + >> (64 - NUM_LOWBITS - NUM_HIGHBITS)) + >> NUM_HIGHBITS); + error |= check (janus.f); + } + return (error ? 1 : 0); +#else + fprintf (stderr, "Skipping test: no 64-bit integer type available\n"); + return 77; +#endif +} diff --git a/tests/test-floorf-ieee.c b/tests/test-floorf-ieee.c new file mode 100644 --- /dev/null +++ b/tests/test-floorf-ieee.c @@ -0,0 +1,56 @@ +/* Test of rounding towards negative infinity. + Copyright (C) 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 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 . */ + +#include + +#include + +#include "minus-zero.h" +#include "macros.h" + +/* If IEEE compliance was not requested, the ICC compiler inlines its + own floorf assembly that turns -0.0f to 0.0f; but that is a correct + result when IEEE is not enforced. To avoid spurious failure, we + have to provide this dummy function in order to outsmart ICC's + inlining, and call our floorf through a function pointer. */ +static float +dummy (float f) +{ + return 0; +} + +int +main (int argc, char **argv _GL_UNUSED) +{ + float (*my_floorf) (float) = argc ? floorf : dummy; + + /* See IEEE 754, section 6.3: + "the sign of the result of the round floating-point number to + integral value operation is the sign of the operand. These rules + shall apply even when operands or results are zero or infinite." */ + + /* Zero. */ + ASSERT (!signbit (my_floorf (0.0f))); + ASSERT (!!signbit (my_floorf (minus_zerof)) == !!signbit (minus_zerof)); + /* Positive numbers. */ + ASSERT (!signbit (my_floorf (0.3f))); + ASSERT (!signbit (my_floorf (0.7f))); + /* Negative numbers. */ + ASSERT (!!signbit (my_floorf (-0.3f)) == !!signbit (minus_zerof)); + ASSERT (!!signbit (my_floorf (-0.7f)) == !!signbit (minus_zerof)); + + return 0; +} diff --git a/tests/test-floorf1.c b/tests/test-floorf1.c --- a/tests/test-floorf1.c +++ b/tests/test-floorf1.c @@ -46,9 +46,7 @@ /* Zero. */ ASSERT (my_floorf (0.0f) == 0.0f); - ASSERT (!signbit (my_floorf (0.0f))); ASSERT (my_floorf (minus_zerof) == 0.0f); - ASSERT (!!signbit (minus_zerof) == !!signbit (my_floorf (minus_zerof))); /* Positive numbers. */ ASSERT (my_floorf (0.3f) == 0.0f); ASSERT (my_floorf (0.7f) == 0.0f); diff --git a/tests/test-floorf2.c b/tests/test-floorf2.c --- a/tests/test-floorf2.c +++ b/tests/test-floorf2.c @@ -63,8 +63,12 @@ if (z > L_(0.0)) { + /* For 0 < x < 1, return +0.0 even if the current rounding mode is + FE_DOWNWARD. */ + if (z < L_(1.0)) + z = L_(0.0); /* Avoid rounding errors for values near 2^k, where k >= MANT_DIG-1. */ - if (z < TWO_MANT_DIG) + else if (z < TWO_MANT_DIG) { /* Round to the next integer (nearest or up or down, doesn't matter). */ z += TWO_MANT_DIG; diff --git a/tests/test-floorl-ieee.c b/tests/test-floorl-ieee.c new file mode 100644 --- /dev/null +++ b/tests/test-floorl-ieee.c @@ -0,0 +1,48 @@ +/* Test of rounding towards negative infinity. + Copyright (C) 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 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 . */ + +#include + +#include + +#include "fpucw.h" +#include "minus-zero.h" +#include "macros.h" + +int +main () +{ + DECL_LONG_DOUBLE_ROUNDING + + BEGIN_LONG_DOUBLE_ROUNDING (); + + /* See IEEE 754, section 6.3: + "the sign of the result of the round floating-point number to + integral value operation is the sign of the operand. These rules + shall apply even when operands or results are zero or infinite." */ + + /* Zero. */ + ASSERT (!signbit (floorl (0.0L))); + ASSERT (!!signbit (floorl (minus_zerol)) == !!signbit (minus_zerol)); + /* Positive numbers. */ + ASSERT (!signbit (floorl (0.3L))); + ASSERT (!signbit (floorl (0.7L))); + /* Negative numbers. */ + ASSERT (!!signbit (floorl (-0.3L)) == !!signbit (minus_zerol)); + ASSERT (!!signbit (floorl (-0.7L)) == !!signbit (minus_zerol)); + + return 0; +} diff --git a/tests/test-floorl.c b/tests/test-floorl.c --- a/tests/test-floorl.c +++ b/tests/test-floorl.c @@ -40,9 +40,7 @@ /* Zero. */ ASSERT (floorl (0.0L) == 0.0L); - ASSERT (!signbit (floorl (0.0L))); ASSERT (floorl (minus_zerol) == 0.0L); - ASSERT (!!signbit (minus_zerol) == !!signbit (floorl (minus_zerol))); /* Positive numbers. */ ASSERT (floorl (0.3L) == 0.0L); ASSERT (floorl (0.7L) == 0.0L); diff --git a/tests/test-getlogin.c b/tests/test-getlogin.c --- a/tests/test-getlogin.c +++ b/tests/test-getlogin.c @@ -23,6 +23,7 @@ #include "signature.h" SIGNATURE_CHECK (getlogin, char *, (void)); +#include #include #include #include @@ -39,7 +40,10 @@ if (buf == NULL) { /* getlogin() fails when stdin is not connected to a tty. */ + ASSERT (errno == ENOTTY); +#if !defined __hpux /* On HP-UX 11.11 it fails anyway. */ ASSERT (! isatty (0)); +#endif fprintf (stderr, "Skipping test: stdin is not a tty.\n"); return 77; } diff --git a/tests/test-getlogin_r.c b/tests/test-getlogin_r.c --- a/tests/test-getlogin_r.c +++ b/tests/test-getlogin_r.c @@ -35,11 +35,16 @@ { /* Test with a large enough buffer. */ char buf[1024]; + int err; - if (getlogin_r (buf, sizeof (buf)) != 0) + err = getlogin_r (buf, sizeof (buf)); + if (err != 0) { /* getlogin_r() fails when stdin is not connected to a tty. */ + ASSERT (err == ENOTTY); +#if !defined __hpux /* On HP-UX 11.11 it fails anyway. */ ASSERT (! isatty (0)); +#endif fprintf (stderr, "Skipping test: stdin is not a tty.\n"); return 77; } diff --git a/tests/test-linkat.c b/tests/test-linkat.c --- a/tests/test-linkat.c +++ b/tests/test-linkat.c @@ -53,6 +53,17 @@ return linkat (dfd1, name1, dfd2, name2, flag); } +/* Can we expect that link() and linkat(), when called on a symlink, + increment the link count of that symlink? */ +#if LINK_FOLLOWS_SYMLINKS == 0 +# define EXPECT_LINK_HARDLINKS_SYMLINKS 1 +#elif LINK_FOLLOWS_SYMLINKS == -1 +extern int __xpg4; +# define EXPECT_LINK_HARDLINKS_SYMLINKS (__xpg4 == 0) +#else +# define EXPECT_LINK_HARDLINKS_SYMLINKS 0 +#endif + /* Wrapper to see if two symlinks act the same. */ static void check_same_link (char const *name1, char const *name2) @@ -68,7 +79,7 @@ ASSERT (contents1); ASSERT (contents2); ASSERT (strcmp (contents1, contents2) == 0); - if (!LINK_FOLLOWS_SYMLINKS) + if (EXPECT_LINK_HARDLINKS_SYMLINKS) ASSERT (SAME_INODE (st1, st2)); free (contents1); free (contents2); @@ -180,7 +191,7 @@ ASSERT (errno == EEXIST || errno == EPERM || errno == EACCES); errno = 0; ASSERT (linkat (dfd, BASE "link1", dfd, BASE "sub1/", 0) == -1); - ASSERT (errno == EEXIST); + ASSERT (errno == EEXIST || errno == ENOTDIR); errno = 0; ASSERT (linkat (dfd, BASE "link1", dfd, BASE "sub1", AT_SYMLINK_FOLLOW) == -1); diff --git a/tests/test-math-c++.cc b/tests/test-math-c++.cc --- a/tests/test-math-c++.cc +++ b/tests/test-math-c++.cc @@ -80,6 +80,10 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::ceilf, float, (float)); #endif +#if GNULIB_TEST_CEIL +SIGNATURE_CHECK (GNULIB_NAMESPACE::ceil, double, (double)); +#endif + #if GNULIB_TEST_CEILL SIGNATURE_CHECK (GNULIB_NAMESPACE::ceill, long double, (long double)); #endif @@ -96,6 +100,10 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::floorf, float, (float)); #endif +#if GNULIB_TEST_FLOOR +SIGNATURE_CHECK (GNULIB_NAMESPACE::floor, double, (double)); +#endif + #if GNULIB_TEST_FLOORL SIGNATURE_CHECK (GNULIB_NAMESPACE::floorl, long double, (long double)); #endif diff --git a/tests/test-mbrtowc.c b/tests/test-mbrtowc.c --- a/tests/test-mbrtowc.c +++ b/tests/test-mbrtowc.c @@ -1,5 +1,5 @@ /* Test of conversion of multibyte character to wide character. - Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2008-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 @@ -143,6 +143,11 @@ ASSERT (mbsinit (&state)); input[1] = '\0'; + /* Test support of NULL first argument. */ + ret = mbrtowc (NULL, input + 2, 3, &state); + ASSERT (ret == 1); + ASSERT (mbsinit (&state)); + wc = (wchar_t) 0xBADFACE; ret = mbrtowc (&wc, input + 2, 3, &state); ASSERT (ret == 1); @@ -192,6 +197,11 @@ ASSERT (mbsinit (&state)); input[2] = '\0'; + /* Test support of NULL first argument. */ + ret = mbrtowc (NULL, input + 3, 4, &state); + ASSERT (ret == 2); + ASSERT (mbsinit (&state)); + wc = (wchar_t) 0xBADFACE; ret = mbrtowc (&wc, input + 3, 4, &state); ASSERT (ret == 2); @@ -250,6 +260,11 @@ ASSERT (mbsinit (&state)); input[4] = '\0'; + /* Test support of NULL first argument. */ + ret = mbrtowc (NULL, input + 5, 3, &state); + ASSERT (ret == 2); + ASSERT (mbsinit (&state)); + wc = (wchar_t) 0xBADFACE; ret = mbrtowc (&wc, input + 5, 3, &state); ASSERT (ret == 2); @@ -293,6 +308,11 @@ ASSERT (mbsinit (&state)); input[2] = '\0'; + /* Test support of NULL first argument. */ + ret = mbrtowc (NULL, input + 3, 6, &state); + ASSERT (ret == 4); + ASSERT (mbsinit (&state)); + wc = (wchar_t) 0xBADFACE; ret = mbrtowc (&wc, input + 3, 6, &state); ASSERT (ret == 4); diff --git a/tests/test-nl_langinfo.c b/tests/test-nl_langinfo.c --- a/tests/test-nl_langinfo.c +++ b/tests/test-nl_langinfo.c @@ -30,10 +30,10 @@ #include "c-strcase.h" #include "macros.h" -/* For GCC >= 4.2, silence the warnings +/* For GCC >= 4.3, silence the warnings "comparison of unsigned expression >= 0 is always true" in this file. */ -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2) +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) # pragma GCC diagnostic ignored "-Wtype-limits" #endif diff --git a/tests/test-posixtm.c b/tests/test-posixtm.c --- a/tests/test-posixtm.c +++ b/tests/test-posixtm.c @@ -46,7 +46,13 @@ { "12131415.16", 13, 1, 0}, /* ??? Dec 13 14:15:16 ???? */ { "12131415", 13, 1, 0}, /* ??? Dec 13 14:15:00 ???? */ + /* These two tests fail on 64-bit Solaris up through at least + Solaris 10, which is off by one day for time stamps before + 0001-01-01 00:00:00 UTC. */ { "000001010000.00", 13, 1, -62167219200}, /* Sat Jan 1 00:00:00 0 */ + { "000012312359.59", 13, 1, -62135596801}, /* Fri Dec 31 23:59:59 0 */ + + { "000101010000.00", 13, 1, -62135596800}, /* Sat Jan 1 00:00:00 1 */ { "190112132045.51", 13, 1, -2147483649}, /* Fri Dec 13 20:45:51 1901 */ { "190112132045.52", 13, 1, -2147483648}, /* Fri Dec 13 20:45:52 1901 */ { "190112132045.53", 13, 1, -2147483647}, /* Fri Dec 13 20:45:53 1901 */ diff --git a/tests/test-ptsname.c b/tests/test-ptsname.c --- a/tests/test-ptsname.c +++ b/tests/test-ptsname.c @@ -25,9 +25,32 @@ #include #include #include +#include + +#include "same-inode.h" #include "macros.h" +/* Compare two slave names. + On some systems, there are hard links in the /dev/ directory. + For example, on OSF/1 5.1, + /dev/ttyp0 == /dev/pts/0 + /dev/ttyp9 == /dev/pts/9 + /dev/ttypa == /dev/pts/10 + /dev/ttype == /dev/pts/14 + */ +static int +same_slave (const char *slave_name1, const char *slave_name2) +{ + struct stat statbuf1; + struct stat statbuf2; + + return (strcmp (slave_name1, slave_name2) == 0 + || (stat (slave_name1, &statbuf1) >= 0 + && stat (slave_name2, &statbuf2) >= 0 + && SAME_INODE (statbuf1, statbuf2))); +} + int main (void) { @@ -54,6 +77,30 @@ close (fd); } +#if defined __sun + /* Solaris has BSD-style /dev/pty[p-r][0-9a-f] files, but the function + ptsname() does not work on them. */ + { + int fd; + char *result; + + /* Open the controlling tty of the current process. */ + fd = open ("/dev/ptmx", O_RDWR | O_NOCTTY); + if (fd < 0) + { + fprintf (stderr, "Skipping test: cannot open pseudo-terminal\n"); + return 77; + } + + result = ptsname (fd); + ASSERT (result != NULL); + ASSERT (memcmp (result, "/dev/pts/", 9) == 0); + + close (fd); + } + +#else + /* Try various master names of MacOS X: /dev/pty[p-w][0-9a-f] */ { int char1; @@ -75,7 +122,7 @@ result = ptsname (fd); ASSERT (result != NULL); sprintf (slave_name, "/dev/tty%c%c", char1, char2); - ASSERT (strcmp (result, slave_name) == 0); + ASSERT (same_slave (result, slave_name)); close (fd); } @@ -105,12 +152,14 @@ result = ptsname (fd); ASSERT (result != NULL); sprintf (slave_name, "/dev/tty%c%c", char1, char2); - ASSERT (strcmp (result, slave_name) == 0); + ASSERT (same_slave (result, slave_name)); close (fd); } } } +#endif + return 0; } diff --git a/tests/test-rename.h b/tests/test-rename.h --- a/tests/test-rename.h +++ b/tests/test-rename.h @@ -56,11 +56,16 @@ if (stat (filename, &st) == -1) ASSERT (errno == ENOENT); else - /* But after renaming a directory over an empty directory on an NFS-mounted - file system, on Linux 2.6.18, for a period of 30 seconds the old - directory name is "present" according to stat() but "nonexistent" - according to dentry_exists(). */ - ASSERT (!dentry_exists (filename)); + { + /* But after renaming a directory over an empty directory on an NFS- + mounted file system, on Linux 2.6.18, for a period of 30 seconds the + old directory name is "present" according to stat() but "nonexistent" + according to dentry_exists(). */ + ASSERT (!dentry_exists (filename)); + /* Remove the old directory name, so that subsequent mkdir calls + succeed. */ + (void) rmdir (filename); + } } static int @@ -339,7 +344,7 @@ { errno = 0; ASSERT (func (BASE "dir2/.", BASE "dir") == -1); - ASSERT (errno == EINVAL || errno == EBUSY); + ASSERT (errno == EINVAL || errno == EBUSY || errno == EEXIST); } ASSERT (rmdir (BASE "dir") == 0); /* Files present here: @@ -366,7 +371,7 @@ { errno = 0; ASSERT (func (BASE "dir2/.//", BASE "dir") == -1); - ASSERT (errno == EINVAL || errno == EBUSY); + ASSERT (errno == EINVAL || errno == EBUSY || errno == EEXIST); } ASSERT (rmdir (BASE "dir2") == 0); /* Files present here: @@ -914,7 +919,7 @@ if (result) /* GNU/Linux rejects attempts to use link2/. */ { ASSERT (result == -1); - ASSERT (errno == ENOTDIR); + ASSERT (errno == ENOTDIR || errno == EISDIR); } memset (&st, 0, sizeof st); ASSERT (lstat (BASE "dir", &st) == 0); diff --git a/tests/test-renameat.c b/tests/test-renameat.c --- a/tests/test-renameat.c +++ b/tests/test-renameat.c @@ -133,7 +133,7 @@ || errno == ENOTEMPTY); errno = 0; ASSERT (renameat (dfd, BASE "sub2/.", dfd, BASE "sub1") == -1); - ASSERT (errno == EINVAL || errno == EBUSY); + ASSERT (errno == EINVAL || errno == EBUSY || errno == EEXIST); errno = 0; ASSERT (renameat (dfd, BASE "17", dfd, BASE "sub1") == -1); ASSERT (errno == EISDIR); diff --git a/tests/test-round-ieee.c b/tests/test-round-ieee.c new file mode 100644 --- /dev/null +++ b/tests/test-round-ieee.c @@ -0,0 +1,44 @@ +/* Test of rounding to nearest, breaking ties away from zero. + Copyright (C) 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. */ + +#include + +#include + +#include "minus-zero.h" +#include "macros.h" + +int +main () +{ + /* See IEEE 754, section 6.3: + "the sign of the result of the round floating-point number to + integral value operation is the sign of the operand. These rules + shall apply even when operands or results are zero or infinite." */ + + /* Zero. */ + ASSERT (!signbit (round (0.0))); + ASSERT (!!signbit (round (minus_zerod)) == !!signbit (minus_zerod)); + /* Positive numbers. */ + ASSERT (!signbit (round (0.3))); + ASSERT (!signbit (round (0.7))); + /* Negative numbers. */ + ASSERT (!!signbit (round (-0.3)) == !!signbit (minus_zerod)); + ASSERT (!!signbit (round (-0.7)) == !!signbit (minus_zerod)); + + return 0; +} diff --git a/tests/test-round1.c b/tests/test-round1.c --- a/tests/test-round1.c +++ b/tests/test-round1.c @@ -35,9 +35,7 @@ { /* Zero. */ ASSERT (round (0.0) == 0.0); - ASSERT (!signbit (round (0.0))); ASSERT (round (minus_zerod) == 0.0); - ASSERT (!!signbit (minus_zerod) == !!signbit (round (minus_zerod))); /* Positive numbers. */ ASSERT (round (0.3) == 0.0); ASSERT (round (0.5) == 1.0); diff --git a/tests/test-roundf-ieee.c b/tests/test-roundf-ieee.c new file mode 100644 --- /dev/null +++ b/tests/test-roundf-ieee.c @@ -0,0 +1,44 @@ +/* Test of rounding to nearest, breaking ties away from zero. + Copyright (C) 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. */ + +#include + +#include + +#include "minus-zero.h" +#include "macros.h" + +int +main () +{ + /* See IEEE 754, section 6.3: + "the sign of the result of the round floating-point number to + integral value operation is the sign of the operand. These rules + shall apply even when operands or results are zero or infinite." */ + + /* Zero. */ + ASSERT (!signbit (roundf (0.0f))); + ASSERT (!!signbit (roundf (minus_zerof)) == !!signbit (minus_zerof)); + /* Positive numbers. */ + ASSERT (!signbit (roundf (0.3f))); + ASSERT (!signbit (roundf (0.7f))); + /* Negative numbers. */ + ASSERT (!!signbit (roundf (-0.3f)) == !!signbit (minus_zerof)); + ASSERT (!!signbit (roundf (-0.7f)) == !!signbit (minus_zerof)); + + return 0; +} diff --git a/tests/test-roundf1.c b/tests/test-roundf1.c --- a/tests/test-roundf1.c +++ b/tests/test-roundf1.c @@ -35,9 +35,7 @@ { /* Zero. */ ASSERT (roundf (0.0f) == 0.0f); - ASSERT (!signbit (roundf (0.0f))); ASSERT (roundf (minus_zerof) == 0.0f); - ASSERT (!!signbit (minus_zerof) == !!signbit (roundf (minus_zerof))); /* Positive numbers. */ ASSERT (roundf (0.3f) == 0.0f); ASSERT (roundf (0.5f) == 1.0f); diff --git a/tests/test-roundl-ieee.c b/tests/test-roundl-ieee.c new file mode 100644 --- /dev/null +++ b/tests/test-roundl-ieee.c @@ -0,0 +1,49 @@ +/* Test of rounding to nearest, breaking ties away from zero. + Copyright (C) 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. */ + +#include + +#include + +#include "fpucw.h" +#include "minus-zero.h" +#include "macros.h" + +int +main () +{ + DECL_LONG_DOUBLE_ROUNDING + + BEGIN_LONG_DOUBLE_ROUNDING (); + + /* See IEEE 754, section 6.3: + "the sign of the result of the round floating-point number to + integral value operation is the sign of the operand. These rules + shall apply even when operands or results are zero or infinite." */ + + /* Zero. */ + ASSERT (!signbit (roundl (0.0L))); + ASSERT (!!signbit (roundl (minus_zerol)) == !!signbit (minus_zerol)); + /* Positive numbers. */ + ASSERT (!signbit (roundl (0.3L))); + ASSERT (!signbit (roundl (0.7L))); + /* Negative numbers. */ + ASSERT (!!signbit (roundl (-0.3L)) == !!signbit (minus_zerol)); + ASSERT (!!signbit (roundl (-0.7L)) == !!signbit (minus_zerol)); + + return 0; +} diff --git a/tests/test-roundl.c b/tests/test-roundl.c --- a/tests/test-roundl.c +++ b/tests/test-roundl.c @@ -42,9 +42,7 @@ /* Zero. */ ASSERT (roundl (0.0L) == 0.0L); - ASSERT (!signbit (roundl (0.0L))); ASSERT (roundl (minus_zerol) == 0.0L); - ASSERT (!!signbit (minus_zerol) == !!signbit (roundl (minus_zerol))); /* Positive numbers. */ ASSERT (roundl (0.3L) == 0.0L); ASSERT (roundl (0.5L) == 1.0L); diff --git a/tests/test-select.c b/tests/test-select.c --- a/tests/test-select.c +++ b/tests/test-select.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -50,25 +51,16 @@ #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 -#define pipe(x) _pipe(x, 256, O_BINARY) -#endif -#ifdef HAVE_UNISTD_H -#include -#endif #ifdef HAVE_SYS_WAIT_H -#include +# include #endif #ifndef SO_REUSEPORT -#define SO_REUSEPORT SO_REUSEADDR +# define SO_REUSEPORT SO_REUSEADDR #endif #define TEST_PORT 12345 @@ -134,7 +126,7 @@ } static int -connect_to_socket (int blocking) +connect_to_socket (bool blocking) { int s; struct sockaddr_in ia; @@ -171,10 +163,20 @@ } -/* 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 @@ 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 @@ 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 @@ } -/* Test poll(2) for TTYs. */ +/* Test select(2) for TTYs. */ #ifdef INTERACTIVE static void @@ -242,7 +246,7 @@ #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 poll(2) for unconnected blocking sockets. */ +/* Test select(2) for unconnected blocking sockets. */ static void test_accept_first (void) @@ -310,7 +314,7 @@ 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 poll(2) on connected sockets. */ +/* Test select(2) on connected sockets. */ static void test_socket_pair (void) @@ -354,11 +358,11 @@ 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/tests/test-sigaction.c b/tests/test-sigaction.c --- a/tests/test-sigaction.c +++ b/tests/test-sigaction.c @@ -34,6 +34,12 @@ #ifndef SA_ONSTACK # define SA_ONSTACK 0 #endif +#ifndef SA_RESETHAND +# define SA_RESETHAND 0 +#endif +#ifndef SA_RESTART +# define SA_RESTART 0 +#endif #ifndef SA_SIGINFO # define SA_SIGINFO 0 #endif diff --git a/tests/test-signal.c b/tests/test-signal.c --- a/tests/test-signal.c +++ b/tests/test-signal.c @@ -35,6 +35,9 @@ #endif } s; +/* Check that NSIG is defined. */ +int nsig = NSIG; + int main (void) { diff --git a/tests/test-snprintf-posix.h b/tests/test-snprintf-posix.h --- a/tests/test-snprintf-posix.h +++ b/tests/test-snprintf-posix.h @@ -3045,6 +3045,19 @@ } { + char result[1000]; + int retval = + my_snprintf (result, sizeof (result), "%.511f %d", 1.0, 99); + size_t i; + ASSERT (result[0] == '1'); + ASSERT (result[1] == '.'); + for (i = 0; i < 511; i++) + ASSERT (result[2 + i] == '0'); + ASSERT (strcmp (result + 2 + 511, " 99") == 0); + ASSERT (retval == strlen (result)); + } + + { char input[5000]; char result[5000]; int retval; diff --git a/tests/test-snprintf.c b/tests/test-snprintf.c --- a/tests/test-snprintf.c +++ b/tests/test-snprintf.c @@ -34,15 +34,16 @@ 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 @@ } else { - ASSERT (retval == 5); ASSERT (memcmp (buf, "12345\0EF", 8) == 0); } } diff --git a/tests/test-sprintf-posix.h b/tests/test-sprintf-posix.h --- a/tests/test-sprintf-posix.h +++ b/tests/test-sprintf-posix.h @@ -3031,6 +3031,19 @@ } { + char result[1000]; + int retval = + my_sprintf (result, "%.511f %d", 1.0, 99); + size_t i; + ASSERT (result[0] == '1'); + ASSERT (result[1] == '.'); + for (i = 0; i < 511; i++) + ASSERT (result[2 + i] == '0'); + ASSERT (strcmp (result + 2 + 511, " 99") == 0); + ASSERT (retval == strlen (result)); + } + + { char input[5000]; char result[5000]; int retval; diff --git a/tests/test-stdbool.c b/tests/test-stdbool.c --- a/tests/test-stdbool.c +++ b/tests/test-stdbool.c @@ -61,8 +61,13 @@ char c[__bool_true_false_are_defined == 1 ? 1 : -1]; #if HAVE_STDBOOL_H || defined __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 @@ -85,11 +90,29 @@ int main () { + int error = 0; + +#if HAVE_STDBOOL_H || defined __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/tests/test-times.c b/tests/test-times.c --- a/tests/test-times.c +++ b/tests/test-times.c @@ -60,11 +60,11 @@ { printf ("clk_tck %ld\n", (long int) clk_tck); - printf ("t %ld\n", t); - printf ("tms.tms_utime %ldms\n", (tms.tms_utime * 1000) / clk_tck); - printf ("tms.tms_stime %ldms\n", (tms.tms_stime * 1000) / clk_tck); - printf ("tms.tms_cutime %ldms\n", (tms.tms_cutime * 1000) / clk_tck); - printf ("tms.tms_cstime %ldms\n", (tms.tms_cstime * 1000) / clk_tck); + printf ("t %ld\n", (long int) t); + printf ("tms.tms_utime %ldms\n", ((long int) tms.tms_utime * 1000) / clk_tck); + printf ("tms.tms_stime %ldms\n", ((long int) tms.tms_stime * 1000) / clk_tck); + printf ("tms.tms_cutime %ldms\n", ((long int) tms.tms_cutime * 1000) / clk_tck); + printf ("tms.tms_cstime %ldms\n", ((long int) tms.tms_cstime * 1000) / clk_tck); } if (argc > 1) @@ -94,11 +94,11 @@ { printf ("clk_tck %ld\n", (long int) clk_tck); - printf ("t %ld\n", t); - printf ("tms.tms_utime %ldms\n", (tms.tms_utime * 1000) / clk_tck); - printf ("tms.tms_stime %ldms\n", (tms.tms_stime * 1000) / clk_tck); - printf ("tms.tms_cutime %ldms\n", (tms.tms_cutime * 1000) / clk_tck); - printf ("tms.tms_cstime %ldms\n", (tms.tms_cstime * 1000) / clk_tck); + printf ("t %ld\n", (long int) t); + printf ("tms.tms_utime %ldms\n", ((long int) tms.tms_utime * 1000) / clk_tck); + printf ("tms.tms_stime %ldms\n", ((long int) tms.tms_stime * 1000) / clk_tck); + printf ("tms.tms_cutime %ldms\n", ((long int) tms.tms_cutime * 1000) / clk_tck); + printf ("tms.tms_cstime %ldms\n", ((long int) tms.tms_cstime * 1000) / clk_tck); } return 0; diff --git a/tests/test-trunc-ieee.c b/tests/test-trunc-ieee.c new file mode 100644 --- /dev/null +++ b/tests/test-trunc-ieee.c @@ -0,0 +1,43 @@ +/* Test of rounding towards zero. + Copyright (C) 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 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 . */ + +#include + +#include + +#include "minus-zero.h" +#include "macros.h" + +int +main () +{ + /* See IEEE 754, section 6.3: + "the sign of the result of the round floating-point number to + integral value operation is the sign of the operand. These rules + shall apply even when operands or results are zero or infinite." */ + + /* Zero. */ + ASSERT (!signbit (trunc (0.0))); + ASSERT (!!signbit (trunc (minus_zerod)) == !!signbit (minus_zerod)); + /* Positive numbers. */ + ASSERT (!signbit (trunc (0.3))); + ASSERT (!signbit (trunc (0.7))); + /* Negative numbers. */ + ASSERT (!!signbit (trunc (-0.3)) == !!signbit (minus_zerod)); + ASSERT (!!signbit (trunc (-0.7)) == !!signbit (minus_zerod)); + + return 0; +} diff --git a/tests/test-trunc1.c b/tests/test-trunc1.c --- a/tests/test-trunc1.c +++ b/tests/test-trunc1.c @@ -33,9 +33,7 @@ { /* Zero. */ ASSERT (trunc (0.0) == 0.0); - ASSERT (!signbit (trunc (0.0))); ASSERT (trunc (minus_zerod) == 0.0); - ASSERT (!!signbit (minus_zerod) == !!signbit (trunc (minus_zerod))); /* Positive numbers. */ ASSERT (trunc (0.3) == 0.0); ASSERT (trunc (0.7) == 0.0); diff --git a/tests/test-trunc2.c b/tests/test-trunc2.c --- a/tests/test-trunc2.c +++ b/tests/test-trunc2.c @@ -29,6 +29,7 @@ #include #include "isnand-nolibm.h" +#include "minus-zero.h" #include "macros.h" @@ -38,6 +39,9 @@ #define MANT_DIG DBL_MANT_DIG #define L_(literal) literal +/* -0.0. See minus-zero.h. */ +#define MINUS_ZERO minus_zerod + /* 2^(MANT_DIG-1). */ static const DOUBLE TWO_MANT_DIG = /* Assume MANT_DIG <= 5 * 31. @@ -63,8 +67,12 @@ if (z > L_(0.0)) { + /* For 0 < x < 1, return +0.0 even if the current rounding mode is + FE_DOWNWARD. */ + if (z < L_(1.0)) + z = L_(0.0); /* Avoid rounding errors for values near 2^k, where k >= MANT_DIG-1. */ - if (z < TWO_MANT_DIG) + else if (z < TWO_MANT_DIG) { /* Round to the next integer (nearest or up or down, doesn't matter). */ z += TWO_MANT_DIG; @@ -76,8 +84,12 @@ } else if (z < L_(0.0)) { + /* For -1 < x < 0, return -0.0 regardless of the current rounding + mode. */ + if (z > L_(-1.0)) + z = MINUS_ZERO; /* Avoid rounding errors for values near -2^k, where k >= MANT_DIG-1. */ - if (z > - TWO_MANT_DIG) + else if (z > - TWO_MANT_DIG) { /* Round to the next integer (nearest or up or down, doesn't matter). */ z -= TWO_MANT_DIG; diff --git a/tests/test-truncf-ieee.c b/tests/test-truncf-ieee.c new file mode 100644 --- /dev/null +++ b/tests/test-truncf-ieee.c @@ -0,0 +1,43 @@ +/* Test of rounding towards zero. + Copyright (C) 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 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 . */ + +#include + +#include + +#include "minus-zero.h" +#include "macros.h" + +int +main () +{ + /* See IEEE 754, section 6.3: + "the sign of the result of the round floating-point number to + integral value operation is the sign of the operand. These rules + shall apply even when operands or results are zero or infinite." */ + + /* Zero. */ + ASSERT (!signbit (truncf (0.0f))); + ASSERT (!!signbit (truncf (minus_zerof)) == !!signbit (minus_zerof)); + /* Positive numbers. */ + ASSERT (!signbit (truncf (0.3f))); + ASSERT (!signbit (truncf (0.7f))); + /* Negative numbers. */ + ASSERT (!!signbit (truncf (-0.3f)) == !!signbit (minus_zerof)); + ASSERT (!!signbit (truncf (-0.7f)) == !!signbit (minus_zerof)); + + return 0; +} diff --git a/tests/test-truncf1.c b/tests/test-truncf1.c --- a/tests/test-truncf1.c +++ b/tests/test-truncf1.c @@ -33,9 +33,7 @@ { /* Zero. */ ASSERT (truncf (0.0f) == 0.0f); - ASSERT (!signbit (truncf (0.0f))); ASSERT (truncf (minus_zerof) == 0.0f); - ASSERT (!!signbit (minus_zerof) == !!signbit (truncf (minus_zerof))); /* Positive numbers. */ ASSERT (truncf (0.3f) == 0.0f); ASSERT (truncf (0.7f) == 0.0f); diff --git a/tests/test-truncf2.c b/tests/test-truncf2.c --- a/tests/test-truncf2.c +++ b/tests/test-truncf2.c @@ -29,6 +29,7 @@ #include #include "isnanf-nolibm.h" +#include "minus-zero.h" #include "macros.h" @@ -38,6 +39,9 @@ #define MANT_DIG FLT_MANT_DIG #define L_(literal) literal##f +/* -0.0. See minus-zero.h. */ +#define MINUS_ZERO minus_zerof + /* 2^(MANT_DIG-1). */ static const DOUBLE TWO_MANT_DIG = /* Assume MANT_DIG <= 5 * 31. @@ -63,8 +67,12 @@ if (z > L_(0.0)) { + /* For 0 < x < 1, return +0.0 even if the current rounding mode is + FE_DOWNWARD. */ + if (z < L_(1.0)) + z = L_(0.0); /* Avoid rounding errors for values near 2^k, where k >= MANT_DIG-1. */ - if (z < TWO_MANT_DIG) + else if (z < TWO_MANT_DIG) { /* Round to the next integer (nearest or up or down, doesn't matter). */ z += TWO_MANT_DIG; @@ -76,8 +84,12 @@ } else if (z < L_(0.0)) { + /* For -1 < x < 0, return -0.0 regardless of the current rounding + mode. */ + if (z > L_(-1.0)) + z = MINUS_ZERO; /* Avoid rounding errors for values near -2^k, where k >= MANT_DIG-1. */ - if (z > - TWO_MANT_DIG) + else if (z > - TWO_MANT_DIG) { /* Round to the next integer (nearest or up or down, doesn't matter). */ z -= TWO_MANT_DIG; diff --git a/tests/test-truncl-ieee.c b/tests/test-truncl-ieee.c new file mode 100644 --- /dev/null +++ b/tests/test-truncl-ieee.c @@ -0,0 +1,48 @@ +/* Test of rounding towards zero. + Copyright (C) 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 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 . */ + +#include + +#include + +#include "fpucw.h" +#include "minus-zero.h" +#include "macros.h" + +int +main () +{ + DECL_LONG_DOUBLE_ROUNDING + + BEGIN_LONG_DOUBLE_ROUNDING (); + + /* See IEEE 754, section 6.3: + "the sign of the result of the round floating-point number to + integral value operation is the sign of the operand. These rules + shall apply even when operands or results are zero or infinite." */ + + /* Zero. */ + ASSERT (!signbit (truncl (0.0L))); + ASSERT (!!signbit (truncl (minus_zerol)) == !!signbit (minus_zerol)); + /* Positive numbers. */ + ASSERT (!signbit (truncl (0.3L))); + ASSERT (!signbit (truncl (0.7L))); + /* Negative numbers. */ + ASSERT (!!signbit (truncl (-0.3L)) == !!signbit (minus_zerol)); + ASSERT (!!signbit (truncl (-0.7L)) == !!signbit (minus_zerol)); + + return 0; +} diff --git a/tests/test-truncl.c b/tests/test-truncl.c --- a/tests/test-truncl.c +++ b/tests/test-truncl.c @@ -40,9 +40,7 @@ /* Zero. */ ASSERT (truncl (0.0L) == 0.0L); - ASSERT (!signbit (truncl (0.0L))); ASSERT (truncl (minus_zerol) == 0.0L); - ASSERT (!!signbit (minus_zerol) == !!signbit (truncl (minus_zerol))); /* Positive numbers. */ ASSERT (truncl (0.3L) == 0.0L); ASSERT (truncl (0.7L) == 0.0L); diff --git a/tests/test-vasnprintf-posix.c b/tests/test-vasnprintf-posix.c --- a/tests/test-vasnprintf-posix.c +++ b/tests/test-vasnprintf-posix.c @@ -3568,6 +3568,21 @@ } { + size_t length; + char *result = + my_asnprintf (NULL, &length, "%.511f %d", 1.0, 99); + size_t i; + ASSERT (result != NULL); + ASSERT (result[0] == '1'); + ASSERT (result[1] == '.'); + for (i = 0; i < 511; i++) + ASSERT (result[2 + i] == '0'); + ASSERT (strcmp (result + 2 + 511, " 99") == 0); + ASSERT (length == strlen (result)); + free (result); + } + + { char input[5000]; size_t length; char *result; diff --git a/tests/test-vasprintf-posix.c b/tests/test-vasprintf-posix.c --- a/tests/test-vasprintf-posix.c +++ b/tests/test-vasprintf-posix.c @@ -3548,6 +3548,21 @@ } { + char *result; + int retval = + my_asprintf (&result, "%.511f %d", 1.0, 99); + size_t i; + ASSERT (result != NULL); + ASSERT (result[0] == '1'); + ASSERT (result[1] == '.'); + for (i = 0; i < 511; i++) + ASSERT (result[2 + i] == '0'); + ASSERT (strcmp (result + 2 + 511, " 99") == 0); + ASSERT (retval == strlen (result)); + free (result); + } + + { char input[5000]; char *result; int retval; diff --git a/tests/test-vsnprintf.c b/tests/test-vsnprintf.c --- a/tests/test-vsnprintf.c +++ b/tests/test-vsnprintf.c @@ -47,15 +47,16 @@ 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 @@ } else { - ASSERT (retval == 5); ASSERT (memcmp (buf, "12345\0EF", 8) == 0); } } diff --git a/tests/unigbrk/GraphemeBreakTest.txt b/tests/unigbrk/GraphemeBreakTest.txt new file mode 100644 --- /dev/null +++ b/tests/unigbrk/GraphemeBreakTest.txt @@ -0,0 +1,311 @@ +# GraphemeBreakTest-5.1.0.txt +# Date: 2008-03-11, 02:19:22 GMT [MD] +# +# Unicode Character Database +# Copyright (c) 1991-2008 Unicode, Inc. +# For terms of use, see http://www.unicode.org/terms_of_use.html +# For documentation, see UCD.html +# +# Default Grapheme Break Test +# +# Format: +# (# )? +# contains hex Unicode code points, with +# ÷ wherever there is a break opportunity, and +# × wherever there is not. +# the format can change, but currently it shows: +# - the sample character name +# - (x) the line_break property* for the sample character +# - [x] the rule that determines whether there is a break or not +# +# These samples may be extended or changed in the future. +# +÷ 0020 ÷ 0020 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0020 × 0308 ÷ 0020 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0020 ÷ 000D ÷ # ÷ [0.2] SPACE (Other) ÷ [5.0] (CR) ÷ [0.3] +÷ 0020 × 0308 ÷ 000D ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0020 ÷ 000A ÷ # ÷ [0.2] SPACE (Other) ÷ [5.0] (LF) ÷ [0.3] +÷ 0020 × 0308 ÷ 000A ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0020 ÷ 0001 ÷ # ÷ [0.2] SPACE (Other) ÷ [5.0] (Control) ÷ [0.3] +÷ 0020 × 0308 ÷ 0001 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0020 × 0300 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0020 × 0308 × 0300 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0020 ÷ 0E40 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ 0020 × 0308 ÷ 0E40 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ 0020 × 0903 ÷ # ÷ [0.2] SPACE (Other) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0020 × 0308 × 0903 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0020 ÷ 1100 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0020 × 0308 ÷ 1100 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0020 ÷ 1160 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0020 × 0308 ÷ 1160 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0020 ÷ 11A8 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0020 × 0308 ÷ 11A8 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0020 ÷ AC00 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0020 × 0308 ÷ AC00 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0020 ÷ AC01 ÷ # ÷ [0.2] SPACE (Other) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0020 × 0308 ÷ AC01 ÷ # ÷ [0.2] SPACE (Other) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 000D ÷ 0020 ÷ # ÷ [0.2] (CR) ÷ [4.0] SPACE (Other) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 0020 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 000D ÷ 000D ÷ # ÷ [0.2] (CR) ÷ [4.0] (CR) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 000D ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 000D × 000A ÷ # ÷ [0.2] (CR) × [3.0] (LF) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 000A ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 000D ÷ 0001 ÷ # ÷ [0.2] (CR) ÷ [4.0] (Control) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 0001 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 000D ÷ 0300 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 000D ÷ 0308 × 0300 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 000D ÷ 0E40 ÷ # ÷ [0.2] (CR) ÷ [4.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 0E40 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ 000D ÷ 0903 ÷ # ÷ [0.2] (CR) ÷ [4.0] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 000D ÷ 0308 × 0903 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 000D ÷ 1100 ÷ # ÷ [0.2] (CR) ÷ [4.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 1100 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 000D ÷ 1160 ÷ # ÷ [0.2] (CR) ÷ [4.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 1160 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 000D ÷ 11A8 ÷ # ÷ [0.2] (CR) ÷ [4.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 000D ÷ 0308 ÷ 11A8 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 000D ÷ AC00 ÷ # ÷ [0.2] (CR) ÷ [4.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 000D ÷ 0308 ÷ AC00 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 000D ÷ AC01 ÷ # ÷ [0.2] (CR) ÷ [4.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 000D ÷ 0308 ÷ AC01 ÷ # ÷ [0.2] (CR) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 000A ÷ 0020 ÷ # ÷ [0.2] (LF) ÷ [4.0] SPACE (Other) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 0020 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 000A ÷ 000D ÷ # ÷ [0.2] (LF) ÷ [4.0] (CR) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 000D ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 000A ÷ 000A ÷ # ÷ [0.2] (LF) ÷ [4.0] (LF) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 000A ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 000A ÷ 0001 ÷ # ÷ [0.2] (LF) ÷ [4.0] (Control) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 0001 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 000A ÷ 0300 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 000A ÷ 0308 × 0300 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 000A ÷ 0E40 ÷ # ÷ [0.2] (LF) ÷ [4.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 0E40 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ 000A ÷ 0903 ÷ # ÷ [0.2] (LF) ÷ [4.0] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 000A ÷ 0308 × 0903 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 000A ÷ 1100 ÷ # ÷ [0.2] (LF) ÷ [4.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 1100 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 000A ÷ 1160 ÷ # ÷ [0.2] (LF) ÷ [4.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 1160 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 000A ÷ 11A8 ÷ # ÷ [0.2] (LF) ÷ [4.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 000A ÷ 0308 ÷ 11A8 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 000A ÷ AC00 ÷ # ÷ [0.2] (LF) ÷ [4.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 000A ÷ 0308 ÷ AC00 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 000A ÷ AC01 ÷ # ÷ [0.2] (LF) ÷ [4.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 000A ÷ 0308 ÷ AC01 ÷ # ÷ [0.2] (LF) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0001 ÷ 0020 ÷ # ÷ [0.2] (Control) ÷ [4.0] SPACE (Other) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 0020 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0001 ÷ 000D ÷ # ÷ [0.2] (Control) ÷ [4.0] (CR) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 000D ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0001 ÷ 000A ÷ # ÷ [0.2] (Control) ÷ [4.0] (LF) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 000A ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0001 ÷ 0001 ÷ # ÷ [0.2] (Control) ÷ [4.0] (Control) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 0001 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0001 ÷ 0300 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0001 ÷ 0308 × 0300 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0001 ÷ 0E40 ÷ # ÷ [0.2] (Control) ÷ [4.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 0E40 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ 0001 ÷ 0903 ÷ # ÷ [0.2] (Control) ÷ [4.0] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0001 ÷ 0308 × 0903 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0001 ÷ 1100 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 1100 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0001 ÷ 1160 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 1160 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0001 ÷ 11A8 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ 11A8 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0001 ÷ AC00 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ AC00 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0001 ÷ AC01 ÷ # ÷ [0.2] (Control) ÷ [4.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0001 ÷ 0308 ÷ AC01 ÷ # ÷ [0.2] (Control) ÷ [4.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0300 ÷ 0020 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0300 × 0308 ÷ 0020 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0300 ÷ 000D ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0300 × 0308 ÷ 000D ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0300 ÷ 000A ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0300 × 0308 ÷ 000A ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0300 ÷ 0001 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0300 × 0308 ÷ 0001 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0300 × 0300 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0300 × 0308 × 0300 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0300 ÷ 0E40 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ 0300 × 0308 ÷ 0E40 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ 0300 × 0903 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0300 × 0308 × 0903 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0300 ÷ 1100 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0300 × 0308 ÷ 1100 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0300 ÷ 1160 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0300 × 0308 ÷ 1160 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0300 ÷ 11A8 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0300 × 0308 ÷ 11A8 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0300 ÷ AC00 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0300 × 0308 ÷ AC00 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0300 ÷ AC01 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0300 × 0308 ÷ AC01 ÷ # ÷ [0.2] COMBINING GRAVE ACCENT (Extend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0E40 × 0020 ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) × [9.2] SPACE (Other) ÷ [0.3] +÷ 0E40 × 0308 ÷ 0020 ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0E40 ÷ 000D ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0E40 × 0308 ÷ 000D ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0E40 ÷ 000A ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0E40 × 0308 ÷ 000A ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0E40 ÷ 0001 ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0E40 × 0308 ÷ 0001 ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0E40 × 0300 ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0E40 × 0308 × 0300 ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0E40 × 0E40 ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) × [9.2] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ 0E40 × 0308 ÷ 0E40 ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ 0E40 × 0903 ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0E40 × 0308 × 0903 ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0E40 × 1100 ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) × [9.2] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0E40 × 0308 ÷ 1100 ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0E40 × 1160 ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) × [9.2] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0E40 × 0308 ÷ 1160 ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0E40 × 11A8 ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) × [9.2] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0E40 × 0308 ÷ 11A8 ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0E40 × AC00 ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) × [9.2] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0E40 × 0308 ÷ AC00 ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0E40 × AC01 ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) × [9.2] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0E40 × 0308 ÷ AC01 ÷ # ÷ [0.2] THAI CHARACTER SARA E (Prepend) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0903 ÷ 0020 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0903 × 0308 ÷ 0020 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 0903 ÷ 000D ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [5.0] (CR) ÷ [0.3] +÷ 0903 × 0308 ÷ 000D ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 0903 ÷ 000A ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [5.0] (LF) ÷ [0.3] +÷ 0903 × 0308 ÷ 000A ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 0903 ÷ 0001 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [5.0] (Control) ÷ [0.3] +÷ 0903 × 0308 ÷ 0001 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 0903 × 0300 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0903 × 0308 × 0300 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 0903 ÷ 0E40 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ 0903 × 0308 ÷ 0E40 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ 0903 × 0903 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0903 × 0308 × 0903 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 0903 ÷ 1100 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0903 × 0308 ÷ 1100 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 0903 ÷ 1160 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0903 × 0308 ÷ 1160 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 0903 ÷ 11A8 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0903 × 0308 ÷ 11A8 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 0903 ÷ AC00 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0903 × 0308 ÷ AC00 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 0903 ÷ AC01 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 0903 × 0308 ÷ AC01 ÷ # ÷ [0.2] DEVANAGARI SIGN VISARGA (SpacingMark) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1100 ÷ 0020 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1100 × 0308 ÷ 0020 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1100 ÷ 000D ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [5.0] (CR) ÷ [0.3] +÷ 1100 × 0308 ÷ 000D ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 1100 ÷ 000A ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [5.0] (LF) ÷ [0.3] +÷ 1100 × 0308 ÷ 000A ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 1100 ÷ 0001 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [5.0] (Control) ÷ [0.3] +÷ 1100 × 0308 ÷ 0001 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 1100 × 0300 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1100 × 0308 × 0300 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1100 ÷ 0E40 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [999.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ 1100 × 0308 ÷ 0E40 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ 1100 × 0903 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1100 × 0308 × 0903 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1100 × 1100 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [6.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1100 × 0308 ÷ 1100 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1100 × 1160 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [6.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1100 × 0308 ÷ 1160 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1100 ÷ 11A8 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1100 × 0308 ÷ 11A8 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1100 × AC00 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [6.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1100 × 0308 ÷ AC00 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1100 × AC01 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [6.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1100 × 0308 ÷ AC01 ÷ # ÷ [0.2] HANGUL CHOSEONG KIYEOK (L) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1160 ÷ 0020 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1160 × 0308 ÷ 0020 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 1160 ÷ 000D ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [5.0] (CR) ÷ [0.3] +÷ 1160 × 0308 ÷ 000D ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 1160 ÷ 000A ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [5.0] (LF) ÷ [0.3] +÷ 1160 × 0308 ÷ 000A ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 1160 ÷ 0001 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [5.0] (Control) ÷ [0.3] +÷ 1160 × 0308 ÷ 0001 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 1160 × 0300 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1160 × 0308 × 0300 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 1160 ÷ 0E40 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ 1160 × 0308 ÷ 0E40 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ 1160 × 0903 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1160 × 0308 × 0903 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 1160 ÷ 1100 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1160 × 0308 ÷ 1100 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 1160 × 1160 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [7.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1160 × 0308 ÷ 1160 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 1160 × 11A8 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [7.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1160 × 0308 ÷ 11A8 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 1160 ÷ AC00 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1160 × 0308 ÷ AC00 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 1160 ÷ AC01 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 1160 × 0308 ÷ AC01 ÷ # ÷ [0.2] HANGUL JUNGSEONG FILLER (V) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 11A8 ÷ 0020 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 11A8 × 0308 ÷ 0020 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ 11A8 ÷ 000D ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [5.0] (CR) ÷ [0.3] +÷ 11A8 × 0308 ÷ 000D ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ 11A8 ÷ 000A ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [5.0] (LF) ÷ [0.3] +÷ 11A8 × 0308 ÷ 000A ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ 11A8 ÷ 0001 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [5.0] (Control) ÷ [0.3] +÷ 11A8 × 0308 ÷ 0001 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ 11A8 × 0300 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 11A8 × 0308 × 0300 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ 11A8 ÷ 0E40 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ 11A8 × 0308 ÷ 0E40 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ 11A8 × 0903 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 11A8 × 0308 × 0903 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ 11A8 ÷ 1100 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 11A8 × 0308 ÷ 1100 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ 11A8 ÷ 1160 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 11A8 × 0308 ÷ 1160 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ 11A8 × 11A8 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [8.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 11A8 × 0308 ÷ 11A8 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ 11A8 ÷ AC00 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 11A8 × 0308 ÷ AC00 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ 11A8 ÷ AC01 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ 11A8 × 0308 ÷ AC01 ÷ # ÷ [0.2] HANGUL JONGSEONG KIYEOK (T) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ AC00 ÷ 0020 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ AC00 × 0308 ÷ 0020 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ AC00 ÷ 000D ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [5.0] (CR) ÷ [0.3] +÷ AC00 × 0308 ÷ 000D ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ AC00 ÷ 000A ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [5.0] (LF) ÷ [0.3] +÷ AC00 × 0308 ÷ 000A ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ AC00 ÷ 0001 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [5.0] (Control) ÷ [0.3] +÷ AC00 × 0308 ÷ 0001 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ AC00 × 0300 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ AC00 × 0308 × 0300 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ AC00 ÷ 0E40 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ AC00 × 0308 ÷ 0E40 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ AC00 × 0903 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ AC00 × 0308 × 0903 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ AC00 ÷ 1100 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ AC00 × 0308 ÷ 1100 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ AC00 × 1160 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [7.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ AC00 × 0308 ÷ 1160 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ AC00 × 11A8 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [7.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ AC00 × 0308 ÷ 11A8 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ AC00 ÷ AC00 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ AC00 × 0308 ÷ AC00 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ AC00 ÷ AC01 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ AC00 × 0308 ÷ AC01 ÷ # ÷ [0.2] HANGUL SYLLABLE GA (LV) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ AC01 ÷ 0020 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ AC01 × 0308 ÷ 0020 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] SPACE (Other) ÷ [0.3] +÷ AC01 ÷ 000D ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [5.0] (CR) ÷ [0.3] +÷ AC01 × 0308 ÷ 000D ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (CR) ÷ [0.3] +÷ AC01 ÷ 000A ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [5.0] (LF) ÷ [0.3] +÷ AC01 × 0308 ÷ 000A ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (LF) ÷ [0.3] +÷ AC01 ÷ 0001 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [5.0] (Control) ÷ [0.3] +÷ AC01 × 0308 ÷ 0001 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [5.0] (Control) ÷ [0.3] +÷ AC01 × 0300 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ AC01 × 0308 × 0300 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) × [9.0] COMBINING GRAVE ACCENT (Extend) ÷ [0.3] +÷ AC01 ÷ 0E40 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ AC01 × 0308 ÷ 0E40 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] THAI CHARACTER SARA E (Prepend) ÷ [0.3] +÷ AC01 × 0903 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ AC01 × 0308 × 0903 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) × [9.1] DEVANAGARI SIGN VISARGA (SpacingMark) ÷ [0.3] +÷ AC01 ÷ 1100 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ AC01 × 0308 ÷ 1100 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL CHOSEONG KIYEOK (L) ÷ [0.3] +÷ AC01 ÷ 1160 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ AC01 × 0308 ÷ 1160 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JUNGSEONG FILLER (V) ÷ [0.3] +÷ AC01 × 11A8 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [8.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ AC01 × 0308 ÷ 11A8 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL JONGSEONG KIYEOK (T) ÷ [0.3] +÷ AC01 ÷ AC00 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ AC01 × 0308 ÷ AC00 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GA (LV) ÷ [0.3] +÷ AC01 ÷ AC01 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +÷ AC01 × 0308 ÷ AC01 ÷ # ÷ [0.2] HANGUL SYLLABLE GAG (LVT) × [9.0] COMBINING DIAERESIS (Extend) ÷ [999.0] HANGUL SYLLABLE GAG (LVT) ÷ [0.3] +# Lines: 288 diff --git a/tests/unigbrk/test-uc-is-grapheme-break.c b/tests/unigbrk/test-uc-is-grapheme-break.c new file mode 100644 --- /dev/null +++ b/tests/unigbrk/test-uc-is-grapheme-break.c @@ -0,0 +1,157 @@ +/* Grapheme cluster break function test. + Copyright (C) 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 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 + 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, see . */ + +/* Written by Ben Pfaff , 2010. */ + +#include + +/* Specification. */ +#include + +#include +#include +#include + +const char * +graphemebreakproperty_to_string (int gbp) +{ + printf ("%d\n", gbp); + switch (gbp) + { +#define CASE(VALUE) case GBP_##VALUE: return #VALUE; + CASE(OTHER) + CASE(CR) + CASE(LF) + CASE(CONTROL) + CASE(EXTEND) + CASE(PREPEND) + CASE(SPACINGMARK) + CASE(L) + CASE(V) + CASE(T) + CASE(LV) + CASE(LVT) + } + abort (); +} + +int +main (int argc, char *argv[]) +{ + const char *filename; + char line[1024]; + int exit_code; + FILE *stream; + int lineno; + + if (argc != 2) + { + fprintf (stderr, "usage: %s FILENAME\n" + "where FILENAME is the location of the GraphemeBreakTest.txt\n" + "test file.\n", argv[0]); + exit (1); + } + + filename = argv[1]; + stream = fopen (filename, "r"); + if (stream == NULL) + { + fprintf (stderr, "error during fopen of '%s'\n", filename); + exit (1); + } + + exit_code = 0; + lineno = 0; + while (fgets (line, sizeof line, stream)) + { + char *comment; + const char *p; + ucs4_t prev; + + lineno++; + + comment = strchr (line, '#'); + if (comment != NULL) + *comment = '\0'; + if (line[strspn (line, " \t\r\n")] == '\0') + continue; + + prev = 0; + p = line; + do + { + bool should_break; + ucs4_t next; + + p += strspn (p, " \t\r\n"); + if (!strncmp (p, "\xc3\xb7" /* ÷ */, 2)) + { + should_break = true; + p += 2; + } + else if (!strncmp (p, "\xc3\x97" /* × */, 2)) + { + should_break = false; + p += 2; + } + else + { + fprintf (stderr, "%s:%d.%d: syntax error expecting `÷' or `÷'\n", + filename, lineno, p - line + 1); + exit (1); + } + + p += strspn (p, " \t\r\n"); + if (*p == '\0') + next = 0; + else + { + unsigned int next_int; + int n; + + if (sscanf (p, "%x%n", &next_int, &n) != 1) + { + fprintf (stderr, "%s:%d.%d: syntax error at `%s' expecting " + "hexadecimal Unicode code point number\n", + filename, lineno, p - line + 1, p); + exit (1); + } + p += n; + + next = next_int; + } + + if (uc_is_grapheme_cluster_break (prev, next) != should_break) + { + int prev_gbp = uc_graphemeclusterbreak_property (prev); + int next_gbp = uc_graphemeclusterbreak_property (next); + fprintf (stderr, "%s:%d: should %s U+%04X (%s) and " + "U+%04X (%s)\n", + filename, lineno, + should_break ? "break" : "join", + prev, graphemebreakproperty_to_string (prev_gbp), + next, graphemebreakproperty_to_string (next_gbp)); + exit_code = 1; + } + + p += strspn (p, " \t\r\n"); + prev = next; + } + while (*p != '\0'); + } + + return exit_code; +} diff --git a/tests/unigbrk/test-uc-is-grapheme-break.sh b/tests/unigbrk/test-uc-is-grapheme-break.sh new file mode 100755 --- /dev/null +++ b/tests/unigbrk/test-uc-is-grapheme-break.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +./test-uc-is-grapheme-break${EXEEXT} "${srcdir}/unigbrk/GraphemeBreakTest.txt"