gl_GETADDRINFO
gl_FUNC_GETDELIM
gl_FUNC_GETLINE
+ AC_SUBST([LIBINTL])
+ AC_SUBST([LTLIBINTL])
gl_INET_NTOP
gl_INET_PTON
gl_HEADER_NETINET_IN
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+#ifdef __DECC
+# include_next <string.h>
+#endif
+
#ifndef _GL_STRING_H
#define _GL_STRING_H
# pragma GCC system_header
#endif
-#include @ABSOLUTE_STRING_H@
+#ifndef __DECC
+# include @ABSOLUTE_STRING_H@
+#endif
/* The definition of GL_LINK_WARNING is copied here. */
-e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \
-e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
-e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
+ -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
-e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
-e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
-e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
-e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
-e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
-e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
+ -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/stdio_.h; \
} > $@-t
## begin gnulib module vasnprintf
-EXTRA_DIST += asnprintf.c float+.h printf-args.c printf-args.h printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h
+EXTRA_DIST += asnprintf.c printf-args.c printf-args.h printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h
EXTRA_liblgnu_la_SOURCES += asnprintf.c printf-args.c printf-parse.c vasnprintf.c
+++ /dev/null
-/* Supplemental information about the floating-point formats.
- Copyright (C) 2007 Free Software Foundation, Inc.
- Written by Bruno Haible <bruno@clisp.org>, 2007.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#ifndef _FLOATPLUS_H
-#define _FLOATPLUS_H
-
-#include <float.h>
-#include <limits.h>
-
-/* Number of bits in the mantissa of a floating-point number, including the
- "hidden bit". */
-#if FLT_RADIX == 2
-# define FLT_MANT_BIT FLT_MANT_DIG
-# define DBL_MANT_BIT DBL_MANT_DIG
-# define LDBL_MANT_BIT LDBL_MANT_DIG
-#elif FLT_RADIX == 4
-# define FLT_MANT_BIT (FLT_MANT_DIG * 2)
-# define DBL_MANT_BIT (DBL_MANT_DIG * 2)
-# define LDBL_MANT_BIT (LDBL_MANT_DIG * 2)
-#elif FLT_RADIX == 16
-# define FLT_MANT_BIT (FLT_MANT_DIG * 4)
-# define DBL_MANT_BIT (DBL_MANT_DIG * 4)
-# define LDBL_MANT_BIT (LDBL_MANT_DIG * 4)
-#endif
-
-/* Bit mask that can be used to mask the exponent, as an unsigned number. */
-#define FLT_EXP_MASK ((FLT_MAX_EXP - FLT_MIN_EXP) | 7)
-#define DBL_EXP_MASK ((DBL_MAX_EXP - DBL_MIN_EXP) | 7)
-#define LDBL_EXP_MASK ((LDBL_MAX_EXP - LDBL_MIN_EXP) | 7)
-
-/* Number of bits used for the exponent of a floating-point number, including
- the exponent's sign. */
-#define FLT_EXP_BIT \
- (FLT_EXP_MASK < 0x100 ? 8 : \
- FLT_EXP_MASK < 0x200 ? 9 : \
- FLT_EXP_MASK < 0x400 ? 10 : \
- FLT_EXP_MASK < 0x800 ? 11 : \
- FLT_EXP_MASK < 0x1000 ? 12 : \
- FLT_EXP_MASK < 0x2000 ? 13 : \
- FLT_EXP_MASK < 0x4000 ? 14 : \
- FLT_EXP_MASK < 0x8000 ? 15 : \
- FLT_EXP_MASK < 0x10000 ? 16 : \
- FLT_EXP_MASK < 0x20000 ? 17 : \
- FLT_EXP_MASK < 0x40000 ? 18 : \
- FLT_EXP_MASK < 0x80000 ? 19 : \
- FLT_EXP_MASK < 0x100000 ? 20 : \
- FLT_EXP_MASK < 0x200000 ? 21 : \
- FLT_EXP_MASK < 0x400000 ? 22 : \
- FLT_EXP_MASK < 0x800000 ? 23 : \
- FLT_EXP_MASK < 0x1000000 ? 24 : \
- FLT_EXP_MASK < 0x2000000 ? 25 : \
- FLT_EXP_MASK < 0x4000000 ? 26 : \
- FLT_EXP_MASK < 0x8000000 ? 27 : \
- FLT_EXP_MASK < 0x10000000 ? 28 : \
- FLT_EXP_MASK < 0x20000000 ? 29 : \
- FLT_EXP_MASK < 0x40000000 ? 30 : \
- FLT_EXP_MASK <= 0x7fffffff ? 31 : \
- 32)
-#define DBL_EXP_BIT \
- (DBL_EXP_MASK < 0x100 ? 8 : \
- DBL_EXP_MASK < 0x200 ? 9 : \
- DBL_EXP_MASK < 0x400 ? 10 : \
- DBL_EXP_MASK < 0x800 ? 11 : \
- DBL_EXP_MASK < 0x1000 ? 12 : \
- DBL_EXP_MASK < 0x2000 ? 13 : \
- DBL_EXP_MASK < 0x4000 ? 14 : \
- DBL_EXP_MASK < 0x8000 ? 15 : \
- DBL_EXP_MASK < 0x10000 ? 16 : \
- DBL_EXP_MASK < 0x20000 ? 17 : \
- DBL_EXP_MASK < 0x40000 ? 18 : \
- DBL_EXP_MASK < 0x80000 ? 19 : \
- DBL_EXP_MASK < 0x100000 ? 20 : \
- DBL_EXP_MASK < 0x200000 ? 21 : \
- DBL_EXP_MASK < 0x400000 ? 22 : \
- DBL_EXP_MASK < 0x800000 ? 23 : \
- DBL_EXP_MASK < 0x1000000 ? 24 : \
- DBL_EXP_MASK < 0x2000000 ? 25 : \
- DBL_EXP_MASK < 0x4000000 ? 26 : \
- DBL_EXP_MASK < 0x8000000 ? 27 : \
- DBL_EXP_MASK < 0x10000000 ? 28 : \
- DBL_EXP_MASK < 0x20000000 ? 29 : \
- DBL_EXP_MASK < 0x40000000 ? 30 : \
- DBL_EXP_MASK <= 0x7fffffff ? 31 : \
- 32)
-#define LDBL_EXP_BIT \
- (LDBL_EXP_MASK < 0x100 ? 8 : \
- LDBL_EXP_MASK < 0x200 ? 9 : \
- LDBL_EXP_MASK < 0x400 ? 10 : \
- LDBL_EXP_MASK < 0x800 ? 11 : \
- LDBL_EXP_MASK < 0x1000 ? 12 : \
- LDBL_EXP_MASK < 0x2000 ? 13 : \
- LDBL_EXP_MASK < 0x4000 ? 14 : \
- LDBL_EXP_MASK < 0x8000 ? 15 : \
- LDBL_EXP_MASK < 0x10000 ? 16 : \
- LDBL_EXP_MASK < 0x20000 ? 17 : \
- LDBL_EXP_MASK < 0x40000 ? 18 : \
- LDBL_EXP_MASK < 0x80000 ? 19 : \
- LDBL_EXP_MASK < 0x100000 ? 20 : \
- LDBL_EXP_MASK < 0x200000 ? 21 : \
- LDBL_EXP_MASK < 0x400000 ? 22 : \
- LDBL_EXP_MASK < 0x800000 ? 23 : \
- LDBL_EXP_MASK < 0x1000000 ? 24 : \
- LDBL_EXP_MASK < 0x2000000 ? 25 : \
- LDBL_EXP_MASK < 0x4000000 ? 26 : \
- LDBL_EXP_MASK < 0x8000000 ? 27 : \
- LDBL_EXP_MASK < 0x10000000 ? 28 : \
- LDBL_EXP_MASK < 0x20000000 ? 29 : \
- LDBL_EXP_MASK < 0x40000000 ? 30 : \
- LDBL_EXP_MASK <= 0x7fffffff ? 31 : \
- 32)
-
-/* Number of bits used for a floating-point number: the mantissa (not
- counting the "hidden bit", since it may or may not be explicit), the
- exponent, and the sign. */
-#define FLT_TOTAL_BIT ((FLT_MANT_BIT - 1) + FLT_EXP_BIT + 1)
-#define DBL_TOTAL_BIT ((DBL_MANT_BIT - 1) + DBL_EXP_BIT + 1)
-#define LDBL_TOTAL_BIT ((LDBL_MANT_BIT - 1) + LDBL_EXP_BIT + 1)
-
-/* Number of bytes used for a floating-point number.
- This can be smaller than the 'sizeof'. For example, on i386 systems,
- 'long double' most often have LDBL_MANT_BIT = 64, LDBL_EXP_BIT = 16, hence
- LDBL_TOTAL_BIT = 80 bits, i.e. 10 bytes of consecutive memory, but
- sizeof (long double) = 12 or = 16. */
-#define SIZEOF_FLT ((FLT_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
-#define SIZEOF_DBL ((DBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
-#define SIZEOF_LDBL ((LDBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
-
-/* Verify that SIZEOF_FLT <= sizeof (float) etc. */
-typedef int verify_sizeof_flt[2 * (SIZEOF_FLT <= sizeof (float)) - 1];
-typedef int verify_sizeof_dbl[2 * (SIZEOF_DBL <= sizeof (double)) - 1];
-#if HAVE_LONG_DOUBLE
-typedef int verify_sizeof_ldbl[2 * (SIZEOF_LDBL <= sizeof (long double)) - 1];
-#endif
-
-#endif /* _FLOATPLUS_H */
gl_FUNC_GETPASS
dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac.
AM_GNU_GETTEXT_VERSION([0.16.1])
+ AC_SUBST([LIBINTL])
+ AC_SUBST([LTLIBINTL])
gl_FUNC_MEMMEM
gl_STRING_MODULE_INDICATOR([memmem])
gl_FUNC_MEMMOVE
lib/des.c
lib/des.h
lib/dummy.c
- lib/float+.h
lib/gc-gnulib.c
lib/gc-libgcrypt.c
lib/gc-pbkdf2-sha1.c
m4/lib-link.m4
m4/lib-prefix.m4
m4/lock.m4
- m4/longdouble.m4
m4/longlong.m4
m4/md2.m4
m4/md4.m4
-# intl.m4 serial 3 (gettext-0.16)
-dnl Copyright (C) 1995-2006 Free Software Foundation, Inc.
+# intl.m4 serial 4 (gettext-0.16.2)
+dnl Copyright (C) 1995-2007 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_REQUIRE([gl_VISIBILITY])dnl
AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])dnl
- AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
AC_REQUIRE([gt_TYPE_WINT_T])dnl
AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
+++ /dev/null
-# longdouble.m4 serial 2 (gettext-0.15)
-dnl Copyright (C) 2002-2003, 2006 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 From Bruno Haible.
-dnl Test whether the compiler supports the 'long double' type.
-dnl Prerequisite: AC_PROG_CC
-
-dnl This file is only needed in autoconf <= 2.59. Newer versions of autoconf
-dnl have a macro AC_TYPE_LONG_DOUBLE with identical semantics.
-
-AC_DEFUN([gt_TYPE_LONGDOUBLE],
-[
- AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
- [if test "$GCC" = yes; then
- gt_cv_c_long_double=yes
- else
- AC_TRY_COMPILE([
- /* The Stardent Vistra knows sizeof(long double), but does not support it. */
- long double foo = 0.0;
- /* On Ultrix 4.3 cc, long double is 4 and double is 8. */
- int array [2*(sizeof(long double) >= sizeof(double)) - 1];
- ], ,
- gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
- fi])
- if test $gt_cv_c_long_double = yes; then
- AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
- fi
-])
-# stdint.m4 serial 22
+# stdint.m4 serial 23
dnl Copyright (C) 2001-2002, 2004-2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
intmax_t i = INTMAX_MAX;
uintmax_t j = UINTMAX_MAX;
struct s {
- int check_PTRDIFF: PTRDIFF_MIN < 0 && 0 < PTRDIFF_MAX ? 1 : -1;
- int check_SIG_ATOMIC: SIG_ATOMIC_MIN <= 0 && 0 < SIG_ATOMIC_MAX ? 1 : -1;
- int check_SIZE: 0 < SIZE_MAX ? 1 : -1;
- int check_WCHAR: WCHAR_MIN <= 0 && 0 < WCHAR_MAX ? 1 : -1;
- int check_WINT: WINT_MIN <= 0 && 0 < WINT_MAX ? 1 : -1;
+ int check_PTRDIFF: PTRDIFF_MIN < (ptrdiff_t) 0 && (ptrdiff_t) 0 < PTRDIFF_MAX ? 1 : -1;
+ int check_SIG_ATOMIC: SIG_ATOMIC_MIN <= (sig_atomic_t) 0 && (sig_atomic_t) 0 < SIG_ATOMIC_MAX ? 1 : -1;
+ int check_SIZE: (size_t) 0 < SIZE_MAX ? 1 : -1;
+ int check_WCHAR: WCHAR_MIN <= (wchar_t) 0 && (wchar_t) 0 < WCHAR_MAX ? 1 : -1;
+ int check_WINT: WINT_MIN <= (wint_t) 0 && (wint_t) 0 < WINT_MAX ? 1 : -1;
/* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */
int check_UINT8_C:
GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF])
GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX])
GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF])
+ GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH])
dnl Assume proper GNU behavior unless another module says otherwise.
REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF])
REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF])
REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF])
HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF])
REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF])
+ REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH])
])
-# vasnprintf.m4 serial 11
+# vasnprintf.m4 serial 13
dnl Copyright (C) 2002-2004, 2006-2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
[
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
- AC_REQUIRE([gt_TYPE_LONGDOUBLE])
AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
])
AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
[
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
- AC_REQUIRE([gt_TYPE_LONGDOUBLE])
AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
AC_REQUIRE([AC_TYPE_SIZE_T])
[
AC_REQUIRE([AC_FUNC_ALLOCA])
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
- AC_REQUIRE([gt_TYPE_LONGDOUBLE])
AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
AC_CHECK_FUNCS(snprintf wcslen)
esac
])
+# Extra prerequisites of lib/vasnprintf.c for supporting the 'F' directive.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_F],
+[
+ AC_REQUIRE([gl_PRINTF_DIRECTIVE_F])
+ case "$gl_cv_func_printf_directive_f" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], 1,
+ [Define if the vasnprintf implementation needs special code for
+ the 'F' directive.])
+ ;;
+ esac
+])
+
# Prerequisites of lib/asnprintf.c.
AC_DEFUN([gl_PREREQ_ASNPRINTF],
[
case TYPE_DOUBLE:
ap->a.a_double = va_arg (args, double);
break;
-#if HAVE_LONG_DOUBLE
case TYPE_LONGDOUBLE:
ap->a.a_longdouble = va_arg (args, long double);
break;
-#endif
case TYPE_CHAR:
ap->a.a_char = va_arg (args, int);
break;
TYPE_ULONGLONGINT,
#endif
TYPE_DOUBLE,
-#if HAVE_LONG_DOUBLE
TYPE_LONGDOUBLE,
-#endif
TYPE_CHAR,
#if HAVE_WINT_T
TYPE_WIDE_CHAR,
#endif
float a_float;
double a_double;
-#if HAVE_LONG_DOUBLE
long double a_longdouble;
-#endif
int a_char;
#if HAVE_WINT_T
wint_t a_wide_char;
break;
case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
case 'a': case 'A':
-#if HAVE_LONG_DOUBLE
if (flags >= 16 || (flags & 4))
type = TYPE_LONGDOUBLE;
else
-#endif
- type = TYPE_DOUBLE;
+ type = TYPE_DOUBLE;
break;
case 'c':
if (flags >= 8)
#else
/* Normal invocation convention. */
+
+#ifdef __DECC
+# include_next <stdio.h>
+#endif
+
#ifndef _GL_STDIO_H
#define _GL_STDIO_H
-#include @ABSOLUTE_STDIO_H@
+#ifndef __DECC
+# include @ABSOLUTE_STDIO_H@
+#endif
#include <stdarg.h>
#include <stddef.h>
# endif
#endif
+#if @GNULIB_FFLUSH@ && @REPLACE_FFLUSH@
+# define fflush rpl_fflush
+ /* Flush all pending data on STREAM according to POSIX rules. Both
+ output and seekable input streams are supported. */
+ extern int fflush (FILE *gl_stream);
+#endif
+
#ifdef __cplusplus
}
#endif
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+#ifdef __DECC
+# include_next <string.h>
+#endif
+
#ifndef _GL_STRING_H
#define _GL_STRING_H
# pragma GCC system_header
#endif
-#include @ABSOLUTE_STRING_H@
+#ifndef __DECC
+# include @ABSOLUTE_STRING_H@
+#endif
/* The definition of GL_LINK_WARNING is copied here. */
#if defined __need_time_t || defined __need_clock_t || defined __need_timespec
# include @ABSOLUTE_TIME_H@
-#elif ! defined _GL_TIME_H
-# define _GL_TIME_H
-# include @ABSOLUTE_TIME_H@
+#else
+/* Normal invocation convention. */
-# ifdef __cplusplus
-extern "C" {
+# ifdef __DECC
+# include_next <time.h>
# endif
+# if ! defined _GL_TIME_H
+# define _GL_TIME_H
+
+# ifndef __DECC
+# include @ABSOLUTE_TIME_H@
+# endif
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
/* Some systems don't define struct timespec (e.g., AIX 4.1, Ultrix 4.3).
Or they define it with the wrong member names or define it in <sys/time.h>
(e.g., FreeBSD circa 1997). */
-# if ! @TIME_H_DEFINES_STRUCT_TIMESPEC@
-# if @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
-# include <sys/time.h>
-# else
-# undef timespec
-# define timespec rpl_timespec
+# if ! @TIME_H_DEFINES_STRUCT_TIMESPEC@
+# if @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
+# include <sys/time.h>
+# else
+# undef timespec
+# define timespec rpl_timespec
struct timespec
{
time_t tv_sec;
long int tv_nsec;
};
+# endif
# endif
-# endif
/* Sleep for at least RQTP seconds unless interrupted, If interrupted,
return -1 and store the remaining time into RMTP. See
<http://www.opengroup.org/susv3xsh/nanosleep.html>. */
-# if @REPLACE_NANOSLEEP@
-# define nanosleep rpl_nanosleep
+# if @REPLACE_NANOSLEEP@
+# define nanosleep rpl_nanosleep
int nanosleep (struct timespec const *__rqtp, struct timespec *__rmtp);
-# endif
+# endif
/* Convert TIMER to RESULT, assuming local time and UTC respectively. See
<http://www.opengroup.org/susv3xsh/localtime_r.html> and
<http://www.opengroup.org/susv3xsh/gmtime_r.html>. */
-# if @REPLACE_LOCALTIME_R@
-# undef localtime_r
-# define localtime_r rpl_localtime_r
-# undef gmtime_r
-# define gmtime_r rpl_gmtime_r
+# if @REPLACE_LOCALTIME_R@
+# undef localtime_r
+# define localtime_r rpl_localtime_r
+# undef gmtime_r
+# define gmtime_r rpl_gmtime_r
struct tm *localtime_r (time_t const *restrict __timer,
struct tm *restrict __result);
struct tm *gmtime_r (time_t const *restrict __timer,
struct tm *restrict __result);
-# endif
+# endif
/* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store
the resulting broken-down time into TM. See
<http://www.opengroup.org/susv3xsh/strptime.html>. */
-# if @REPLACE_STRPTIME@
-# undef strptime
-# define strptime rpl_strptime
+# if @REPLACE_STRPTIME@
+# undef strptime
+# define strptime rpl_strptime
char *strptime (char const *restrict __buf, char const *restrict __format,
struct tm *restrict __tm);
-# endif
+# endif
/* Convert TM to a time_t value, assuming UTC. */
-# if @REPLACE_TIMEGM@
-# undef timegm
-# define timegm rpl_timegm
+# if @REPLACE_TIMEGM@
+# undef timegm
+# define timegm rpl_timegm
time_t timegm (struct tm *__tm);
-#endif
+# endif
/* Encourage applications to avoid unsafe functions that can overrun
buffers when given outlandish struct tm values. Portable
applications should use strftime (or even sprintf) instead. */
-# if GNULIB_PORTCHECK
-# undef asctime
-# define asctime eschew_asctime
-# undef asctime_r
-# define asctime_r eschew_asctime_r
-# undef ctime
-# define ctime eschew_ctime
-# undef ctime_r
-# define ctime_r eschew_ctime_r
-# endif
+# if GNULIB_PORTCHECK
+# undef asctime
+# define asctime eschew_asctime
+# undef asctime_r
+# define asctime_r eschew_asctime_r
+# undef ctime
+# define ctime eschew_ctime
+# undef ctime_r
+# define ctime_r eschew_ctime_r
+# endif
-# ifdef __cplusplus
+# ifdef __cplusplus
}
-# endif
+# endif
+# endif
#endif
#include "xsize.h"
#if NEED_PRINTF_DIRECTIVE_A && !defined IN_LIBINTL
-# include "float+.h"
+# include <math.h>
# include "isnan.h"
# include "printf-frexp.h"
-# if HAVE_LONG_DOUBLE
-# include "isnanl-nolibm.h"
-# include "printf-frexpl.h"
-# include "fpucw.h"
-# endif
+# include "isnanl-nolibm.h"
+# include "printf-frexpl.h"
+# include "fpucw.h"
#endif
/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */
}
/* Allocate a temporary buffer of sufficient size. */
-# if HAVE_LONG_DOUBLE
if (type == TYPE_LONGDOUBLE)
tmp_length =
(unsigned int) ((LDBL_DIG + 1)
)
+ 1; /* turn floor into ceil */
else
-# endif
tmp_length =
(unsigned int) ((DBL_DIG + 1)
* 0.831 /* decimal -> hexadecimal */
pad_ptr = NULL;
p = tmp;
-# if HAVE_LONG_DOUBLE
if (type == TYPE_LONGDOUBLE)
{
long double arg = a.arg[dp->arg_index].a.a_longdouble;
BEGIN_LONG_DOUBLE_ROUNDING ();
- if (arg < 0.0L)
+ if (signbit (arg)) /* arg < 0.0L or negative zero */
{
sign = -1;
arg = -arg;
}
- else if (arg == 0.0L)
- {
- /* Distinguish 0.0L and -0.0L. */
- static long double plus_zero = 0.0L;
- long double arg_mem = arg;
- if (memcmp (&plus_zero, &arg_mem, SIZEOF_LDBL) != 0)
- {
- sign = -1;
- arg = -arg;
- }
- }
if (sign < 0)
*p++ = '-';
}
}
*p++ = dp->conversion - 'A' + 'P';
-# if WIDE_CHAR_VERSION
+# if WIDE_CHAR_VERSION
{
static const wchar_t decimal_format[] =
{ '%', '+', 'd', '\0' };
SNPRINTF (p, 6 + 1, decimal_format, exponent);
}
-# else
+# else
sprintf (p, "%+d", exponent);
-# endif
+# endif
while (*p != '\0')
p++;
}
}
}
else
-# endif
{
double arg = a.arg[dp->arg_index].a.a_double;
{
int sign = 0;
- if (arg < 0.0)
+ if (signbit (arg)) /* arg < 0.0 or negative zero */
{
sign = -1;
arg = -arg;
}
- else if (arg == 0.0)
- {
- /* Distinguish 0.0 and -0.0. */
- static double plus_zero = 0.0;
- double arg_mem = arg;
- if (memcmp (&plus_zero, &arg_mem, SIZEOF_DBL) != 0)
- {
- sign = -1;
- arg = -arg;
- }
- }
if (sign < 0)
*p++ = '-';
break;
case 'f': case 'F':
-# if HAVE_LONG_DOUBLE
if (type == TYPE_LONGDOUBLE)
tmp_length =
(unsigned int) (LDBL_MAX_EXP
+ 1 /* turn floor into ceil */
+ 10; /* sign, decimal point etc. */
else
-# endif
tmp_length =
(unsigned int) (DBL_MAX_EXP
* 0.30103 /* binary -> decimal */
break;
case 'a': case 'A':
-# if HAVE_LONG_DOUBLE
if (type == TYPE_LONGDOUBLE)
tmp_length =
(unsigned int) (LDBL_DIG
)
+ 1; /* turn floor into ceil */
else
-# endif
tmp_length =
(unsigned int) (DBL_DIG
* 0.831 /* decimal -> hexadecimal */
#endif
*p++ = 'l';
break;
-#if HAVE_LONG_DOUBLE
case TYPE_LONGDOUBLE:
*p++ = 'L';
break;
-#endif
default:
break;
}
- *p = dp->conversion;
+#if NEED_PRINTF_DIRECTIVE_F
+ if (dp->conversion == 'F')
+ *p = 'f';
+ else
+#endif
+ *p = dp->conversion;
#if USE_SNPRINTF
p[1] = '%';
p[2] = 'n';
SNPRINTF_BUF (arg);
}
break;
-#if HAVE_LONG_DOUBLE
case TYPE_LONGDOUBLE:
{
long double arg = a.arg[dp->arg_index].a.a_longdouble;
SNPRINTF_BUF (arg);
}
break;
-#endif
case TYPE_CHAR:
{
int arg = a.arg[dp->arg_index].a.a_char;
free (tmp);
#endif
+#if NEED_PRINTF_DIRECTIVE_F
+ if (dp->conversion == 'F')
+ {
+ /* Convert the %f result to upper case for %F. */
+ CHAR_T *rp = result + length;
+ size_t rc;
+ for (rc = count; rc > 0; rc--, rp++)
+ if (*rp >= 'a' && *rp <= 'z')
+ *rp = *rp - 'a' + 'A';
+ }
+#endif
+
length += count;
break;
}
* For now, this just ensures proper prerequisite inclusion order.
*/
+#ifdef __DECC
+# include <stdio.h>
+# include_next <wchar.h>
+#endif
+
#ifndef _GL_WCHAR_H
#define _GL_WCHAR_H
#include <time.h>
/* Include the original <wchar.h>. */
-#include @ABSOLUTE_WCHAR_H@
+#ifndef __DECC
+# include @ABSOLUTE_WCHAR_H@
+#endif
#endif /* _GL_WCHAR_H */