diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-06-15 11:50:18 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-06-15 11:50:18 -0700 |
commit | 8c9b210626493dd93f236d7fb312c4f6dba62892 (patch) | |
tree | f7f0c345546eabd662d3ae855e1fbfc9a62bd43a /lib | |
parent | eeafcea7ee4c253678e842342e0ea8ea0d442f30 (diff) | |
download | emacs-8c9b210626493dd93f236d7fb312c4f6dba62892.tar.gz |
* lib/ftoastr.c, lib/stdio.in.h, lib/verify.h: Merge from gnulib.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ftoastr.c | 14 | ||||
-rw-r--r-- | lib/stdio.in.h | 38 | ||||
-rw-r--r-- | lib/verify.h | 10 |
3 files changed, 17 insertions, 45 deletions
diff --git a/lib/ftoastr.c b/lib/ftoastr.c index ff3d87ce22d..7c99ef00f38 100644 --- a/lib/ftoastr.c +++ b/lib/ftoastr.c @@ -40,14 +40,15 @@ # define FLOAT_MIN LDBL_MIN # define FLOAT_PREC_BOUND _GL_LDBL_PREC_BOUND # define FTOASTR ldtoastr -# define STRTOF strtold +# if HAVE_C99_STRTOLD +# define STRTOF strtold +# endif #elif LENGTH == 2 # define FLOAT double # define FLOAT_DIG DBL_DIG # define FLOAT_MIN DBL_MIN # define FLOAT_PREC_BOUND _GL_DBL_PREC_BOUND # define FTOASTR dtoastr -# define STRTOF strtod #else # define LENGTH 1 # define FLOAT float @@ -55,14 +56,15 @@ # define FLOAT_MIN FLT_MIN # define FLOAT_PREC_BOUND _GL_FLT_PREC_BOUND # define FTOASTR ftoastr -# define STRTOF strtof +# if HAVE_STRTOF +# define STRTOF strtof +# endif #endif /* On pre-C99 hosts, approximate strtof and strtold with strtod. This may generate one or two extra digits, but that's better than not - working at all. Assume that strtof works if strtold does. */ -#if LENGTH != 2 && ! HAVE_C99_STRTOLD -# undef STRTOF + working at all. */ +#ifndef STRTOF # define STRTOF strtod #endif diff --git a/lib/stdio.in.h b/lib/stdio.in.h index 81d3d71842c..473c84ce3e4 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -461,25 +461,6 @@ _GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence) _GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)); # endif _GL_CXXALIASWARN (fseeko); -# if (@REPLACE_FSEEKO@ || !@HAVE_FSEEKO@) && !@GNULIB_FSEEK@ - /* Provide an fseek function that is consistent with fseeko. */ - /* In order to avoid that fseek gets defined as a macro here, the - developer can request the 'fseek' module. */ -# if !GNULIB_defined_fseek_function -# undef fseek -# define fseek rpl_fseek -static inline int _GL_ARG_NONNULL ((1)) -rpl_fseek (FILE *fp, long offset, int whence) -{ -# if @REPLACE_FSEEKO@ - return rpl_fseeko (fp, offset, whence); -# else - return fseeko (fp, offset, whence); -# endif -} -# define GNULIB_defined_fseek_function 1 -# endif -# endif #elif defined GNULIB_POSIXCHECK # define _GL_FSEEK_WARN /* Category 1, above. */ # undef fseek @@ -539,25 +520,6 @@ _GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp)); # endif _GL_CXXALIASWARN (ftello); -# if (@REPLACE_FTELLO@ || !@HAVE_FTELLO@) && !@GNULIB_FTELL@ - /* Provide an ftell function that is consistent with ftello. */ - /* In order to avoid that ftell gets defined as a macro here, the - developer can request the 'ftell' module. */ -# if !GNULIB_defined_ftell_function -# undef ftell -# define ftell rpl_ftell -static inline long _GL_ARG_NONNULL ((1)) -rpl_ftell (FILE *f) -{ -# if @REPLACE_FTELLO@ - return rpl_ftello (f); -# else - return ftello (f); -# endif -} -# define GNULIB_defined_ftell_function 1 -# endif -# endif #elif defined GNULIB_POSIXCHECK # define _GL_FTELL_WARN /* Category 1, above. */ # undef ftell diff --git a/lib/verify.h b/lib/verify.h index c6d30a35af9..9a8caad001d 100644 --- a/lib/verify.h +++ b/lib/verify.h @@ -221,10 +221,18 @@ template <int w> contexts, e.g., the top level. */ /* Verify requirement R at compile-time, as an integer constant expression. - Return 1. */ + Return 1. This is equivalent to verify_expr (R, 1). + + verify_true is obsolescent; please use verify_expr instead. */ # define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")") +/* Verify requirement R at compile-time. Return the value of the + expression E. */ + +# define verify_expr(R, E) \ + (_GL_VERIFY_TRUE (R, "verify_expr (" #R ", " #E ")") ? (E) : (E)) + /* Verify requirement R at compile-time, as a declaration without a trailing ';'. */ |