diff options
Diffstat (limited to 'Build/source')
-rw-r--r-- | Build/source/libs/obsdcompat/ChangeLog | 9 | ||||
-rw-r--r-- | Build/source/libs/obsdcompat/Makefile.am | 4 | ||||
-rw-r--r-- | Build/source/libs/obsdcompat/Makefile.in | 7 | ||||
-rwxr-xr-x | Build/source/libs/obsdcompat/configure | 330 | ||||
-rw-r--r-- | Build/source/libs/obsdcompat/configure.ac | 124 | ||||
-rw-r--r-- | Build/source/libs/obsdcompat/defines.h | 22 | ||||
-rw-r--r-- | Build/source/libs/obsdcompat/includes.h | 16 | ||||
-rw-r--r-- | Build/source/libs/obsdcompat/obsdcompat/config.h.in | 24 | ||||
-rw-r--r-- | Build/source/libs/obsdcompat/openbsd-compat.h | 12 | ||||
-rw-r--r-- | Build/source/libs/obsdcompat/strtoll.c | 148 | ||||
-rw-r--r-- | Build/source/libs/obsdcompat/strtonum.c | 72 |
11 files changed, 15 insertions, 753 deletions
diff --git a/Build/source/libs/obsdcompat/ChangeLog b/Build/source/libs/obsdcompat/ChangeLog index 99b14d0c8b6..1858439688d 100644 --- a/Build/source/libs/obsdcompat/ChangeLog +++ b/Build/source/libs/obsdcompat/ChangeLog @@ -1,3 +1,12 @@ +2012-09-27 Peter Breitenlohner <peb@mppmu.mpg.de> + + * strtoll.c, strtonum.c (removed): We don't use these functions. + * Makefile.am (libopenbsd_compat_a_SOURCES): Drop these files. + * openbsd-compat.h: Drop decarations for strtoll(), strtonum(). + * includes.h: Drop '#include <fcntl.h>', O_NONBLOCK is unused. + * configure.ac: Drop everything for 'long double', 'long long', + and 64-bit integers. + 2012-08-01 Peter Breitenlohner <peb@mppmu.mpg.de> * bsd-snprintf.c (removed): We no longer need [v]snprintf(). diff --git a/Build/source/libs/obsdcompat/Makefile.am b/Build/source/libs/obsdcompat/Makefile.am index 4aa47a5c38b..33a371e8c1b 100644 --- a/Build/source/libs/obsdcompat/Makefile.am +++ b/Build/source/libs/obsdcompat/Makefile.am @@ -1,6 +1,6 @@ ## Makefile.am for the TeX Live subdirectory libs/obsdcompat/ ## -## Copyright (C) 2009, 2012 Peter Breitenlohner <tex-live@tug.org> +## Copyright (C) 2009-2012 Peter Breitenlohner <tex-live@tug.org> ## You may freely use, modify and/or distribute this file. ## ACLOCAL_AMFLAGS = -I ../../m4 @@ -18,7 +18,5 @@ libopenbsd_compat_a_SOURCES = \ strlcat.c \ strlcpy.c \ strsep.c \ - strtoll.c \ - strtonum.c \ strtoul.c diff --git a/Build/source/libs/obsdcompat/Makefile.in b/Build/source/libs/obsdcompat/Makefile.in index 1843a796dda..c0bf5d14765 100644 --- a/Build/source/libs/obsdcompat/Makefile.in +++ b/Build/source/libs/obsdcompat/Makefile.in @@ -78,8 +78,7 @@ ARFLAGS = cru libopenbsd_compat_a_AR = $(AR) $(ARFLAGS) libopenbsd_compat_a_LIBADD = am_libopenbsd_compat_a_OBJECTS = strlcat.$(OBJEXT) strlcpy.$(OBJEXT) \ - strsep.$(OBJEXT) strtoll.$(OBJEXT) strtonum.$(OBJEXT) \ - strtoul.$(OBJEXT) + strsep.$(OBJEXT) strtoul.$(OBJEXT) libopenbsd_compat_a_OBJECTS = $(am_libopenbsd_compat_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/obsdcompat depcomp = $(SHELL) $(top_srcdir)/../../build-aux/depcomp @@ -229,8 +228,6 @@ libopenbsd_compat_a_SOURCES = \ strlcat.c \ strlcpy.c \ strsep.c \ - strtoll.c \ - strtonum.c \ strtoul.c all: all-am @@ -303,8 +300,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strlcat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strlcpy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strsep.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoll.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtonum.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoul.Po@am__quote@ .c.o: diff --git a/Build/source/libs/obsdcompat/configure b/Build/source/libs/obsdcompat/configure index eb43f985101..fe3c05ef8b6 100755 --- a/Build/source/libs/obsdcompat/configure +++ b/Build/source/libs/obsdcompat/configure @@ -1876,60 +1876,6 @@ $as_echo "$ac_res" >&6; } } # ac_fn_c_check_func -# ac_fn_c_check_type LINENO TYPE VAR INCLUDES -# ------------------------------------------- -# Tests whether TYPE exists after having included INCLUDES, setting cache -# variable VAR accordingly. -ac_fn_c_check_type () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_type - # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes @@ -5890,36 +5836,6 @@ done fi -# Check for long long datatypes -ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default" -if test "x$ac_cv_type_long_long" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_LONG_LONG 1 -_ACEOF - - -fi -ac_fn_c_check_type "$LINENO" "unsigned long long" "ac_cv_type_unsigned_long_long" "$ac_includes_default" -if test "x$ac_cv_type_unsigned_long_long" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_UNSIGNED_LONG_LONG 1 -_ACEOF - - -fi -ac_fn_c_check_type "$LINENO" "long double" "ac_cv_type_long_double" "$ac_includes_default" -if test "x$ac_cv_type_long_double" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_LONG_DOUBLE 1 -_ACEOF - - -fi - - # Check datatype sizes # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects @@ -6053,145 +5969,6 @@ cat >>confdefs.h <<_ACEOF _ACEOF -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long int" >&5 -$as_echo_n "checking size of long long int... " >&6; } -if ${ac_cv_sizeof_long_long_int+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long int))" "ac_cv_sizeof_long_long_int" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_long_long_int" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (long long int) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_long_long_int=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long_int" >&5 -$as_echo "$ac_cv_sizeof_long_long_int" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_LONG_INT $ac_cv_sizeof_long_long_int -_ACEOF - - - -# Sanity check long long for some platforms (AIX) -if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then - ac_cv_sizeof_long_long_int=0 -fi - -# compute LLONG_MIN and LLONG_MAX if we don't know them. -if test -z "$have_llong_max"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for max value of long long" >&5 -$as_echo_n "checking for max value of long long... " >&6; } - if test "$cross_compiling" = yes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: not checking" >&5 -$as_echo "$as_me: WARNING: cross compiling: not checking" >&2;} - - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdio.h> -/* Why is this so damn hard? */ -#ifdef __GNUC__ -# undef __GNUC__ -#endif -#define __USE_ISOC99 -#include <limits.h> -#define DATA "conftest.llminmax" -int main(void) { - FILE *f; - long long i, llmin, llmax = 0; - - if((f = fopen(DATA,"w")) == NULL) - exit(1); - -#if defined(LLONG_MIN) && defined(LLONG_MAX) - fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n"); - llmin = LLONG_MIN; - llmax = LLONG_MAX; -#else - fprintf(stderr, "Calculating LLONG_MIN and LLONG_MAX\n"); - /* This will work on one's complement and two's complement */ - for (i = 1; i > llmax; i <<= 1, i++) - llmax = i; - llmin = llmax + 1LL; /* wrap */ -#endif - - /* Sanity check */ - if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax - || llmax - 1 > llmax) { - fprintf(f, "unknown unknown\n"); - exit(2); - } - - if (fprintf(f ,"%lld %lld", llmin, llmax) < 0) - exit(3); - - exit(0); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - - llong_min=`$AWK '{print $1}' conftest.llminmax` - llong_max=`$AWK '{print $2}' conftest.llminmax` - - # snprintf on some Tru64s doesn't understand "%lld" - case "$host" in - alpha-dec-osf*) - if test "x$ac_cv_sizeof_long_long_int" = "x8" && - test "x$llong_max" = "xld"; then - llong_min="-9223372036854775808" - llong_max="9223372036854775807" - fi - ;; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $llong_max" >&5 -$as_echo "$llong_max" >&6; } - -cat >>confdefs.h <<_ACEOF -#define LLONG_MAX ${llong_max}LL -_ACEOF - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for min value of long long" >&5 -$as_echo_n "checking for min value of long long... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $llong_min" >&5 -$as_echo "$llong_min" >&6; } - -cat >>confdefs.h <<_ACEOF -#define LLONG_MIN ${llong_min}LL -_ACEOF - - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi - # More checks for data types { $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_int type" >&5 @@ -6295,49 +6072,6 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for int64_t type" >&5 -$as_echo_n "checking for int64_t type... " >&6; } -if ${ac_cv_have_int64_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <sys/types.h> -#ifdef HAVE_STDINT_H -# include <stdint.h> -#endif -#include <sys/socket.h> -#ifdef HAVE_SYS_BITYPES_H -# include <sys/bitypes.h> -#endif - -int -main () -{ - int64_t a; a = 1; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_have_int64_t="yes" -else - ac_cv_have_int64_t="no" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_int64_t" >&5 -$as_echo "$ac_cv_have_int64_t" >&6; } -if test "x$ac_cv_have_int64_t" = "xyes" ; then - -$as_echo "#define HAVE_INT64_T 1" >>confdefs.h - -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_intXX_t types" >&5 $as_echo_n "checking for u_intXX_t types... " >&6; } if ${ac_cv_have_u_intxx_t+:} false; then : @@ -6402,70 +6136,6 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_int64_t types" >&5 -$as_echo_n "checking for u_int64_t types... " >&6; } -if ${ac_cv_have_u_int64_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - #include <sys/types.h> -int -main () -{ - u_int64_t a; a = 1; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_have_u_int64_t="yes" -else - ac_cv_have_u_int64_t="no" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_u_int64_t" >&5 -$as_echo "$ac_cv_have_u_int64_t" >&6; } -if test "x$ac_cv_have_u_int64_t" = "xyes" ; then - -$as_echo "#define HAVE_U_INT64_T 1" >>confdefs.h - - have_u_int64_t=1 -fi - -if test -z "$have_u_int64_t" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_int64_t type in sys/bitypes.h" >&5 -$as_echo_n "checking for u_int64_t type in sys/bitypes.h... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - #include <sys/bitypes.h> -int -main () -{ - u_int64_t a; a = 1 - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - $as_echo "#define HAVE_U_INT64_T 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - if test -z "$have_u_intxx_t" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uintXX_t types" >&5 $as_echo_n "checking for uintXX_t types... " >&6; } diff --git a/Build/source/libs/obsdcompat/configure.ac b/Build/source/libs/obsdcompat/configure.ac index 9a2eb368f2a..c201764106e 100644 --- a/Build/source/libs/obsdcompat/configure.ac +++ b/Build/source/libs/obsdcompat/configure.ac @@ -18,7 +18,7 @@ # --------------------------------------------------------------------------- # # Modified (butchered) 2006 by Martin Schröder for pdfTeX -# Modified 2009 by Peter Breitenlohner for new TeX Live build system +# Modified 2009-2012 by Peter Breitenlohner for TeX Live AC_INIT([OpenBSD-Compat], [Portable], [tex-k@tug.org]) AC_REVISION($Revision: 1.322.2.6 $) @@ -322,98 +322,11 @@ AC_CHECK_DECL(strsep, #endif ]) -# Check for long long datatypes -AC_CHECK_TYPES([long long, unsigned long long, long double]) - # Check datatype sizes AC_CHECK_SIZEOF(char, 1) AC_CHECK_SIZEOF(short int, 2) AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long int, 4) -AC_CHECK_SIZEOF(long long int, 8) - -# Sanity check long long for some platforms (AIX) -if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then - ac_cv_sizeof_long_long_int=0 -fi - -# compute LLONG_MIN and LLONG_MAX if we don't know them. -if test -z "$have_llong_max"; then - AC_MSG_CHECKING([for max value of long long]) - AC_RUN_IFELSE( - [AC_LANG_SOURCE([[ -#include <stdio.h> -/* Why is this so damn hard? */ -#ifdef __GNUC__ -# undef __GNUC__ -#endif -#define __USE_ISOC99 -#include <limits.h> -#define DATA "conftest.llminmax" -int main(void) { - FILE *f; - long long i, llmin, llmax = 0; - - if((f = fopen(DATA,"w")) == NULL) - exit(1); - -#if defined(LLONG_MIN) && defined(LLONG_MAX) - fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n"); - llmin = LLONG_MIN; - llmax = LLONG_MAX; -#else - fprintf(stderr, "Calculating LLONG_MIN and LLONG_MAX\n"); - /* This will work on one's complement and two's complement */ - for (i = 1; i > llmax; i <<= 1, i++) - llmax = i; - llmin = llmax + 1LL; /* wrap */ -#endif - - /* Sanity check */ - if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax - || llmax - 1 > llmax) { - fprintf(f, "unknown unknown\n"); - exit(2); - } - - if (fprintf(f ,"%lld %lld", llmin, llmax) < 0) - exit(3); - - exit(0); -} - ]])], - [ - llong_min=`$AWK '{print $1}' conftest.llminmax` - llong_max=`$AWK '{print $2}' conftest.llminmax` - - # snprintf on some Tru64s doesn't understand "%lld" - case "$host" in - alpha-dec-osf*) - if test "x$ac_cv_sizeof_long_long_int" = "x8" && - test "x$llong_max" = "xld"; then - llong_min="-9223372036854775808" - llong_max="9223372036854775807" - fi - ;; - esac - - AC_MSG_RESULT($llong_max) - AC_DEFINE_UNQUOTED(LLONG_MAX, [${llong_max}LL], - [max value of long long calculated by configure]) - AC_MSG_CHECKING([for min value of long long]) - AC_MSG_RESULT($llong_min) - AC_DEFINE_UNQUOTED(LLONG_MIN, [${llong_min}LL], - [min value of long long calculated by configure]) - ], - [ - AC_MSG_RESULT(not found) - ], - [ - AC_MSG_WARN([cross compiling: not checking]) - ] - ) -fi - # More checks for data types AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [ @@ -445,23 +358,6 @@ then ]) fi -AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include <sys/types.h> -#ifdef HAVE_STDINT_H -# include <stdint.h> -#endif -#include <sys/socket.h> -#ifdef HAVE_SYS_BITYPES_H -# include <sys/bitypes.h> -#endif - ]], [[ int64_t a; a = 1;]])],[ ac_cv_have_int64_t="yes" ],[ ac_cv_have_int64_t="no" - ]) -]) -if test "x$ac_cv_have_int64_t" = "xyes" ; then - AC_DEFINE(HAVE_INT64_T, 1, [define if you have int64_t data type]) -fi - AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], [[ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;]])],[ ac_cv_have_u_intxx_t="yes" ],[ ac_cv_have_u_intxx_t="no" ]) @@ -480,24 +376,6 @@ if test -z "$have_u_intxx_t" ; then ]) fi -AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], [[ u_int64_t a; a = 1;]])],[ ac_cv_have_u_int64_t="yes" ],[ ac_cv_have_u_int64_t="no" - ]) -]) -if test "x$ac_cv_have_u_int64_t" = "xyes" ; then - AC_DEFINE(HAVE_U_INT64_T, 1, [define if you have u_int64_t data type]) - have_u_int64_t=1 -fi - -if test -z "$have_u_int64_t" ; then - AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/bitypes.h> ]], [[ u_int64_t a; a = 1]])],[ - AC_DEFINE(HAVE_U_INT64_T) - AC_MSG_RESULT(yes) - ],[ AC_MSG_RESULT(no) - ]) -fi - if test -z "$have_u_intxx_t" ; then AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ diff --git a/Build/source/libs/obsdcompat/defines.h b/Build/source/libs/obsdcompat/defines.h index 71e90193ca7..65f22d3b967 100644 --- a/Build/source/libs/obsdcompat/defines.h +++ b/Build/source/libs/obsdcompat/defines.h @@ -24,7 +24,7 @@ * --------------------------------------------------------------------------- * * Modified (butchered) 2006 by Martin Schröder for pdfTeX - * Modified 2009 by Peter Breitenlohner for new TeX Live build system + * Modified 2009-2012 by Peter Breitenlohner for TeX Live */ #ifndef _DEFINES_H @@ -112,26 +112,6 @@ typedef unsigned long u_int32_t; #define __BIT_TYPES_DEFINED__ #endif -/* 64-bit types */ -#ifndef HAVE_INT64_T -# if (SIZEOF_LONG_INT == 8) -typedef long int int64_t; -# else -# if (SIZEOF_LONG_LONG_INT == 8) -typedef long long int int64_t; -# endif -# endif -#endif -#ifndef HAVE_U_INT64_T -# if (SIZEOF_LONG_INT == 8) -typedef unsigned long int u_int64_t; -# else -# if (SIZEOF_LONG_LONG_INT == 8) -typedef unsigned long long int u_int64_t; -# endif -# endif -#endif - #ifndef HAVE_U_CHAR typedef unsigned char u_char; # define HAVE_U_CHAR diff --git a/Build/source/libs/obsdcompat/includes.h b/Build/source/libs/obsdcompat/includes.h index 2a3b1539ab5..0986257e46b 100644 --- a/Build/source/libs/obsdcompat/includes.h +++ b/Build/source/libs/obsdcompat/includes.h @@ -15,6 +15,7 @@ * --------------------------------------------------------------------------- * * Modified (butchered) 2006 by Martin Schröder for pdfTeX + * Modified 2009-2012 by Peter Breitenlohner for TeX Live * */ @@ -34,21 +35,6 @@ static /**/const char *const rcsid[] = { (const char *)rcsid, "\100(#)" msg } #include <stdio.h> #include <ctype.h> #include <errno.h> -#ifdef __MINGW32__ -/* In mingw32, the eof() function is part of the !_NO_OLDNAMES section - of <io.h>, that is read in automatically via <fcntl.h>. We cannot - allow that because web2c/lib/eofeoln.c defines a private, - incompatible function named eof(). - But many of the other things defined via !_NO_OLDNAMES are needed, - so #define _NO_OLDNAMES cannot be used. So, temporarily define eof - as a macro. -*/ -#define eof saved_eof -#include <fcntl.h> /* For O_NONBLOCK */ -#undef eof -#else -#include <fcntl.h> /* For O_NONBLOCK */ -#endif #include <stdlib.h> #include <string.h> #include <stdarg.h> diff --git a/Build/source/libs/obsdcompat/obsdcompat/config.h.in b/Build/source/libs/obsdcompat/obsdcompat/config.h.in index baa5dcc5c03..353f71d46c7 100644 --- a/Build/source/libs/obsdcompat/obsdcompat/config.h.in +++ b/Build/source/libs/obsdcompat/obsdcompat/config.h.in @@ -24,9 +24,6 @@ /* Define to 1 if you have the <floatingpoint.h> header file. */ #undef HAVE_FLOATINGPOINT_H -/* define if you have int64_t data type */ -#undef HAVE_INT64_T - /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H @@ -39,12 +36,6 @@ /* Define to 1 if you have the <limits.h> header file. */ #undef HAVE_LIMITS_H -/* Define to 1 if the system has the type `long double'. */ -#undef HAVE_LONG_DOUBLE - -/* Define to 1 if the system has the type `long long'. */ -#undef HAVE_LONG_LONG - /* Define to 1 if you have the <memory.h> header file. */ #undef HAVE_MEMORY_H @@ -120,9 +111,6 @@ /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H -/* Define to 1 if the system has the type `unsigned long long'. */ -#undef HAVE_UNSIGNED_LONG_LONG - /* Define to 1 if you have the <util.h> header file. */ #undef HAVE_UTIL_H @@ -132,18 +120,9 @@ /* define if you have u_int data type */ #undef HAVE_U_INT -/* define if you have u_int64_t data type */ -#undef HAVE_U_INT64_T - /* define if you have u_intxx_t data type */ #undef HAVE_U_INTXX_T -/* max value of long long calculated by configure */ -#undef LLONG_MAX - -/* min value of long long calculated by configure */ -#undef LLONG_MIN - /* Name of package */ #undef PACKAGE @@ -174,9 +153,6 @@ /* The size of `long int', as computed by sizeof. */ #undef SIZEOF_LONG_INT -/* The size of `long long int', as computed by sizeof. */ -#undef SIZEOF_LONG_LONG_INT - /* The size of `short int', as computed by sizeof. */ #undef SIZEOF_SHORT_INT diff --git a/Build/source/libs/obsdcompat/openbsd-compat.h b/Build/source/libs/obsdcompat/openbsd-compat.h index e0b175ee21d..afe0c083f36 100644 --- a/Build/source/libs/obsdcompat/openbsd-compat.h +++ b/Build/source/libs/obsdcompat/openbsd-compat.h @@ -28,7 +28,7 @@ * --------------------------------------------------------------------------- * * Modified (butchered) 2006 by Martin Schröder for pdfTeX - * Modified 2009 by Peter Breitenlohner for new TeX Live build system + * Modified 2009-2012 by Peter Breitenlohner for TeX Live */ #ifndef _OPENBSD_COMPAT_H @@ -57,14 +57,4 @@ size_t strlcpy(char *dst, const char *src, size_t siz); char *strsep(char **stringp, const char *delim); #endif -#ifndef HAVE_STRTOLL -/* see http://www.openbsd.org/cgi-bin/man.cgi?query=strtoll */ -long long strtoll(const char *, char **, int); -#endif - -#ifndef HAVE_STRTONUM -/* see http://www.openbsd.org/cgi-bin/man.cgi?query=strtonum */ -long long strtonum(const char *, long long, long long, const char **); -#endif - #endif /* _OPENBSD_COMPAT_H */ diff --git a/Build/source/libs/obsdcompat/strtoll.c b/Build/source/libs/obsdcompat/strtoll.c deleted file mode 100644 index f6293038859..00000000000 --- a/Build/source/libs/obsdcompat/strtoll.c +++ /dev/null @@ -1,148 +0,0 @@ -/* $OpenBSD: strtoll.c,v 1.6 2005/11/10 10:00:17 espie Exp $ */ -/*- - * Copyright (c) 1992 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* OPENBSD ORIGINAL: lib/libc/stdlib/strtoll.c */ - -#include "includes.h" -#ifndef HAVE_STRTOLL - -#include <sys/types.h> - -#include <ctype.h> -#include <errno.h> -#include <limits.h> -#include <stdlib.h> - -/* - * Convert a string to a long long. - * - * Ignores `locale' stuff. Assumes that the upper and lower case - * alphabets and digits are each contiguous. - */ -long long -strtoll(const char *nptr, char **endptr, int base) -{ - const char *s; - long long acc, cutoff; - int c; - int neg, any, cutlim; - - /* - * Skip white space and pick up leading +/- sign if any. - * If base is 0, allow 0x for hex and 0 for octal, else - * assume decimal; if base is already 16, allow 0x. - */ - s = nptr; - do { - c = (unsigned char) *s++; - } while (isspace(c)); - if (c == '-') { - neg = 1; - c = *s++; - } else { - neg = 0; - if (c == '+') - c = *s++; - } - if ((base == 0 || base == 16) && - c == '0' && (*s == 'x' || *s == 'X')) { - c = s[1]; - s += 2; - base = 16; - } - if (base == 0) - base = c == '0' ? 8 : 10; - - /* - * Compute the cutoff value between legal numbers and illegal - * numbers. That is the largest legal value, divided by the - * base. An input number that is greater than this value, if - * followed by a legal input character, is too big. One that - * is equal to this value may be valid or not; the limit - * between valid and invalid numbers is then based on the last - * digit. For instance, if the range for long longs is - * [-9223372036854775808..9223372036854775807] and the input base - * is 10, cutoff will be set to 922337203685477580 and cutlim to - * either 7 (neg==0) or 8 (neg==1), meaning that if we have - * accumulated a value > 922337203685477580, or equal but the - * next digit is > 7 (or 8), the number is too big, and we will - * return a range error. - * - * Set any if any `digits' consumed; make it negative to indicate - * overflow. - */ - cutoff = neg ? LLONG_MIN : LLONG_MAX; - cutlim = cutoff % base; - cutoff /= base; - if (neg) { - if (cutlim > 0) { - cutlim -= base; - cutoff += 1; - } - cutlim = -cutlim; - } - for (acc = 0, any = 0;; c = (unsigned char) *s++) { - if (isdigit(c)) - c -= '0'; - else if (isalpha(c)) - c -= isupper(c) ? 'A' - 10 : 'a' - 10; - else - break; - if (c >= base) - break; - if (any < 0) - continue; - if (neg) { - if (acc < cutoff || (acc == cutoff && c > cutlim)) { - any = -1; - acc = LLONG_MIN; - errno = ERANGE; - } else { - any = 1; - acc *= base; - acc -= c; - } - } else { - if (acc > cutoff || (acc == cutoff && c > cutlim)) { - any = -1; - acc = LLONG_MAX; - errno = ERANGE; - } else { - any = 1; - acc *= base; - acc += c; - } - } - } - if (endptr != 0) - *endptr = (char *) (any ? s - 1 : nptr); - return (acc); -} -#endif /* HAVE_STRTOLL */ diff --git a/Build/source/libs/obsdcompat/strtonum.c b/Build/source/libs/obsdcompat/strtonum.c deleted file mode 100644 index 87f2f24b258..00000000000 --- a/Build/source/libs/obsdcompat/strtonum.c +++ /dev/null @@ -1,72 +0,0 @@ -/* $OpenBSD: strtonum.c,v 1.6 2004/08/03 19:38:01 millert Exp $ */ - -/* - * Copyright (c) 2004 Ted Unangst and Todd Miller - * All rights reserved. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* OPENBSD ORIGINAL: lib/libc/stdlib/strtonum.c */ - -#include "includes.h" - -#ifndef HAVE_STRTONUM -#include <stdlib.h> -#include <limits.h> -#include <errno.h> - -#define INVALID 1 -#define TOOSMALL 2 -#define TOOLARGE 3 - -long long -strtonum(const char *numstr, long long minval, long long maxval, - const char **errstrp) -{ - long long ll = 0; - char *ep; - int error = 0; - struct errval { - const char *errstr; - int err; - } ev[4] = { - { NULL, 0 }, - { "invalid", EINVAL }, - { "too small", ERANGE }, - { "too large", ERANGE }, - }; - - ev[0].err = errno; - errno = 0; - if (minval > maxval) - error = INVALID; - else { - ll = strtoll(numstr, &ep, 10); - if (numstr == ep || *ep != '\0') - error = INVALID; - else if ((ll == LLONG_MIN && errno == ERANGE) || ll < minval) - error = TOOSMALL; - else if ((ll == LLONG_MAX && errno == ERANGE) || ll > maxval) - error = TOOLARGE; - } - if (errstrp != NULL) - *errstrp = ev[error].errstr; - errno = ev[error].err; - if (error) - ll = 0; - - return (ll); -} - -#endif /* HAVE_STRTONUM */ |