From 4e0c1249e4b4f341e4684dff00cfc83404d3135e Mon Sep 17 00:00:00 2001 From: Brian Cox Date: Thu, 10 Oct 2019 14:11:21 -0700 Subject: [PATCH] Start removing deprecated IS_xxx macros; don't look for a C compiler at configure time, just a C++ one; clean up some builtin type handling stuff so we prefer compiler-provided values instead of rolling our own; remove a bunch of vestigial unused Win32 stuff --- Makefile.in | 1 + config.h.in | 65 ++ configure | 1315 ++++++++++++++++++++++++------ configure.ac | 42 +- man/Makefile.in | 1 + man/man4/Makefile.in | 1 + man/man5/Makefile.in | 1 + man/man8/Makefile.in | 1 + src/Makefile.in | 1 + src/core/Makefile.in | 1 + src/core/charutil.cpp | 3 +- src/core/file.h | 2 +- src/core/file_unix.cpp | 15 +- src/core/msystem.cpp | 38 +- src/core/ntdbs.h | 11 +- src/core/platform.h | 508 ++++-------- src/core/stdcore.h | 52 +- src/core/twlimits.h | 2 +- src/core/twlocale.cpp | 6 - src/core/types.h | 96 +-- src/cryptlib/Makefile.in | 1 + src/cryptlib/cryptest.dsp | 328 -------- src/cryptlib/cryptest.dsw | 52 -- src/cryptlib/cryptlib.dsp | 776 ------------------ src/db/Makefile.in | 1 + src/fco/Makefile.in | 1 + src/fs/Makefile.in | 1 + src/fs/fspropcalc.cpp | 2 +- src/siggen/Makefile.in | 1 + src/tripwire/Makefile.in | 1 + src/tripwire/mailmessage.h | 8 +- src/tripwire/smtpmailmessage.cpp | 88 +- src/tripwire/syslog_trip.cpp | 11 +- src/tripwire/twcmdline.cpp | 4 - src/tw/Makefile.in | 1 + src/tw/twinit.cpp | 9 + src/twadmin/Makefile.in | 1 + src/twcrypto/Makefile.in | 1 + src/twparser/Makefile.in | 1 + src/twprint/Makefile.in | 1 + src/twtest/Makefile.in | 1 + src/twtest/platform_t.cpp | 90 +- src/twtest/test.h | 2 +- src/util/Makefile.in | 1 + src/util/fileutil.cpp | 2 +- 45 files changed, 1475 insertions(+), 2072 deletions(-) delete mode 100644 src/cryptlib/cryptest.dsp delete mode 100644 src/cryptlib/cryptest.dsw delete mode 100644 src/cryptlib/cryptlib.dsp diff --git a/Makefile.in b/Makefile.in index 4070718..43c21c3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -218,6 +218,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORE_CRYPT_O = @CORE_CRYPT_O@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ diff --git a/config.h.in b/config.h.in index 1014181..6fa1965 100644 --- a/config.h.in +++ b/config.h.in @@ -30,6 +30,9 @@ /* Define to 1 if you have the `broken_ac_check_func' function. */ #undef HAVE_BROKEN_AC_CHECK_FUNC +/* Define to 1 if you have the header file. */ +#undef HAVE_BSDSOCKET_SOCKETBASETAGS_H + /* Define to 1 if you have the `chmod' function. */ #undef HAVE_CHMOD @@ -54,6 +57,9 @@ /* Define to 1 if you have the `connect' function. */ #undef HAVE_CONNECT +/* Define to 1 if you have the `directio' function. */ +#undef HAVE_DIRECTIO + /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H @@ -94,6 +100,9 @@ /* Define to 1 if you have the `getaddrinfo' function. */ #undef HAVE_GETADDRINFO +/* Define to 1 if you have the `getgid' function. */ +#undef HAVE_GETGID + /* Define to 1 if you have the `getgrgid' function. */ #undef HAVE_GETGRGID @@ -139,6 +148,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + /* Define to 1 if you have the `link' function. */ #undef HAVE_LINK @@ -151,6 +163,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H +/* Define to 1 if you have the `mblen' function. */ +#undef HAVE_MBLEN + +/* Define to 1 if you have the `mbtowc' function. */ +#undef HAVE_MBTOWC + /* Define to 1 if you have the `memcpy_s' function. */ #undef HAVE_MEMCPY_S @@ -190,6 +208,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_SHA_H +/* Uses the OpenWatcom compiler */ +#undef HAVE_OPENWATCOM + /* Uses the sunCC compiler */ #undef HAVE_ORACLE_SUNCC @@ -208,6 +229,12 @@ /* Define to 1 if you have the `posix_spawn' function. */ #undef HAVE_POSIX_SPAWN +/* Define to 1 if you have the header file. */ +#undef HAVE_PROTO_BSDSOCKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_PROTO_EXEC_H + /* Define to 1 if you have the header file. */ #undef HAVE_PTHREAD_H @@ -369,9 +396,15 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Define to 1 if you have the header file. */ +#undef HAVE_UNIXLIB_LOCAL_H + /* Define to 1 if you have the header file. */ #undef HAVE_VARARGS_H +/* Define to 1 if you have the `vfork' function. */ +#undef HAVE_VFORK + /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H @@ -447,6 +480,28 @@ /* Uses signed magnitute */ #undef USES_SIGNED_MAGNITUDE +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + /* Version number of package */ #undef VERSION @@ -476,6 +531,16 @@ /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES +/* Define to 1 if on MINIX. */ +#undef _MINIX + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE + /* Define to 1 if type `char' is unsigned and you are not using gcc. */ #ifndef __CHAR_UNSIGNED__ # undef __CHAR_UNSIGNED__ diff --git a/configure b/configure index ed9963f..8128f3d 100755 --- a/configure +++ b/configure @@ -631,8 +631,6 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS CORE_CRYPT_O -EGREP -GREP CXXCPP path_to_sendmail path_to_vi @@ -648,6 +646,9 @@ CXXDEPMODE ac_ct_CXX CXXFLAGS CXX +EGREP +GREP +CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE @@ -767,6 +768,7 @@ CFLAGS LDFLAGS LIBS CPPFLAGS +CPP CXX CXXFLAGS CCC @@ -1422,6 +1424,7 @@ Some influential environment variables: LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory + CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags YACC The `Yet Another Compiler Compiler' implementation to use. @@ -1553,6 +1556,207 @@ fi } # ac_fn_c_try_compile +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $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 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ---------------------------------------------------------------------- ## +## Report this to https://github.com/Tripwire/tripwire-open-source/issues ## +## ---------------------------------------------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $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=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + 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 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +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_header_compile + # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. @@ -3275,15 +3479,67 @@ ac_config_headers="$ac_config_headers config.h" -tmp_cxxflags=${CXXFLAGS} -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +DEPDIR="${am__leading_dot}deps" -CXXFLAGS=${tmp_cxxflags} +ac_config_commands="$ac_config_commands depfiles" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +$as_echo "${_am_result}" >&6; } + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi ac_ext=c @@ -3292,7 +3548,197 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then - for ac_prog in gcc clang suncc aCC xlc_r gxlc cl + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 @@ -3336,7 +3782,7 @@ fi fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in gcc clang suncc aCC xlc_r gxlc cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -3391,6 +3837,8 @@ esac fi fi +fi + test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -3877,11 +4325,11 @@ if test "x$ac_cv_prog_cc_c89" != xno; then : fi -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3935,74 +4383,11 @@ if test "$am_cv_prog_cc_c_o" != yes; then # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 -$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } -cat > confinc.mk << 'END' -am__doit: - @echo this is the am__doit target >confinc.out -.PHONY: am__doit -END -am__include="#" -am__quote= -# BSD make does it like this. -echo '.include "confinc.mk" # ignored' > confmf.BSD -# Other make implementations (GNU, Solaris 10, AIX) do it like this. -echo 'include confinc.mk # ignored' > confmf.GNU -_am_result=no -for s in GNU BSD; do - { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 - (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - case $?:`cat confinc.out 2>/dev/null` in #( - '0:this is the am__doit target') : - case $s in #( - BSD) : - am__include='.include' am__quote='"' ;; #( - *) : - am__include='include' am__quote='' ;; -esac ;; #( - *) : - ;; -esac - if test "$am__include" != "#"; then - _am_result="yes ($s style)" - break - fi -done -rm -f confinc.* confmf.* -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 -$as_echo "${_am_result}" >&6; } - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= @@ -4133,6 +4518,477 @@ else fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes; then : + MINIX=yes +else + MINIX= +fi + + + if test "$MINIX" = yes; then + +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h + + +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h + + +$as_echo "#define _MINIX 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if ${ac_cv_safe_to_define___extensions__+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_safe_to_define___extensions__=yes +else + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h + + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h + + + +tmp_cxxflags=${CXXFLAGS} +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +CXXFLAGS=${tmp_cxxflags} + + + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4871,7 +5727,6 @@ fi if test "x${GXX}" != "x"; then - CFLAGS=${CFLAGS:-"-O -pipe"} CXXFLAGS=${CXXFLAGS:-"-O -pipe"} @@ -4901,8 +5756,6 @@ else $as_echo "#define HAVE_CLANG 1" >>confdefs.h - - CFLAGS=${CFLAGS:-"-O -pipe"} CXXFLAGS=${CXXFLAGS:-"-O -pipe"} fi @@ -4912,7 +5765,6 @@ $as_echo "#define HAVE_IBM_GXLC 1" >>confdefs.h export OBJECT_MODE=64 - CFLAGS=${CFLAGS:-"-O -maix64 -Wx,-qinfo=all" } CXXFLAGS=${CXXFLAGS:-"-O -maix64 -Wx,-qinfo=all"} ARFLAGS=${ARFLAGS:-"-X 64"} fi @@ -4923,7 +5775,6 @@ $as_echo "#define HAVE_IBM_XLC 1" >>confdefs.h export OBJECT_MODE=64 - CFLAGS=${CFLAGS:-"-O -q64 -qinfo=all -qsuppress=1540-5311:1540-5337:1540-5341"} CXXFLAGS=${CXXFLAGS:-"-O -q64 -qinfo=all -qsuppress=1540-5311:1540-5337:1540-5341"} ARFLAGS=${ARFLAGS:-"-X 64"} fi @@ -4941,6 +5792,13 @@ $as_echo "#define HAVE_HP_ACC 1" >>confdefs.h fi + if test "x${CXX}" = "xowcc"; then + +$as_echo "#define HAVE_OPENWATCOM 1" >>confdefs.h + + CXXFLAGS=${CXXFLAGS:-"-xs"} + fi + fi @@ -5011,11 +5869,47 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___Wextra" >&5 $as_echo "$ax_cv_check_cxxflags___Wextra" >&6; } if test "x$ax_cv_check_cxxflags___Wextra" = xyes; then : - CXXFLAGS="$CXXFLAGS -Wextra -Wno-unused-parameter" + CXXFLAGS="$CXXFLAGS -Wextra" else : fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -Wno-unused-parameter" >&5 +$as_echo_n "checking whether C++ compiler accepts -Wno-unused-parameter... " >&6; } +if ${ax_cv_check_cxxflags___Wno_unused_parameter+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$CXXFLAGS + CXXFLAGS="$CXXFLAGS -Wno-unused-parameter" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ax_cv_check_cxxflags___Wno_unused_parameter=yes +else + ax_cv_check_cxxflags___Wno_unused_parameter=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CXXFLAGS=$ax_check_save_flags +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___Wno_unused_parameter" >&5 +$as_echo "$ax_cv_check_cxxflags___Wno_unused_parameter" >&6; } +if test "x$ax_cv_check_cxxflags___Wno_unused_parameter" = xyes; then : + CXXFLAGS="$CXXFLAGS -Wno-unused-parameter" +else + : +fi + + # Check whether --enable-static was given. @@ -5034,7 +5928,6 @@ fi if test "x$enable_debug" = xyes then - CFLAGS="${CFLAGS} -g" CXXFLAGS="${CXXFLAGS} -g" $as_echo "#define DEBUG 1" >>confdefs.h @@ -5052,7 +5945,6 @@ fi if test "x$enable_coverage" = xyes then - CFLAGS="${CFLAGS} --coverage" CXXFLAGS="${CXXFLAGS} --coverage" LDFLAGS="${LDFLAGS} --coverage" fi @@ -5064,7 +5956,6 @@ fi if test "x$enable_profiling" = xyes then - CFLAGS="${CFLAGS} -pg" CXXFLAGS="${CXXFLAGS} -pg" LDFLAGS="${LDFLAGS} -pg" fi @@ -5092,7 +5983,6 @@ if test "${with_stlport_dir+set}" = set; then : stlport_paths="-I ${stlport_include} -L ${stlport_lib}" CPPFLAGS="${CPPFLAGS} ${stlport_paths}" - CFLAGS="${CFLAGS} ${stlport_paths}" CXXFLAGS="${CXXFLAGS} ${stlport_paths}" LDFLAGS="${LDFLAGS} ${stlport_lib} -lstlport_gcc -lm" # Append lib dir to LD_LIBRARY_PATH (or set LD_LIBRARY_PATH if unset) @@ -5239,136 +6129,6 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : @@ -5640,23 +6400,6 @@ fi fi -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - for ac_header in grp.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "grp.h" "ac_cv_header_grp_h" "$ac_includes_default" @@ -5944,6 +6687,54 @@ fi done +for ac_header in unixlib/local.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "unixlib/local.h" "ac_cv_header_unixlib_local_h" "$ac_includes_default" +if test "x$ac_cv_header_unixlib_local_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_UNIXLIB_LOCAL_H 1 +_ACEOF + +fi + +done + +for ac_header in proto/bsdsocket.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "proto/bsdsocket.h" "ac_cv_header_proto_bsdsocket_h" "$ac_includes_default" +if test "x$ac_cv_header_proto_bsdsocket_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PROTO_BSDSOCKET_H 1 +_ACEOF + +fi + +done + +for ac_header in proto/exec.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "proto/exec.h" "ac_cv_header_proto_exec_h" "$ac_includes_default" +if test "x$ac_cv_header_proto_exec_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PROTO_EXEC_H 1 +_ACEOF + +fi + +done + +for ac_header in bsdsocket/socketbasetags.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "bsdsocket/socketbasetags.h" "ac_cv_header_bsdsocket_socketbasetags_h" "$ac_includes_default" +if test "x$ac_cv_header_bsdsocket_socketbasetags_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_BSDSOCKET_SOCKETBASETAGS_H 1 +_ACEOF + +fi + +done + CPPFLAGS_SAVE="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} -Werror" @@ -7080,12 +7871,13 @@ _ACEOF fi done -for ac_func in getuid +for ac_func in getuid getgid do : - ac_fn_cxx_check_func "$LINENO" "getuid" "ac_cv_func_getuid" -if test "x$ac_cv_func_getuid" = xyes; then : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define HAVE_GETUID 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -7103,6 +7895,18 @@ _ACEOF fi done +for ac_func in mblen mbtowc +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + for ac_func in swab tzset _exit popen memcpy_s do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` @@ -7201,7 +8005,7 @@ _ACEOF fi done -for ac_func in fork execve posix_spawn +for ac_func in fork vfork execve posix_spawn do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -7328,6 +8132,16 @@ fi done +for ac_func in directio +do : + ac_fn_cxx_check_func "$LINENO" "directio" "ac_cv_func_directio" +if test "x$ac_cv_func_directio" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DIRECTIO 1 +_ACEOF + +fi +done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 @@ -7818,12 +8632,13 @@ fi fi -for ac_header in limits +for ac_header in limits limits.h do : - ac_fn_cxx_check_header_mongrel "$LINENO" "limits" "ac_cv_header_limits" "$ac_includes_default" -if test "x$ac_cv_header_limits" = xyes; then : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define HAVE_LIMITS 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi diff --git a/configure.ac b/configure.ac index 154e84f..6fde449 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,11 @@ AM_CONFIG_HEADER(config.h) AC_COPYRIGHT([The developer of the original code and/or files is Tripwire, Inc. Portions created by Tripwire, Inc. are copyright 2000-2019 Tripwire, Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights reserved.]) AC_REVISION([$Revision: 2.4.3.8 $]) +dnl ensure that things like _GNU_SOURCE are enabled, since we use a handful of extended +dnl things like O_NOATIME when they're available. autotools wants this to happen early +dnl before it tries to compile anything +AC_USE_SYSTEM_EXTENSIONS + dnl AC_LANG_CPLUSPLUS wants to set CXXFLAGS to include '-g -O2', but we probably don't want to dnl include debug symbols by default, so save off the previous value & restore it afterward tmp_cxxflags=${CXXFLAGS} @@ -28,7 +33,7 @@ AH_BOTTOM([#include "core/fixups.h"]) dnl ################### dnl Checks for programs dnl ################### -AC_PROG_CC([gcc clang suncc aCC xlc_r gxlc cl]) +dnl AC_PROG_CC([gcc clang suncc aCC xlc_r gxlc cl]) AC_PROG_CXX([g++ clang++ sunCC aCC xlc++_r gxlc++ ixlc icpc owcc cl KCC cfront c++]) AC_PROG_RANLIB AC_PROG_YACC @@ -51,7 +56,6 @@ dnl since automake is good at that. dnl if test "x${GXX}" != "x"; then - CFLAGS=${CFLAGS:-"-O -pipe"} CXXFLAGS=${CXXFLAGS:-"-O -pipe"} AC_DEFINE(HAVE_GNUC, 1, [Compiler supports GNU C++ dialect & args]) @@ -72,8 +76,6 @@ else dnl in case Clang stops defining __GNUC__ or user undefines it if test "x${CXX}" = "xclang++"; then AC_DEFINE(HAVE_CLANG, 1, [Uses the Clang compiler]) - - CFLAGS=${CFLAGS:-"-O -pipe"} CXXFLAGS=${CXXFLAGS:-"-O -pipe"} fi @@ -82,7 +84,6 @@ else dnl OBJECT_MODE needs to be set while compiling export OBJECT_MODE=64 - CFLAGS=${CFLAGS:-"-O -maix64 -Wx,-qinfo=all" } CXXFLAGS=${CXXFLAGS:-"-O -maix64 -Wx,-qinfo=all"} ARFLAGS=${ARFLAGS:-"-X 64"} fi @@ -92,7 +93,6 @@ else dnl OBJECT_MODE needs to be set while compiling export OBJECT_MODE=64 - CFLAGS=${CFLAGS:-"-O -q64 -qinfo=all -qsuppress=1540-5311:1540-5337:1540-5341"} CXXFLAGS=${CXXFLAGS:-"-O -q64 -qinfo=all -qsuppress=1540-5311:1540-5337:1540-5341"} ARFLAGS=${ARFLAGS:-"-X 64"} fi @@ -106,6 +106,11 @@ else if test "x${CXX}" = "xaCC"; then AC_DEFINE(HAVE_HP_ACC, 1, [Uses the aCC compiler]) fi + + if test "x${CXX}" = "xowcc"; then + AC_DEFINE(HAVE_OPENWATCOM, 1, [Uses the OpenWatcom compiler]) + CXXFLAGS=${CXXFLAGS:-"-xs"} + fi fi @@ -115,7 +120,10 @@ dnl Enable various warnings dnl ##################### AX_CHECK_COMPILE_FLAG([-Wall], [CXXFLAGS="$CXXFLAGS -Wall"]) -AX_CHECK_COMPILE_FLAG([-Wextra], [CXXFLAGS="$CXXFLAGS -Wextra -Wno-unused-parameter"]) +AX_CHECK_COMPILE_FLAG([-Wextra], [CXXFLAGS="$CXXFLAGS -Wextra"]) +dnl OpenWatcom compiler understands -Wextra but not -Wno-unused-parameter, so detect it separately +AX_CHECK_COMPILE_FLAG([-Wno-unused-parameter], [CXXFLAGS="$CXXFLAGS -Wno-unused-parameter"]) + dnl AX_CHECK_COMPILE_FLAG([-Weverything], [CXXFLAGS="$CXXFLAGS -Weverything"]) dnl ##################### @@ -133,7 +141,6 @@ fi AC_ARG_ENABLE(debug, [ --enable-debug compile with debuging enabled]) if test "x$enable_debug" = xyes then - CFLAGS="${CFLAGS} -g" CXXFLAGS="${CXXFLAGS} -g" AC_DEFINE(DEBUG, 1, [Compile with debug code]) else @@ -143,7 +150,6 @@ fi AC_ARG_ENABLE(coverage, [ --enable-coverage enable code coverage]) if test "x$enable_coverage" = xyes then - CFLAGS="${CFLAGS} --coverage" CXXFLAGS="${CXXFLAGS} --coverage" LDFLAGS="${LDFLAGS} --coverage" fi @@ -151,7 +157,6 @@ fi AC_ARG_ENABLE(profiling, [ --enable-profiling enable profiling]) if test "x$enable_profiling" = xyes then - CFLAGS="${CFLAGS} -pg" CXXFLAGS="${CXXFLAGS} -pg" LDFLAGS="${LDFLAGS} -pg" fi @@ -172,7 +177,6 @@ AC_ARG_WITH(stlport-dir, stlport_paths="-I ${stlport_include} -L ${stlport_lib}" CPPFLAGS="${CPPFLAGS} ${stlport_paths}" - CFLAGS="${CFLAGS} ${stlport_paths}" CXXFLAGS="${CXXFLAGS} ${stlport_paths}" LDFLAGS="${LDFLAGS} ${stlport_lib} -lstlport_gcc -lm" # Append lib dir to LD_LIBRARY_PATH (or set LD_LIBRARY_PATH if unset) @@ -219,6 +223,10 @@ AC_CHECK_HEADERS(sys/utsname.h) AC_CHECK_HEADERS(sys/wait.h) AC_CHECK_HEADERS(sys/fs/vx_ioctl.h) +AC_CHECK_HEADERS(unixlib/local.h) +AC_CHECK_HEADERS(proto/bsdsocket.h) +AC_CHECK_HEADERS(proto/exec.h) +AC_CHECK_HEADERS(bsdsocket/socketbasetags.h) dnl # Special case for malloc.h, because it's deprecated on most systems. CPPFLAGS_SAVE="${CPPFLAGS}" @@ -285,9 +293,12 @@ dnl Checks for standard functions dnl ############################# AC_CHECK_FUNCS(strftime) AC_CHECK_FUNCS(getaddrinfo gethostname gethostbyname gethostid) -AC_CHECK_FUNCS(getuid) +AC_CHECK_FUNCS(getuid getgid) dnl various ways of creating/naming temp files AC_CHECK_FUNCS(mkstemp mktemp tmpnam, break) +dnl i18n string fns +AC_CHECK_FUNCS(mblen mbtowc) +dnl misc assorted AC_CHECK_FUNCS(swab tzset _exit popen memcpy_s) dnl posix way to read files @@ -306,7 +317,7 @@ AC_CHECK_FUNCS(chown chmod link symlink mknod mkfifo) dnl posix syslog fns AC_CHECK_FUNCS(openlog syslog closelog) dnl posix process fns -AC_CHECK_FUNCS(fork execve posix_spawn) +AC_CHECK_FUNCS(fork vfork execve posix_spawn) dnl bsd socket fns AC_CHECK_FUNCS(socket connect bind) dnl posix user & group stuff @@ -329,7 +340,8 @@ dnl check for door support (Solaris) AC_CHECK_HEADERS(door.h, [AC_CHECK_FUNCS(door_create)]) dnl check for event port support (Solaris) AC_CHECK_HEADERS(port.h, [AC_CHECK_FUNCS(port_create)]) - +dnl check for directio syscall (Solaris) +AC_CHECK_FUNCS(directio) dnl check for existence of fseeko() as well as ftello() AC_FUNC_FSEEKO @@ -395,7 +407,7 @@ dnl Check for STL support, either native or STLport dnl dnl Check for STL headers dnl -AC_CHECK_HEADERS(limits) +AC_CHECK_HEADERS(limits limits.h) dnl Use as a proxy for C++98-compliant-ish STL dnl and look for STLport if file isn't found immediately diff --git a/man/Makefile.in b/man/Makefile.in index de4d50f..ec1973a 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -195,6 +195,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORE_CRYPT_O = @CORE_CRYPT_O@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ diff --git a/man/man4/Makefile.in b/man/man4/Makefile.in index d9fe479..ede510d 100644 --- a/man/man4/Makefile.in +++ b/man/man4/Makefile.in @@ -167,6 +167,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORE_CRYPT_O = @CORE_CRYPT_O@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ diff --git a/man/man5/Makefile.in b/man/man5/Makefile.in index 09eaeba..cd77f5a 100644 --- a/man/man5/Makefile.in +++ b/man/man5/Makefile.in @@ -167,6 +167,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORE_CRYPT_O = @CORE_CRYPT_O@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ diff --git a/man/man8/Makefile.in b/man/man8/Makefile.in index cebcbfd..f80b870 100644 --- a/man/man8/Makefile.in +++ b/man/man8/Makefile.in @@ -167,6 +167,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORE_CRYPT_O = @CORE_CRYPT_O@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ diff --git a/src/Makefile.in b/src/Makefile.in index 78b8b28..c8e26c2 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -193,6 +193,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORE_CRYPT_O = @CORE_CRYPT_O@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ diff --git a/src/core/Makefile.in b/src/core/Makefile.in index 367af30..e57fb17 100644 --- a/src/core/Makefile.in +++ b/src/core/Makefile.in @@ -224,6 +224,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORE_CRYPT_O = @CORE_CRYPT_O@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ diff --git a/src/core/charutil.cpp b/src/core/charutil.cpp index 9d9ab41..db209bb 100644 --- a/src/core/charutil.cpp +++ b/src/core/charutil.cpp @@ -41,7 +41,8 @@ #include "charutil.h" #include "ntmbs.h" -#if IS_ANDROID +#if !HAVE_MBLEN && HAVE_MBTOWC +// Musl libc & Android NDK implement mblen just like this int mblen(const char* s, size_t n) { return mbtowc(0, s, n); diff --git a/src/core/file.h b/src/core/file.h index 7fd1cce..36823be 100644 --- a/src/core/file.h +++ b/src/core/file.h @@ -47,7 +47,7 @@ #include "fileerror.h" #endif -#if IS_MINT // for off_t +#if HAVE_SYS_TYPES_H #include #endif diff --git a/src/core/file_unix.cpp b/src/core/file_unix.cpp index 60ba87e..945734d 100644 --- a/src/core/file_unix.cpp +++ b/src/core/file_unix.cpp @@ -31,13 +31,6 @@ // // file_unix.cpp : Specific implementation of file operations for Unix. - -/* On GNU/Hurd, need to define _GNU_SOURCE in order to use O_NOATIME - which technically is still a nonstandard extension to open() */ -#if IS_HURD -# define _GNU_SOURCE -#endif - #include "core/stdcore.h" #include "core/file.h" @@ -57,7 +50,7 @@ #include "core/fsservices.h" #include "core/errorutil.h" -#if IS_RISCOS +#if HAVE_UNIXLIB_LOCAL_H #include #endif @@ -231,7 +224,7 @@ void cFile::Open(const TSTRING& sFileNameC, uint32_t flags) fcntl(fh, F_NOCACHE, 1); #endif -#if IS_SOLARIS +#if HAVE_DIRECTIO // Solaris if ((flags & OPEN_DIRECT) && (flags & OPEN_SCANNING)) directio(fh, DIRECTIO_ON); #endif @@ -605,7 +598,7 @@ bool cRiscosPath::IsAbsolutePath(const TSTRING& in) // For paths of type SDFS::Volume.$.dir.file TSTRING cRiscosPath::AsPosix(const TSTRING& in) { -#if IS_RISCOS +#if HAVE_UNIXLIB_LOCAL_H if (in[0] == '/') { return in; @@ -628,7 +621,7 @@ TSTRING cRiscosPath::AsPosix(const TSTRING& in) TSTRING cRiscosPath::AsNative(const TSTRING& in) { -#if IS_RISCOS +#if HAVE_UNIXLIB_LOCAL_H if (in[0] != '/') { return in; diff --git a/src/core/msystem.cpp b/src/core/msystem.cpp index d978f8c..bca3ffc 100644 --- a/src/core/msystem.cpp +++ b/src/core/msystem.cpp @@ -105,11 +105,6 @@ #include #include "msystem.h" -#if IS_REDOX -#define setuid(x) sleep(0) -#define setgid(x) sleep(0) -#endif - #if USES_MSYSTEM /* * signal type @@ -898,10 +893,13 @@ FILE *fp[]; return(mfpclose(indx, fp)); } -#if IS_AROS - #define fork() vfork() +#if HAVE_FORK +# define tss_fork() fork() +#elif HAVE_VFORK +# define tss_fork() vfork() #endif + /* * signal values */ @@ -947,14 +945,26 @@ int mask; /* * spawn the child and make the pipes the subprocess stdin, stdout */ - if ((ch_pid = fork()) == 0){ + if ((ch_pid = tss_fork()) == 0){ /* now reset the uid and gid if desired */ - if (mresetgid < -1) (void) setgid(getgid()); - else if (mresetgid == -1) (void) setgid(egid); - else if (mresetgid > -1) (void) setgid(mresetgid); - if (mresetuid < -1) (void) setuid(getuid()); - else if (mresetuid == -1) (void) setuid(euid); - else if (mresetuid > -1) (void) setuid(mresetuid); +#if HAVE_SETGID + if (mresetgid < -1) + (void) setgid(getgid()); + else if (mresetgid == -1) + (void) setgid(egid); + else if (mresetgid > -1) + (void) setgid(mresetgid); +#endif + +#if HAVE_SETUID + if (mresetuid < -1) + (void) setuid(getuid()); + else if (mresetuid == -1) + (void) setuid(euid); + else if (mresetuid > -1) + (void) setuid(mresetuid); +#endif + /* reset the umask */ (void) umask(mask); /* close the unused ends of the pipe */ diff --git a/src/core/ntdbs.h b/src/core/ntdbs.h index 8d55ce0..410bfaa 100644 --- a/src/core/ntdbs.h +++ b/src/core/ntdbs.h @@ -200,11 +200,9 @@ template<> struct std::char_traits return lhs == rhs; } -# if IS_STDLIB_MODENA - +#if IS_STDLIB_MODENA // CAUTION:RAD -- Extra members required by Modena!! - -# ifdef MBSTATE_T_DEFINED // This is ANSI-C *not* ANSI-C++!! +#ifdef MBSTATE_T_DEFINED // This is ANSI-C *not* ANSI-C++!! static state_type get_state(pos_type pos) { return pos.state(); @@ -214,7 +212,7 @@ template<> struct std::char_traits { return pos_type(pos.offset(), state); } -# endif //MBSTATE_T_DEFINED +#endif //MBSTATE_T_DEFINED static char_type newline() { @@ -225,8 +223,7 @@ template<> struct std::char_traits { return 0; } - -# endif //IS_STDLIB_MODENA +#endif //IS_STDLIB_MODENA static int_type eof() { diff --git a/src/core/platform.h b/src/core/platform.h index ecb25b9..cdb569e 100644 --- a/src/core/platform.h +++ b/src/core/platform.h @@ -47,84 +47,29 @@ //NOTE: Autoconf is strongly preferred as the Right Way to detect platform-specific features/behaviors. // These macros should really only be used when autoconf can't get the job done. -//============================================================================= -// Enumerations -// -// For each of these "enumerations" we create unique integers identifying each -// variation. We group similar items together, such as OS_REDHAT and OS_SLACKWARE - -# define OS_UNKNOWN 0 - -# define OS_WIN32 0x0101 -# define OS_CYGWIN 0x0102 -# define OS_DOS_DJGPP 0x0103 -# define OS_WIN32_MINGW 0x0104 -# define OS_OS2 0x0105 -# define OS_OS2_EMX 0x0106 - -# define OS_LINUX 0x0201 -# define OS_ANDROID 0x0202 - -# define OS_FREEBSD 0x0301 -# define OS_NETBSD 0x0302 -# define OS_OPENBSD 0x0303 -# define OS_DARWIN 0x0304 -# define OS_DRAGONFLYBSD 0x0305 -# define OS_MIDNIGHTBSD 0x0306 -# define OS_MIRBSD 0x0307 -# define OS_BITRIG 0x0308 -# define OS_LIBERTYBSD 0x0309 -# define OS_BSDI 0x030A - -# define OS_SOLARIS 0x0400 -# define OS_AIX 0x0401 -# define OS_HPUX 0x0402 -# define OS_IRIX 0x0403 -# define OS_OSF1 0x0404 -# define OS_OS400 0x0405 -# define OS_MVS 0x0406 - -# define OS_MINIX 0x0501 -# define OS_HURD 0x0502 -# define OS_HAIKU 0x0503 -# define OS_SYLLABLE 0x0504 -# define OS_SKYOS 0x0505 -# define OS_SORTIX 0x0506 -# define OS_MINT 0x0507 -# define OS_AROS 0x0508 -# define OS_RTEMS 0x0509 -# define OS_RISCOS 0x050A -# define OS_REDOX 0x050B -# define OS_QNX 0x050C -# define OS_VXWORKS 0x050D -# define OS_LYNXOS 0x050E -# define OS_OS9 0x050F // For Microware's OS-9, not the Apple one. -# define OS_PLAN9 0x0510 - - /////////////////////////////// -# define COMP_UNKNOWN 0 -# define COMP_GCC 0x0001 -# define COMP_CLANG 0x0002 +#define COMP_UNKNOWN 0 +#define COMP_GCC 0x0001 +#define COMP_CLANG 0x0002 -# define COMP_MSVC 0x0101 +#define COMP_MSVC 0x0101 // Definitions for the old KAI C++ compiler. // KCC was EOL'd ages ago, but I'm leaving these definitions here for now // on the off chance someone's still using it. -# define COMP_KAI 0x0200 -# define COMP_KAI_GCC 0x0201 -# define COMP_KAI_SUNPRO 0x0202 -# define COMP_KAI_GLIBC 0x0203 -# define COMP_KAI_VISUALAGE 0x0204 -# define COMP_KAI_HPANSIC 0x0205 -# define COMP_KAI_IRIX 0x0206 -# define COMP_KAI_OSF1ALPHA 0x0207 +#define COMP_KAI 0x0200 +#define COMP_KAI_GCC 0x0201 +#define COMP_KAI_SUNPRO 0x0202 +#define COMP_KAI_GLIBC 0x0203 +#define COMP_KAI_VISUALAGE 0x0204 +#define COMP_KAI_HPANSIC 0x0205 +#define COMP_KAI_IRIX 0x0206 +#define COMP_KAI_OSF1ALPHA 0x0207 -# define COMP_SUNPRO 0x0301 -# define COMP_XL_C 0x0302 -# define COMP_ACC 0x0303 +#define COMP_SUNPRO 0x0301 +#define COMP_XL_C 0x0302 +#define COMP_ACC 0x0303 //============================================================================= @@ -143,219 +88,60 @@ ////////////////////////////// // Compiler detection -# if defined(HAVE_GCC) -# define COMP COMP_GCC -# define IS_GCC 1 +#if defined(HAVE_GCC) +# define IS_GCC 1 -# elif defined(HAVE_CLANG) -# define COMP COMP_CLANG -# define IS_CLANG 1 +#elif defined(HAVE_CLANG) +# define IS_CLANG 1 -# elif defined(HAVE_MSVC) -# define COMP COMP_MSVC -# define IS_MSVC 1 +#elif defined(HAVE_MSVC) +# define IS_MSVC 1 -# elif defined(HAVE_KAI_KCC) -# if !defined(COMP) -# define COMP COMP_KAI -# endif -# define IS_KAI 1 - -# elif defined(HAVE_ORACLE_SUNCC) -# define COMP COMP_SUNPRO -# define IS_SUNPRO 1 - -# elif defined(HAVE_IBM_XL_C) || defined(HAVE_IBM_GXLC) -# define COMP COMP_XL_C -# define IS_XL_C 1 - -# elif defined(HAVE_HP_ACC) -# define COMP COMP_ACC -# define IS_HP_ACC 1 +#elif defined(HAVE_KAI_KCC) +# if !defined(COMP) +# define COMP COMP_KAI # endif +# define IS_KAI 1 + +#elif defined(HAVE_ORACLE_SUNCC) +# define IS_SUNPRO 1 + +#elif defined(HAVE_IBM_XL_C) || defined(HAVE_IBM_GXLC) +# define IS_XL_C 1 + +#elif defined(HAVE_HP_ACC) +# define IS_HP_ACC 1 +#endif ////////////////////////// // OS detection -# if defined(_WIN32) -# if defined(__MINGW32__) -# define OS OS_WIN32_MINGW -# define IS_MINGW 1 -# else -# define OS OS_WIN32 -# endif -# define IS_WIN32 1 +#if defined(_WIN32) +# define IS_WIN32 1 -# elif defined(__CYGWIN__) -# define OS OS_CYGWIN -# define IS_CYGWIN 1 +#elif defined(__DJGPP__) +# define IS_DOS_DJGPP 1 -# elif defined(__DJGPP__) -# define OS OS_DOS_DJGPP -# define IS_DOS_DJGPP 1 +#elif defined(__FreeBSD__) +# define IS_FREEBSD 1 -# elif defined(__OS2__) -# if defined(__EMX__) -# define OS OS_OS2_EMX -# define IS_EMX 1 -# else -# define OS OS_OS2 -# endif -# define IS_OS2 1 +#elif defined(SKYOS) +# define IS_SKYOS 1 -// Detect Android first, since Linux macros are also defined there -# elif defined(__ANDROID__) -# define OS OS_ANDROID -# define IS_ANDROID 1 +#elif defined(_SORTIX_SOURCE) +# define IS_SORTIX 1 -# elif defined(__linux__) -# define OS OS_LINUX -# define IS_LINUX 1 +#elif defined(__AROS__) +# define IS_AROS 1 +#elif defined(__riscos__) +# define IS_RISCOS 1 -// A herd of BSDs. Have to detect MidnightBSD before FreeBSD, and MirOS & Bitrig before OpenBSD -// because they also define symbols for their ancestor BSDs. -# elif defined(__DragonFly__) -# define OS OS_DRAGONFLYBSD -# define IS_DRAGONFLYBSD 1 +#elif defined(__redox__) +# define IS_REDOX 1 -# elif defined(__MidnightBSD__) -# define OS OS_MIDNIGHTBSD -# define IS_MIDNIGHTBSD 1 - -# elif defined(__FreeBSD__) -# define OS OS_FREEBSD -# define IS_FREEBSD 1 - -# elif defined(__NetBSD__) -# define OS OS_NETBSD -# define IS_NETBSD 1 - -# elif defined(__MirBSD__) -# define OS OS_MIRBSD -# define IS_MIRBSD 1 - -# elif defined(__Bitrig__) -# define OS OS_BITRIG -# define IS_BITRIG 1 - -// Detect LibertyBSD first since OpenBSD macros are also defined. -// Autotools can tell them apart by target triplet, so we define -// 'TW_LibertybSD' there and pass it in. -# elif defined(TW_LibertyBSD) -# define OS OS_LIBERTYBSD -# define IS_LIBERTYBSD 1 - -# elif defined(__OpenBSD__) -# define OS OS_OPENBSD -# define IS_OPENBSD 1 - -# elif defined(__APPLE__) -# define OS OS_DARWIN -# define IS_DARWIN 1 - - -// Next up, SysV Unixes, commercial & otherwise, and platforms that -// resemble SysV to varying degrees -# elif defined(__sun) -# define OS OS_SOLARIS -# define IS_SOLARIS 1 - -# elif defined(_AIX) -# define OS OS_AIX -# define IS_AIX 1 -# if defined(__PASE__) -# define IS_PASE 1 -# endif - -# elif defined(__hpux) -# define OS OS_HPUX -# define IS_HPUX 1 - -# elif defined(__sgi) -# define OS OS_IRIX -# define IS_IRIX 1 - -# elif defined(TRU64) || defined(__OSF1__) -# define OS OS_OSF1 -# define IS_OSF1 1 - -# elif defined(__OS400__) -# define OS OS_OS400 -# define IS_OS400 1 - -# elif defined(__MVS__) -# define OS OS_MVS -# define IS_MVS 1 - - -// Anything else that has a vaguely POSIX-esque file API -# elif defined(__minix__) -# define OS OS_MINIX -# define IS_MINIX 1 - -# elif defined(__gnu_hurd__) -# define OS OS_HURD -# define IS_HURD 1 - -# elif defined(__HAIKU__) -# define OS OS_HAIKU -# define IS_HAIKU 1 - -# elif defined(__SYLLABLE__) -# define OS OS_SYLLABLE -# define IS_SYLLABLE 1 - -# elif defined(SKYOS) -# define OS OS_SKYOS -# define IS_SKYOS 1 - -# elif defined(_SORTIX_SOURCE) -# define OS OS_SORTIX -# define IS_SORTIX 1 - -# elif defined(__MINT__) -# define OS OS_MINT -# define IS_MINT 1 - -# elif defined(__AROS__) -# define OS OS_AROS -# define IS_AROS 1 - -# elif defined(__rtems__) -# define OS OS_RTEMS -# define IS_RTEMS 1 - -# elif defined(__riscos__) -# define OS OS_RISCOS -# define IS_RISCOS 1 - -# elif defined(__redox__) -# define OS OS_REDOX -# define IS_REDOX 1 - -# elif defined(__QNX__) || defined(__QNXNTO__) -# define OS OS_QNX -# define IS_QNX 1 - -# elif defined(__VXWORKS__) -# define OS OS_VXWORKS -# define IS_VXWORKS 1 - -# elif defined(__Lynx__) -# define OS OS_LYNXOS -# define IS_LYNXOS 1 - -# elif defined(__OS9000) -# define OS OS_OS9 -# define IS_OS9 1 - -# elif defined(EPLAN9) -# define OS OS_PLAN9 -# define IS_PLAN9 1 - -# endif +#endif //============================================================================= @@ -389,92 +175,138 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# define CPLUSPLUS_2011_OR_GREATER (__cplusplus >= 201103L) -# define CPLUSPLUS_PRE_2011 !CPLUSPLUS_2011_OR_GREATER +#define CPLUSPLUS_2011_OR_GREATER (__cplusplus >= 201103L) +#define CPLUSPLUS_PRE_2011 !CPLUSPLUS_2011_OR_GREATER -# define CPLUSPLUS_2017_OR_GREATER (__cplusplus >= 201703L) -# define CPLUSPLUS_PRE_2017 !CPLUSPLUS_2011_OR_GREATER +#define CPLUSPLUS_2017_OR_GREATER (__cplusplus >= 201703L) +#define CPLUSPLUS_PRE_2017 !CPLUSPLUS_2011_OR_GREATER // KAI 3.4 uses a much improved stl -# define IS_KAI_3_4 (IS_KAI && (COMP == COMP_KAI_IRIX || COMP == COMP_KAI_OSF1ALPHA || COMP == COMP_KAI_GLIBC)) +#define IS_KAI_3_4 (IS_KAI && (COMP == COMP_KAI_IRIX || COMP == COMP_KAI_OSF1ALPHA || COMP == COMP_KAI_GLIBC)) // Used in twlocale -# define USE_STD_CPP_LOCALE_WORKAROUND \ +#define USE_STD_CPP_LOCALE_WORKAROUND \ (IS_SUNPRO || (IS_KAI && !IS_KAI_3_4)) // TODO:BAM -- name this something more general. -# define USE_CLIB_LOCALE (!HAVE_LOCALE || HAVE_GCC || IS_KAI) +#define USE_CLIB_LOCALE (!HAVE_LOCALE || HAVE_GCC || IS_KAI) -# define USES_CLIB_DATE_FUNCTION \ +#define USES_CLIB_DATE_FUNCTION \ (USE_CLIB_LOCALE || IS_SUNPRO || \ IS_MSVC) // if we use clib, can't use C++ time_put, and SUNPRO and MSVC add characters +#define USES_GLIBC ((COMP == COMP_KAI_GLIBC) || HAVE_GCC) +#define SUPPORTS_MEMBER_TEMPLATES (!IS_SUNPRO) +#define SUPPORTS_EXPLICIT_TEMPLATE_FUNC_INST (!IS_SUNPRO) + // Threading API -# define SUPPORTS_WIN32_THREADS IS_WIN32 -# define SUPPORTS_POSIX_THREADS (HAVE_PTHREAD_H) +#define SUPPORTS_WIN32_THREADS IS_WIN32 +#define SUPPORTS_POSIX_THREADS (HAVE_PTHREAD_H) // Miscellaneous -# define SUPPORTS_C_FILE_IO (HAVE_FOPEN && HAVE_FREAD && HAVE_FCLOSE) -# define SUPPORTS_POSIX_FILE_IO (HAVE_OPEN && HAVE_READ && HAVE_CLOSE) -# define SUPPORTS_SYMLINKS (HAVE_READLINK || HAVE_READLINKAT) +#define SUPPORTS_C_FILE_IO (HAVE_FOPEN && HAVE_FREAD && HAVE_FCLOSE) +#define SUPPORTS_POSIX_FILE_IO (HAVE_OPEN && HAVE_READ && HAVE_CLOSE) +#define SUPPORTS_SYMLINKS (HAVE_READLINK || HAVE_READLINKAT) -# if (SIZEOF_WCHAR_T == 2) -# define WCHAR_IS_16_BITS 1 -# define WCHAR_REP_IS_UCS2 1 -# elif (SIZEOF_WCHAR_T == 4) -# define WCHAR_IS_32_BITS 1 -# endif +#if (SIZEOF_WCHAR_T == 2) +# define WCHAR_IS_16_BITS 1 +# define WCHAR_REP_IS_UCS2 1 +#elif (SIZEOF_WCHAR_T == 4) +# define WCHAR_IS_32_BITS 1 +#endif -# define USE_U16STRING ((!WCHAR_IS_16_BITS) && CPLUSPLUS_2011_OR_GREATER) -# define USE_CHAR16_T USE_U16STRING -# define NEED_DBSTRING_IMPL (!WCHAR_IS_16_BITS && !USE_U16STRING) +#define USE_U16STRING ((!WCHAR_IS_16_BITS) && CPLUSPLUS_2011_OR_GREATER) +#define USE_CHAR16_T USE_U16STRING +#define NEED_DBSTRING_IMPL (!WCHAR_IS_16_BITS && !USE_U16STRING) -# define USE_UNIQUE_PTR CPLUSPLUS_2011_OR_GREATER -# define USE_LAMBDAS CPLUSPLUS_2011_OR_GREATER -# define USE_UNICODE_ESCAPES CPLUSPLUS_2011_OR_GREATER -# define USE_UNEXPECTED CPLUSPLUS_PRE_2017 +#define USE_UNIQUE_PTR CPLUSPLUS_2011_OR_GREATER +#define USE_LAMBDAS CPLUSPLUS_2011_OR_GREATER +#define USE_UNICODE_ESCAPES CPLUSPLUS_2011_OR_GREATER +#define USE_UNEXPECTED CPLUSPLUS_PRE_2017 + +#define SUPPORTS_POSIX_FORK_EXEC ((HAVE_FORK || HAVE_VFORK) && HAVE_EXECVE) + +#define USE_DEV_URANDOM (HAVE_DEV_URANDOM && ENABLE_DEV_URANDOM) + + +// Per-platform special cases. At least some of these could be replaced +// with better autotools detection -# define SUPPORTS_POSIX_FORK_EXEC (HAVE_FORK && HAVE_EXECVE) // msystem+mpopen fail on Syllable, so use the libc equivalents until we figure out why. // TODO: Figure out why. -# define USES_MPOPEN (SUPPORTS_POSIX_FORK_EXEC && !IS_SYLLABLE) -# define USES_MSYSTEM (SUPPORTS_POSIX_FORK_EXEC && !IS_SYLLABLE) - -//# define SUPPORTS_WCHART IS_WIN32 // TODO: Remove this? -# define USES_GLIBC ((COMP == COMP_KAI_GLIBC) || HAVE_GCC) -# define SUPPORTS_MEMBER_TEMPLATES (!IS_SUNPRO) -# define SUPPORTS_EXPLICIT_TEMPLATE_FUNC_INST (!IS_SUNPRO) +#if !defined(__SYLLABLE__) +# define USES_MPOPEN (SUPPORTS_POSIX_FORK_EXEC) +# define USES_MSYSTEM (SUPPORTS_POSIX_FORK_EXEC) +#endif -# define SUPPORTS_POSIX_SIGNALS (!IS_DOS_DJGPP && !IS_MINGW) -# define SUPPORTS_NETWORKING (HAVE_SOCKET && !IS_SORTIX && !IS_DOS_DJGPP && !IS_REDOX) -# define SUPPORTS_SYSLOG (HAVE_SYSLOG && !IS_SKYOS && !IS_RISCOS) -# define NEEDS_SWAB_IMPL (IS_CYGWIN || IS_SYLLABLE || IS_ANDROID || IS_SORTIX) -# define SWAB_TAKES_CHAR_PTRS (IS_MINGW) -# define USES_MBLEN (!IS_ANDROID && !IS_AROS) -# define USES_DOS_DEVICE_PATH (IS_DOS_DJGPP || (IS_WIN32 && !IS_CYGWIN) || (IS_OS2 && !IS_EMX)) -# define USES_DEVICE_PATH (IS_AROS || IS_RISCOS || IS_REDOX || USES_DOS_DEVICE_PATH) -# define ICONV_CONST_SOURCE (IS_MINIX) +#if (!defined(__DJGPP__) && !defined(__MINGW32__)) +# define SUPPORTS_POSIX_SIGNALS 1 +#endif -// Linux is the only platform where direct i/o hashing has been tested & works properly so far. -# define SUPPORTS_DIRECT_IO (IS_LINUX) +#if (!defined(__DJGPP__) && !defined(SORTIX_SOURCE) && !defined(__redox__)) +# define SUPPORTS_NETWORKING (HAVE_SOCKET) +#endif + +#if (!defined(SKYOS) && !defined(__riscos__)) +# define SUPPORTS_SYSLOG (HAVE_SYSLOG) +#endif + +#if (defined(__CYGWIN__) || defined(__SYLLABLE__) || defined(__ANDROID__) || defined(SORTIX_SOURCE)) +# define NEEDS_SWAB_IMPL 1 +#else +# define NEEDS_SWAB_IMPL (!HAVE_SWAB) +#endif + +#if defined(__MINGW32__) +# define SWAB_TAKES_CHAR_PTRS 1 +# define MKDIR_TAKES_SINGLE_ARG 1 +#endif + +#if (!defined(__ANROID__) && !defined(__AROS__)) +# define USES_MBLEN (HAVE_MBLEN) +#endif + +#if (defined(__DJGPP__) || (defined(_WIN32) && !defined(__CYGWIN__)) || (defined(__OS2__) && !defined(__EMX__))) +# define USES_DOS_DEVICE_PATH 1 +#endif + +#if defined(__redox__) +# define USES_URI_PATH 1 +#endif + +#if (USES_DOS_DEVICE_PATH || USES_URI_PATH || defined(__riscos__) || defined(__AROS__)) +# define USES_DEVICE_PATH 1 +#endif + +#if defined(__minix__) +# define ICONV_CONST_SOURCE 1 +#endif + +#if defined(SKYOS) +# define READLINK_NULL_TERMINATES 1 +#endif // HP-UX does have posix_fadvise(), but sys/fcntl.h neglects to wrap it in extern "C" on // at least some flavors of the OS. (see https://community.hpe.com/t5/Languages-and-Scripting/Bacula-try-to-compile-on-hpux11-31/m-p/6843389 ) -// The thread indicates this problem can be fixed by editing sys/fcntl.h, and then the !IS_HPUX below +// The thread indicates this problem can be fixed by editing sys/fcntl.h, and then the special case below // can be removed. This is left as an exercise for the reader. -# define SUPPORTS_POSIX_FADVISE (HAVE_POSIX_FADVISE && !IS_HPUX) +#if !defined(__hpux) +# define SUPPORTS_POSIX_FADVISE (HAVE_POSIX_FADVISE) +#endif -# define READ_TAKES_CHAR_PTR (IS_VXWORKS) - -// RTEMS errors are probably just a buildsys issue & this will change or go away. -// Redox will probably implement this in the future. -# define SUPPORTS_TERMIOS (HAVE_TERMIOS_H && (!IS_RTEMS && !IS_REDOX)) +#if defined(__VXWORKS__) +# define READ_TAKES_CHAR_PTR 1 +#endif +#if (!defined(__RTEMS__) && !defined(__redox__)) +# define SUPPORTS_TERMIOS (HAVE_TERMIOS_H) +#endif // Unlinking an open file (to make a temporary file nobody else can see) is a Posix-ism // that other platforms generally don't support. -# define CAN_UNLINK_WHILE_OPEN (!IS_AROS && !IS_RISCOS && !IS_REDOX && !IS_DOS_DJGPP) - +#if (!defined(__DJGPP__) && !defined(__riscos__) && !defined(__redox__) && !IS_AROS) +# define CAN_UNLINK_WHILE_OPEN 1 +#endif // POSIX standard says paths beginning with 2 slashes are "implementation defined" // (see http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html#tag_04_11 ) @@ -484,26 +316,33 @@ // to the macro even though I don't have the hardware to actually test this. // // Other platform known to use this include IBM z/OS and the ancient Apollo Domain/OS. -# define SUPPORTS_DOUBLE_SLASH_PATH (IS_CYGWIN || IS_MVS) - - -# define USE_DEV_URANDOM (HAVE_DEV_URANDOM && ENABLE_DEV_URANDOM) +#if (defined(__CYGWIN__) || defined(__MVS__)) +# define SUPPORTS_DOUBLE_SLASH_PATH 1 +#endif // Platforms where we might encounter AS/400 native objects, // which are only sometimes readable via ordinary file API -# define SUPPORTS_NATIVE_OBJECTS (IS_AIX || IS_OS400) - +#if defined(__OS400__) || defined(_AIX) +# define SUPPORTS_NATIVE_OBJECTS 1 +#endif // On most platforms, uname() returns 0 on success, like every other syscall out there. // However the POSIX standard merely says uname() returns some nonnegative value on success, probably // so certain vendors could be POSIX-compliant without changing anything. Solaris seems to return 1 -// on success, for example. If any other examples crop up, add them here. -#if IS_SOLARIS +// on success, for example. If any other examples crop up, add them here, or figure out how to +// do this with autoconf instead. +// +#if defined(__sun) # define UNAME_SUCCESS_POSIX 1 #else # define UNAME_SUCCESS_ZERO 1 #endif +// Whether to try unaligned access checks in one unit test of dubious value +#if !defined(__sun) && !defined(__hpux) +# define ENABLE_ALIGNMENT_TEST 1 +#endif + //============================================================================= // Miscellaneous // @@ -515,10 +354,15 @@ // A scalar that matches the sizeof a pointer typedef uintptr_t ptr_size_type; -// Check integer representation -# if !(USES_2S_COMPLEMENT) -# error "Tripwire will only work on a 2's complement CPU. Check \"platform.h\"." -# endif +// Check signed integer representation +// This check has been around for ages, and I'm not sure it's still accurate. +// It's not like there's a lot of contemporary non-2s-complement hardware out there +// to try this on. Anyway, the configure script always defines USES_2S_COMPLEMENT to 1 +// without actually checking anything, so this check wasn't performing a valuable service here. +// +//#if !(USES_2S_COMPLEMENT) +//# error "Tripwire will only work on a 2's complement CPU. Check \"platform.h\"." +//#endif #endif // __PLATFORM_H diff --git a/src/core/stdcore.h b/src/core/stdcore.h index 7b94311..e18558d 100644 --- a/src/core/stdcore.h +++ b/src/core/stdcore.h @@ -45,50 +45,6 @@ #include "platform.h" -//--Disable some level 4 warnings - -#if IS_MSVC - -# define NOMINMAX //--Disable min/max macros - -#include // ARGH!! This resumes certain warnings! - -# pragma warning(disable : 4786) // Token Name > 255 -# pragma warning(disable : 4127) // constant expression (e.g. ASSERT) -# pragma warning(disable : 4291) // Incorrectly called when new(nothrow)!!! -# pragma warning(disable : 4097) // Type synonyms are good! -# pragma warning(disable : 4511) // Can't create copy ctor! (e.g.Private CTOR) -# pragma warning(disable : 4512) // Can't create assignment!(e.g.Private CTOR) -# pragma warning(disable : 4100) // Formal argument not used -# pragma warning(disable : 4710) // Compiler did not inline function - -# ifndef DEBUG // ASSERT's are disabled give a lot of these -# pragma warning(disable : 4702) // ---Unreachable Code -# endif - -/* NOTE:RAD:05/09/1999 -- Plaguers STDCPP implementation is SOOO bad - it creates all these errors when compiling at W4. By doing a push - before disabling them, we can still generate them for ourselves - without a lot of noise. The warnings before this push, we want to - always disable. */ - -# pragma warning(push) - -# pragma warning(disable : 4663) // Old template specialization syntax -# pragma warning(disable : 4018) // Signed unsigned mismatch -# pragma warning(disable : 4245) // Signed unsigned mismatch -# pragma warning(disable : 4663) // Use new template specialization syntax: template<> -# pragma warning(disable : 4701) // local variable 'X' may be used without having been initialized -# pragma warning(disable : 4510) // 'X' : default constructor could not be generated -# pragma warning(disable : 4610) // struct 'X' can never be instantiated - user defined constructor required -# pragma warning(disable : 4146) // unary minus operator applied to unsigned type, result still unsigned -# pragma warning(disable : 4244) // '=' : conversion from 'unsigned int' to 'char', possible loss of data -# pragma warning(disable : 4511) -# pragma warning(disable : 4503) - -#endif // #if IS_MSVC - - //--Include Standard CPP Declarations #include @@ -104,20 +60,17 @@ #include #include #include + #if HAVE_LOCALE # include #endif + #if HAVE_LIMITS # include #endif -#if IS_MSVC -# pragma warning(pop) // Resume W4 msgs for TSS code -#endif - //--Include Platform Specific Declarations - //--Include Common Core Declarations #include "./tchar.h" @@ -125,5 +78,4 @@ #include "./error.h" #include "./debug.h" - #endif //__STDCORE_H diff --git a/src/core/twlimits.h b/src/core/twlimits.h index b42f100..28acd39 100644 --- a/src/core/twlimits.h +++ b/src/core/twlimits.h @@ -137,7 +137,7 @@ private: enum Limits { LIMIT_MIN = -1, - LIMIT_MAX = 1000000 + LIMIT_MAX = INT_MAX }; virtual int GetMax() diff --git a/src/core/twlocale.cpp b/src/core/twlocale.cpp index ec0e456..5000af4 100644 --- a/src/core/twlocale.cpp +++ b/src/core/twlocale.cpp @@ -199,14 +199,8 @@ TSTRING& cTWLocale::FormatNumber(uint64_t ui, TSTRING& strBuf) return (FormatNumber((int64_t)ui, strBuf)); else { -#if IS_MSVC - // MSVC can't convert from uint64_t to a double for some reason - strBuf = TSS_GetString(cCore, core::STR_NUMBER_TOO_BIG); - return (strBuf); -#else ASSERT(std::numeric_limits::max() >= TSS_UINT64_MAX); return (cFormatNumberUtil::Format((double)ui, strBuf)); -#endif } } diff --git a/src/core/types.h b/src/core/types.h index ffbcc4f..960908d 100644 --- a/src/core/types.h +++ b/src/core/types.h @@ -37,13 +37,18 @@ #include "platform.h" #if HAVE_STDINT_H -#include +# include #endif +#if HAVE_LIMITS_H +# include +#endif //----------------------------------------------------------------------------- // standard TSS types //----------------------------------------------------------------------------- + +// Sensible defaults in case there's no stdint.h #if !HAVE_STDINT_H typedef unsigned char uint8_t; typedef signed char int8_t; @@ -75,72 +80,35 @@ typedef unsigned long long uint64_t; #endif #endif // !HAVE_STDINT_H -// other Win32 definitions -//typedef uint16 UINT; -//typedef uint32_t DWORD; -//----------------------------------------------------------------------------- -// Limits -- should be platform independent, right? ( assumes 2's complement numbers ) -//----------------------------------------------------------------------------- - - -#if (!(USES_2S_COMPLEMENT)) -# error limits.h depends on 2s complement integers. Check core/types.h +#if HAVE_STDINT_H +# define TSS_INT8_MIN INT8_MIN +# define TSS_INT8_MAX INT8_MAX +# define TSS_UINT8_MAX UINT8_MAX +# define TSS_INT16_MIN INT16_MIN +# define TSS_INT16_MAX INT16_MAX +# define TSS_UINT16_MAX UINT16_MAX +# define TSS_INT32_MIN INT32_MIN +# define TSS_INT32_MAX INT32_MAX +# define TSS_UINT32_MAX UINT32_MAX +# define TSS_INT64_MIN INT64_MIN +# define TSS_INT64_MAX INT64_MAX +# define TSS_UINT64_MAX UINT64_MAX +#else +# define TSS_INT8_MIN (-127 - 1) +# define TSS_INT8_MAX 127 +# define TSS_UINT8_MAX 0xFFU +# define TSS_INT16_MIN (-32767 - 1) +# define TSS_INT16_MAX 32767 +# define TSS_UINT16_MAX 0xFFFFU +# define TSS_INT32_MIN (-2147483647 - 1) +# define TSS_INT32_MAX 2147483647 +# define TSS_UINT32_MAX 0xFFFFFFFFU +# define TSS_INT64_MIN (-9223372036854775807LL - 1) +# define TSS_INT64_MAX 9223372036854775807LL +# define TSS_UINT64_MAX 0xFFFFFFFFFFFFFFFFULL #endif -#include // defines limits for built-in types - -#define TSS_INT8_MIN (-127 - 1) -#define TSS_INT8_MAX 127 -#define TSS_UINT8_MAX 0xFFU -#define TSS_INT16_MIN (-32767 - 1) -#define TSS_INT16_MAX 32767 -#define TSS_UINT16_MAX 0xFFFFU -#define TSS_INT32_MIN (-2147483647 - 1) -#define TSS_INT32_MAX 2147483647 -#define TSS_UINT32_MAX 0xFFFFFFFFU -#define TSS_INT64_MIN (-9223372036854775807LL - 1) -#define TSS_INT64_MAX 9223372036854775807LL -#define TSS_UINT64_MAX 0xFFFFFFFFFFFFFFFFULL - -/* -//----------------------------------------------------------------------------- -// numeric_limits : TODO:BAM eventually I should get around to finishing these.... -//----------------------------------------------------------------------------- - -#pragma warning( push ) -pragma warning( disable: 4663 ) // Use new template specialization syntax: template<> -#define NOMINMAX // turn off min() and max() macros -#include -#pragma warning( pop ) - -// -// define numeric_limits for our types -// -// NOTE: assumes std::numeric_limits< int > does not depend on signedness of type -// TODO:BAM -- add members like digits and digits10 -// TODO:BAM -- define floating point numeric_limits -#define DECLARE_INTEGRAL_NUM_LIMITS( intT, minVal, maxVal, nDigits, ) \ - template<> class numeric_limits< intT > : public std::numeric_limits< int > \ - {\ - static intT (min)() throw() { return ( minVal ); } \ - static intT (max)() throw() { return ( maxVal ); } \ - enum { digits = 0 }; - enum { digits = 0 }; - }; - -// NOTE: assumes ( std::numeric_limits< int >::is_specialized == true ) -namespace std -{ -#if IS_UNIX - DECLARE_INTEGRAL_NUM_LIMITS( int8, SCHAR_MIN, SCHAR_MAX ); - DECLARE_INTEGRAL_NUM_LIMITS( int16, SHRT_MIN, SHRT_MAX ); - DECLARE_INTEGRAL_NUM_LIMITS( int32, LONG_MIN, LONG_MAX ); - -#endif -} -*/ - //----------------------------------------------------------------------------- // Byte Swapping //----------------------------------------------------------------------------- diff --git a/src/cryptlib/Makefile.in b/src/cryptlib/Makefile.in index 09cd263..3c8ec68 100644 --- a/src/cryptlib/Makefile.in +++ b/src/cryptlib/Makefile.in @@ -214,6 +214,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORE_CRYPT_O = @CORE_CRYPT_O@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ diff --git a/src/cryptlib/cryptest.dsp b/src/cryptlib/cryptest.dsp deleted file mode 100644 index 73e5eea..0000000 --- a/src/cryptlib/cryptest.dsp +++ /dev/null @@ -1,328 +0,0 @@ -# Microsoft Developer Studio Project File - Name="cryptest" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=cryptest - Win32 Unicode Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "cryptest.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "cryptest.mak" CFG="cryptest - Win32 Unicode Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "cryptest - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "cryptest - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE "cryptest - Win32 Unicode Release" (based on "Win32 (x86) Console Application") -!MESSAGE "cryptest - Win32 Unicode Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName ""$/cryptlib/cryptest", FWAAAAAA" -# PROP Scc_LocalPath "." -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "cryptest - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "cryptes0" -# PROP BASE Intermediate_Dir "cryptes0" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "CTRelease" -# PROP Intermediate_Dir "CTRelease" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_LITTLE_ENDIAN" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib shell32.lib lib_r/cryptlib.lib /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "cryptest - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "cryptes1" -# PROP BASE Intermediate_Dir "cryptes1" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "CTDebug" -# PROP Intermediate_Dir "CTDebug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_LITTLE_ENDIAN" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib advapi32.lib lib_d/cryptlib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ELSEIF "$(CFG)" == "cryptest - Win32 Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "cryptest___Win32_Unicode_Release" -# PROP BASE Intermediate_Dir "cryptest___Win32_Unicode_Release" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "cryptest_Unicode_Release" -# PROP Intermediate_Dir "cryptest_Unicode_Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_LITTLE_ENDIAN" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_LITTLE_ENDIAN" /D "_UNICODE" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib shell32.lib lib_r/cryptlib.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib shell32.lib cryptlib_Unicode_Release/cryptlib.lib /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "cryptest - Win32 Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "cryptest___Win32_Unicode_Debug" -# PROP BASE Intermediate_Dir "cryptest___Win32_Unicode_Debug" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "cryptest_Unicode_Debug" -# PROP Intermediate_Dir "cryptest_Unicode_Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_LITTLE_ENDIAN" /YX /FD /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_LITTLE_ENDIAN" /D "_UNICODE" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib lib_d/cryptlib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib advapi32.lib cryptlib_Unicode_Debug/cryptlib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "cryptest - Win32 Release" -# Name "cryptest - Win32 Debug" -# Name "cryptest - Win32 Unicode Release" -# Name "cryptest - Win32 Unicode Debug" -# Begin Group "Data Files" - -# PROP Default_Filter ".dat;.txt" -# Begin Source File - -SOURCE=.\3wayval.dat -# End Source File -# Begin Source File - -SOURCE=.\blum1024.dat -# End Source File -# Begin Source File - -SOURCE=.\blum2048.dat -# End Source File -# Begin Source File - -SOURCE=.\blum512.dat -# End Source File -# Begin Source File - -SOURCE=.\castval.dat -# End Source File -# Begin Source File - -SOURCE=.\descert.dat -# End Source File -# Begin Source File - -SOURCE=.\dhparams.dat -# End Source File -# Begin Source File - -SOURCE=.\diamond.dat -# End Source File -# Begin Source File - -SOURCE=.\dsa1024.dat -# End Source File -# Begin Source File - -SOURCE=.\dsa512.dat -# End Source File -# Begin Source File - -SOURCE=.\elgc1024.dat -# End Source File -# Begin Source File - -SOURCE=.\elgc2048.dat -# End Source File -# Begin Source File - -SOURCE=.\elgc512.dat -# End Source File -# Begin Source File - -SOURCE=.\elgs1024.dat -# End Source File -# Begin Source File - -SOURCE=.\elgs2048.dat -# End Source File -# Begin Source File - -SOURCE=.\elgs512.dat -# End Source File -# Begin Source File - -SOURCE=.\gostval.dat -# End Source File -# Begin Source File - -SOURCE=.\havalcer.dat -# End Source File -# Begin Source File - -SOURCE=.\ideaval.dat -# End Source File -# Begin Source File - -SOURCE=.\luc1024.dat -# End Source File -# Begin Source File - -SOURCE=.\luc2048.dat -# End Source File -# Begin Source File - -SOURCE=.\luc512.dat -# End Source File -# Begin Source File - -SOURCE=.\lucc1024.dat -# End Source File -# Begin Source File - -SOURCE=.\lucc512.dat -# End Source File -# Begin Source File - -SOURCE=.\lucdif.dat -# End Source File -# Begin Source File - -SOURCE=.\lucs1024.dat -# End Source File -# Begin Source File - -SOURCE=.\lucs512.dat -# End Source File -# Begin Source File - -SOURCE=.\rabi1024.dat -# End Source File -# Begin Source File - -SOURCE=.\rabi2048.dat -# End Source File -# Begin Source File - -SOURCE=.\rabi512.dat -# End Source File -# Begin Source File - -SOURCE=.\rc5val.dat -# End Source File -# Begin Source File - -SOURCE=.\rsa1024.dat -# End Source File -# Begin Source File - -SOURCE=.\rsa2048.dat -# End Source File -# Begin Source File - -SOURCE=.\rsa512.dat -# End Source File -# Begin Source File - -SOURCE=.\rsa512a.dat -# End Source File -# Begin Source File - -SOURCE=.\saferval.dat -# End Source File -# Begin Source File - -SOURCE=.\sharkval.dat -# End Source File -# Begin Source File - -SOURCE=.\squareva.dat -# End Source File -# Begin Source File - -SOURCE=.\usage.dat -# End Source File -# End Group -# Begin Source File - -SOURCE=.\bench.cpp -# End Source File -# Begin Source File - -SOURCE=.\bench.h -# End Source File -# Begin Source File - -SOURCE=.\test.cpp -# End Source File -# Begin Source File - -SOURCE=.\validat1.cpp -# End Source File -# Begin Source File - -SOURCE=.\validat2.cpp -# End Source File -# Begin Source File - -SOURCE=.\validat3.cpp -# End Source File -# Begin Source File - -SOURCE=.\validate.h -# End Source File -# End Target -# End Project diff --git a/src/cryptlib/cryptest.dsw b/src/cryptlib/cryptest.dsw deleted file mode 100644 index 7a55b03..0000000 --- a/src/cryptlib/cryptest.dsw +++ /dev/null @@ -1,52 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "cryptest"=".\cryptest.dsp" - Package Owner=<4> - -Package=<5> -{{{ - begin source code control - "$/Code/crypto++", JAHAAAAA - . - end source code control -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name cryptlib - End Project Dependency -}}} - -############################################################################### - -Project: "cryptlib"=".\cryptlib.dsp" - Package Owner=<4> - -Package=<5> -{{{ - begin source code control - "$/Code/crypto++", JAHAAAAA - . - end source code control -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/src/cryptlib/cryptlib.dsp b/src/cryptlib/cryptlib.dsp deleted file mode 100644 index 60efd6c..0000000 --- a/src/cryptlib/cryptlib.dsp +++ /dev/null @@ -1,776 +0,0 @@ -# Microsoft Developer Studio Project File - Name="cryptlib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=cryptlib - Win32 Unicode Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "cryptlib.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "cryptlib.mak" CFG="cryptlib - Win32 Unicode Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "cryptlib - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "cryptlib - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "cryptlib - Win32 Unicode Release MinDependency" (based on "Win32 (x86) Static Library") -!MESSAGE "cryptlib - Win32 Unicode Release" (based on "Win32 (x86) Static Library") -!MESSAGE "cryptlib - Win32 Unicode Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName ""$/Code/Tripwire/2.0/ZZZ Consolidation Test/crypto", BAAAAAAA" -# PROP Scc_LocalPath "." -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "cryptlib - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "cryptlib" -# PROP BASE Intermediate_Dir "cryptlib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "lib_r" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "_LITTLE_ENDIAN" /Yu"pch.h" /FD /c -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "cryptlib - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "cryptli0" -# PROP BASE Intermediate_Dir "cryptli0" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "lib_d" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MTd /W3 /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "_LITTLE_ENDIAN" /Yu"pch.h" /FD /c -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "cryptlib - Win32 Unicode Release MinDependency" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "cryptlib" -# PROP BASE Intermediate_Dir "cryptlib" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../lib_r" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /Yu"pch.h" /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "_LITTLE_ENDIAN" /Yu"pch.h" /FD /c -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "cryptlib - Win32 Unicode Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "cryptlib___Win32_Unicode_Release" -# PROP BASE Intermediate_Dir "cryptlib___Win32_Unicode_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "cryptlib_Unicode_Release" -# PROP Intermediate_Dir "cryptlib_Unicode_Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "_LITTLE_ENDIAN" /Yu"pch.h" /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "_LITTLE_ENDIAN" /D "_UNICODE" /Yu"pch.h" /FD /c -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "cryptlib - Win32 Unicode Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "cryptlib___Win32_Unicode_Debug" -# PROP BASE Intermediate_Dir "cryptlib___Win32_Unicode_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "cryptlib_Unicode_Debug" -# PROP Intermediate_Dir "cryptlib_Unicode_Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "_LITTLE_ENDIAN" /Yu"pch.h" /FD /c -# ADD CPP /nologo /MTd /W3 /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "_LITTLE_ENDIAN" /D "_UNICODE" /Yu"pch.h" /FD /c -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "cryptlib - Win32 Release" -# Name "cryptlib - Win32 Debug" -# Name "cryptlib - Win32 Unicode Release MinDependency" -# Name "cryptlib - Win32 Unicode Release" -# Name "cryptlib - Win32 Unicode Debug" -# Begin Source File - -SOURCE=.\3way.cpp -# End Source File -# Begin Source File - -SOURCE=.\3way.h -# End Source File -# Begin Source File - -SOURCE=.\algebra.cpp -# End Source File -# Begin Source File - -SOURCE=.\algebra.h -# End Source File -# Begin Source File - -SOURCE=.\asn.cpp -# End Source File -# Begin Source File - -SOURCE=.\asn.h -# End Source File -# Begin Source File - -SOURCE=.\base64.cpp -# End Source File -# Begin Source File - -SOURCE=.\base64.h -# End Source File -# Begin Source File - -SOURCE=.\bfinit.cpp -# End Source File -# Begin Source File - -SOURCE=.\blowfish.cpp -# End Source File -# Begin Source File - -SOURCE=.\blowfish.h -# End Source File -# Begin Source File - -SOURCE=.\blumgold.cpp -# End Source File -# Begin Source File - -SOURCE=.\blumgold.h -# End Source File -# Begin Source File - -SOURCE=.\blumshub.cpp -# End Source File -# Begin Source File - -SOURCE=.\blumshub.h -# End Source File -# Begin Source File - -SOURCE=.\cast.cpp -# End Source File -# Begin Source File - -SOURCE=.\cast.h -# End Source File -# Begin Source File - -SOURCE=.\cast128s.cpp -# End Source File -# Begin Source File - -SOURCE=.\config.h -# End Source File -# Begin Source File - -SOURCE=.\crc.cpp -# End Source File -# Begin Source File - -SOURCE=.\crc.h -# End Source File -# Begin Source File - -SOURCE=.\cryptlib.cpp -# End Source File -# Begin Source File - -SOURCE=.\cryptlib.h -# End Source File -# Begin Source File - -SOURCE=.\default.cpp -# End Source File -# Begin Source File - -SOURCE=.\default.h -# End Source File -# Begin Source File - -SOURCE=.\des.cpp -# End Source File -# Begin Source File - -SOURCE=.\des.h -# End Source File -# Begin Source File - -SOURCE=.\dessp.cpp -# End Source File -# Begin Source File - -SOURCE=.\dh.cpp -# End Source File -# Begin Source File - -SOURCE=.\dh.h -# End Source File -# Begin Source File - -SOURCE=.\diamond.cpp -# End Source File -# Begin Source File - -SOURCE=.\diamond.h -# End Source File -# Begin Source File - -SOURCE=.\diamondt.cpp -# End Source File -# Begin Source File - -SOURCE=.\dsa.cpp -# End Source File -# Begin Source File - -SOURCE=.\dsa.h -# End Source File -# Begin Source File - -SOURCE=.\ec2n.cpp -# End Source File -# Begin Source File - -SOURCE=.\ec2n.h -# End Source File -# Begin Source File - -SOURCE=.\eccrypto.cpp -# End Source File -# Begin Source File - -SOURCE=.\eccrypto.h -# End Source File -# Begin Source File - -SOURCE=.\ecp.cpp -# End Source File -# Begin Source File - -SOURCE=.\ecp.h -# End Source File -# Begin Source File - -SOURCE=.\elgamal.cpp -# End Source File -# Begin Source File - -SOURCE=.\elgamal.h -# End Source File -# Begin Source File - -SOURCE=.\eprecomp.cpp -# End Source File -# Begin Source File - -SOURCE=.\eprecomp.h -# End Source File -# Begin Source File - -SOURCE=.\files.cpp -# End Source File -# Begin Source File - -SOURCE=.\files.h -# End Source File -# Begin Source File - -SOURCE=.\filters.cpp -# End Source File -# Begin Source File - -SOURCE=.\filters.h -# End Source File -# Begin Source File - -SOURCE=.\forkjoin.cpp -# End Source File -# Begin Source File - -SOURCE=.\forkjoin.h -# End Source File -# Begin Source File - -SOURCE=.\fstream -# End Source File -# Begin Source File - -SOURCE=.\gf256.cpp -# End Source File -# Begin Source File - -SOURCE=.\gf256.h -# End Source File -# Begin Source File - -SOURCE=.\gf2_32.cpp -# End Source File -# Begin Source File - -SOURCE=.\gf2_32.h -# End Source File -# Begin Source File - -SOURCE=.\gf2n.cpp -# End Source File -# Begin Source File - -SOURCE=.\gf2n.h -# End Source File -# Begin Source File - -SOURCE=.\gost.cpp -# End Source File -# Begin Source File - -SOURCE=.\gost.h -# End Source File -# Begin Source File - -SOURCE=.\gzip.cpp -# End Source File -# Begin Source File - -SOURCE=.\gzip.h -# End Source File -# Begin Source File - -SOURCE=.\haval.cpp -# End Source File -# Begin Source File - -SOURCE=.\haval.h -# End Source File -# Begin Source File - -SOURCE=.\hex.cpp -# End Source File -# Begin Source File - -SOURCE=.\hex.h -# End Source File -# Begin Source File - -SOURCE=.\hmac.h -# End Source File -# Begin Source File - -SOURCE=.\idea.cpp -# End Source File -# Begin Source File - -SOURCE=.\idea.h -# End Source File -# Begin Source File - -SOURCE=.\integer.cpp -# End Source File -# Begin Source File - -SOURCE=.\integer.h -# End Source File -# Begin Source File - -SOURCE=.\iomanip -# End Source File -# Begin Source File - -SOURCE=.\iosfwd -# End Source File -# Begin Source File - -SOURCE=.\iostream -# End Source File -# Begin Source File - -SOURCE=.\iterhash.cpp -# End Source File -# Begin Source File - -SOURCE=.\iterhash.h -# End Source File -# Begin Source File - -SOURCE=.\lubyrack.h -# End Source File -# Begin Source File - -SOURCE=.\luc.cpp -# End Source File -# Begin Source File - -SOURCE=.\luc.h -# End Source File -# Begin Source File - -SOURCE=.\md5.cpp -# End Source File -# Begin Source File - -SOURCE=.\md5.h -# End Source File -# Begin Source File - -SOURCE=.\md5mac.cpp -# End Source File -# Begin Source File - -SOURCE=.\md5mac.h -# End Source File -# Begin Source File - -SOURCE=.\mdc.h -# End Source File -# Begin Source File - -SOURCE=.\misc.cpp -# End Source File -# Begin Source File - -SOURCE=.\misc.h -# End Source File -# Begin Source File - -SOURCE=.\modarith.h -# End Source File -# Begin Source File - -SOURCE=.\modes.cpp -# End Source File -# Begin Source File - -SOURCE=.\modes.h -# End Source File -# Begin Source File - -SOURCE=.\nbtheory.cpp -# End Source File -# Begin Source File - -SOURCE=.\nbtheory.h -# End Source File -# Begin Source File - -SOURCE=.\oaep.cpp -# End Source File -# Begin Source File - -SOURCE=.\oaep.h -# End Source File -# Begin Source File - -SOURCE=.\pch.cpp -# ADD CPP /Yc"pch.h" -# End Source File -# Begin Source File - -SOURCE=.\pch.h -# End Source File -# Begin Source File - -SOURCE=.\pkcspad.cpp -# End Source File -# Begin Source File - -SOURCE=.\pkcspad.h -# End Source File -# Begin Source File - -SOURCE=.\polynomi.cpp -# End Source File -# Begin Source File - -SOURCE=.\polynomi.h -# End Source File -# Begin Source File - -SOURCE=.\pubkey.cpp -# End Source File -# Begin Source File - -SOURCE=.\pubkey.h -# End Source File -# Begin Source File - -SOURCE=.\queue.cpp -# End Source File -# Begin Source File - -SOURCE=.\queue.h -# End Source File -# Begin Source File - -SOURCE=.\rabin.cpp -# End Source File -# Begin Source File - -SOURCE=.\rabin.h -# End Source File -# Begin Source File - -SOURCE=.\randpool.cpp -# End Source File -# Begin Source File - -SOURCE=.\randpool.h -# End Source File -# Begin Source File - -SOURCE=.\rc5.cpp -# End Source File -# Begin Source File - -SOURCE=.\rc5.h -# End Source File -# Begin Source File - -SOURCE=.\ripemd.cpp -# End Source File -# Begin Source File - -SOURCE=.\ripemd.h -# End Source File -# Begin Source File - -SOURCE=.\rng.cpp -# End Source File -# Begin Source File - -SOURCE=.\rng.h -# End Source File -# Begin Source File - -SOURCE=.\rsa.cpp -# End Source File -# Begin Source File - -SOURCE=.\rsa.h -# End Source File -# Begin Source File - -SOURCE=.\rsarefcl.cpp -# End Source File -# Begin Source File - -SOURCE=.\rsarefcl.h -# End Source File -# Begin Source File - -SOURCE=.\safer.cpp -# End Source File -# Begin Source File - -SOURCE=.\safer.h -# End Source File -# Begin Source File - -SOURCE=.\sapphire.cpp -# End Source File -# Begin Source File - -SOURCE=.\sapphire.h -# End Source File -# Begin Source File - -SOURCE=.\seal.cpp -# End Source File -# Begin Source File - -SOURCE=.\seal.h -# End Source File -# Begin Source File - -SOURCE=.\secshare.cpp -# End Source File -# Begin Source File - -SOURCE=.\secshare.h -# End Source File -# Begin Source File - -SOURCE=.\secsplit.cpp -# End Source File -# Begin Source File - -SOURCE=.\secsplit.h -# End Source File -# Begin Source File - -SOURCE=.\sha.cpp -# End Source File -# Begin Source File - -SOURCE=.\sha.h -# End Source File -# Begin Source File - -SOURCE=.\shark.cpp -# End Source File -# Begin Source File - -SOURCE=.\shark.h -# End Source File -# Begin Source File - -SOURCE=.\sharkbox.cpp -# End Source File -# Begin Source File - -SOURCE=.\smartptr.h -# End Source File -# Begin Source File - -SOURCE=.\square.cpp -# End Source File -# Begin Source File - -SOURCE=.\square.h -# End Source File -# Begin Source File - -SOURCE=.\squaretb.cpp -# End Source File -# Begin Source File - -SOURCE=.\strstream -# End Source File -# Begin Source File - -SOURCE=.\tea.cpp -# End Source File -# Begin Source File - -SOURCE=.\tea.h -# End Source File -# Begin Source File - -SOURCE=.\tiger.cpp -# End Source File -# Begin Source File - -SOURCE=.\tiger.h -# End Source File -# Begin Source File - -SOURCE=.\tigertab.cpp -# End Source File -# Begin Source File - -SOURCE=.\wake.cpp -# End Source File -# Begin Source File - -SOURCE=.\wake.h -# End Source File -# Begin Source File - -SOURCE=.\words.h -# End Source File -# Begin Source File - -SOURCE=.\xormac.h -# End Source File -# Begin Source File - -SOURCE=.\zbits.cpp -# End Source File -# Begin Source File - -SOURCE=.\zbits.h -# End Source File -# Begin Source File - -SOURCE=.\zdeflate.cpp -# End Source File -# Begin Source File - -SOURCE=.\zdeflate.h -# End Source File -# Begin Source File - -SOURCE=.\zinflate.cpp -# End Source File -# Begin Source File - -SOURCE=.\zinflate.h -# End Source File -# Begin Source File - -SOURCE=.\ztrees.cpp -# End Source File -# Begin Source File - -SOURCE=.\ztrees.h -# End Source File -# End Target -# End Project diff --git a/src/db/Makefile.in b/src/db/Makefile.in index 53dbd15..e3fda66 100644 --- a/src/db/Makefile.in +++ b/src/db/Makefile.in @@ -211,6 +211,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORE_CRYPT_O = @CORE_CRYPT_O@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ diff --git a/src/fco/Makefile.in b/src/fco/Makefile.in index e57eb89..0fcd3f6 100644 --- a/src/fco/Makefile.in +++ b/src/fco/Makefile.in @@ -219,6 +219,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORE_CRYPT_O = @CORE_CRYPT_O@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ diff --git a/src/fs/Makefile.in b/src/fs/Makefile.in index 9982fc2..70475d8 100644 --- a/src/fs/Makefile.in +++ b/src/fs/Makefile.in @@ -214,6 +214,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORE_CRYPT_O = @CORE_CRYPT_O@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ diff --git a/src/fs/fspropcalc.cpp b/src/fs/fspropcalc.cpp index 9e87e5d..5b1eaad 100644 --- a/src/fs/fspropcalc.cpp +++ b/src/fs/fspropcalc.cpp @@ -103,7 +103,7 @@ bool cFSPropCalc::GetSymLinkStr(const TSTRING& strName, cArchive& arch, size_t s //Sadly if buf isn't big enough readlink 'succeeds' by truncating the string, so the only // clue your buffer might be too small is if you maxed it out. So we try again, within reason. -#if IS_SKYOS +#if READLINK_NULL_TERMINATES if ((size_t)rtn >= size - 1) //SkyOS wants space to null terminate the string it hands back, which is nice, I guess. #else if ((size_t)rtn == size) diff --git a/src/siggen/Makefile.in b/src/siggen/Makefile.in index 9a77a55..caaa41f 100644 --- a/src/siggen/Makefile.in +++ b/src/siggen/Makefile.in @@ -206,6 +206,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORE_CRYPT_O = @CORE_CRYPT_O@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ diff --git a/src/tripwire/Makefile.in b/src/tripwire/Makefile.in index e84a5d3..42a38f7 100644 --- a/src/tripwire/Makefile.in +++ b/src/tripwire/Makefile.in @@ -210,6 +210,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORE_CRYPT_O = @CORE_CRYPT_O@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ diff --git a/src/tripwire/mailmessage.h b/src/tripwire/mailmessage.h index 8d52800..19e500f 100644 --- a/src/tripwire/mailmessage.h +++ b/src/tripwire/mailmessage.h @@ -36,15 +36,13 @@ #include "core/error.h" #endif -#if IS_REDOX -# define restrict __restrict__ -#endif - #if SUPPORTS_NETWORKING && HAVE_SYS_SOCKET_H #include #endif -#define SOCKET int +#ifndef SOCKET +#define SOCKET int +#endif /////////////////////////////////////////////////////////////////////////////// // diff --git a/src/tripwire/smtpmailmessage.cpp b/src/tripwire/smtpmailmessage.cpp index bed64f5..ad191df 100644 --- a/src/tripwire/smtpmailmessage.cpp +++ b/src/tripwire/smtpmailmessage.cpp @@ -71,26 +71,29 @@ * INADDR_NONE, but it's pretty standard. If not, * then the OS _should_ define it for us. */ -# ifndef INADDR_NONE -# define INADDR_NONE 0xffffffff -# endif +#ifndef INADDR_NONE +# define INADDR_NONE 0xffffffff +#endif #include -# define INVALID_SOCKET -1 +#ifndef INVALID_SOCKET +# define INVALID_SOCKET -1 +#endif -# if IS_AROS -# ifndef HAVE_GETHOSTNAME -# define HAVE_GETHOSTNAME 1 -# endif -# endif +#if IS_AROS +# ifndef HAVE_GETHOSTNAME +# define HAVE_GETHOSTNAME 1 +# endif +#endif -# ifndef HAVE_GETHOSTNAME + +#ifndef HAVE_GETHOSTNAME static int gethostname(char* name, int namelen) { name[0] = '\0'; -# if HAVE_SYS_UTSNAME_H +#if HAVE_SYS_UTSNAME_H struct utsname myname; uname(&myname); @@ -105,28 +108,11 @@ static int gethostname(char* name, int namelen) return -1; // equivalent of SOCKET_ERROR } -# else +#else strncpy(name, "localhost", namelen); -# endif +#endif } -# endif //HAVE_GETHOSTNAME - -// Unix does not require us to go though any silly DLL hoops, so we'll -// just #define the pointers to functions needed by Windows to be the -// berkely functions. -# define mPfnSocket socket -# define mPfnInetAddr inet_addr -# define mPfnGethostname gethostname -# define mPfnGethostbyname gethostbyname -# define mPfnConnect connect -# define mPfnCloseSocket close -# define mPfnSend send -# define mPfnRecv recv -# define mPfnSelect select -# define mPfnNtohl ntohl -# define mPfnHtonl htonl -# define mPfnNtohs ntohs -# define mPfnHtons htons +#endif //HAVE_GETHOSTNAME // // TODO - maybe convert this SMTP code to non-blocking socket calls, or use @@ -179,43 +165,31 @@ long cSMTPMailMessage::GetServerAddress() if (bIsNumeric) { -# ifndef HAVE_SYS_SOCKET_H - return 0; -# else // convert the numberic address to a long - return mPfnInetAddr(sNarrowString.c_str()); -# endif + return inet_addr(sNarrowString.c_str()); } else { -# if IS_SORTIX || !defined(HAVE_SYS_SOCKET_H) - return INADDR_NONE; -# else // do a DNS lookup of the hostname and get the long - hostent* ent = mPfnGethostbyname(sNarrowString.c_str()); + hostent* ent = gethostbyname(sNarrowString.c_str()); if (!ent) return INADDR_NONE; else return *(long*)ent->h_addr_list[0]; -# endif } } - /////////////////////////////////////////////////////////////////////////////// // // Create and open the socket connection // bool cSMTPMailMessage::OpenConnection() { -# ifndef HAVE_SYS_SOCKET_H - return false; -# else // Initialize the socket structure sockaddr_in sockAddrIn; memset(&sockAddrIn, 0, sizeof(sockaddr)); sockAddrIn.sin_family = AF_INET; - sockAddrIn.sin_port = mPfnHtons(mPortNumber); + sockAddrIn.sin_port = htons(mPortNumber); uint32_t iServerAddress = GetServerAddress(); sockAddrIn.sin_addr.s_addr = iServerAddress; @@ -232,7 +206,7 @@ bool cSMTPMailMessage::OpenConnection() } // Create the socket - mSocket = mPfnSocket(AF_INET, SOCK_STREAM, 0); + mSocket = socket(AF_INET, SOCK_STREAM, 0); if (mSocket == INVALID_SOCKET) { DecodeError(); @@ -241,7 +215,7 @@ bool cSMTPMailMessage::OpenConnection() } // Make the connection - int connectVal = mPfnConnect(mSocket, (struct sockaddr*)&sockAddrIn, sizeof(sockAddrIn)); + int connectVal = connect(mSocket, (struct sockaddr*)&sockAddrIn, sizeof(sockAddrIn)); if (connectVal < 0) { DecodeError(); @@ -254,7 +228,6 @@ bool cSMTPMailMessage::OpenConnection() } return true; -# endif } @@ -267,7 +240,7 @@ bool cSMTPMailMessage::CloseConnection() if (INVALID_SOCKET != mSocket) { // close the connection - int closeVal = mPfnCloseSocket(mSocket); + int closeVal = close(mSocket); if (closeVal != 0) { DecodeError(); @@ -341,7 +314,7 @@ bool cSMTPMailMessage::MailMessage() ASSERT(strmSend.str().length() == 0); // This bad boy better be empty. // get our hostname for the HELO message - if (mPfnGethostname(sLocalHost, 256) < 0) + if (gethostname(sLocalHost, 256) < 0) { DecodeError(); return false; @@ -474,9 +447,6 @@ bool cSMTPMailMessage::MailMessage() // bool cSMTPMailMessage::GetAcknowledgement() { -# ifndef HAVE_SYS_SOCKET_H - return false; -# else cDebug d("cSMTPMailMessage::GetAcknowledgement"); const int bufsize = 512; @@ -498,10 +468,10 @@ bool cSMTPMailMessage::GetAcknowledgement() tv.tv_usec = 0; // Wait up to sixty seconds fot data to show up on the socket to be read - if (mPfnSelect(mSocket + 1, &socketSet, NULL, NULL, &tv) == 1) + if (select(mSocket + 1, &socketSet, NULL, NULL, &tv) == 1) { // Get the reply message - bytes = mPfnRecv(mSocket, sTempString, 512, 0); + bytes = recv(mSocket, sTempString, 512, 0); // TODO:BAM -- this should be changed to use 'cStringUtil' for (int j = 0; j < bytes && i < bufsize; j++, i++) @@ -532,19 +502,17 @@ bool cSMTPMailMessage::GetAcknowledgement() throw eMailSMTPServer(estr.str()); return false; } -# endif } void cSMTPMailMessage::SendString(const std::string& str) { cDebug d("util_SendString()"); -# if HAVE_SYS_SOCKET_H + if (str.length() < 800) d.TraceDebug("Sending \"%s\"\n", str.c_str()); else d.TraceDebug("Sending (truncated in this debug output)\"%s\"\n", std::string(str.c_str(), 800).c_str()); - mPfnSend(mSocket, str.c_str(), str.length(), 0); -# endif + send(mSocket, str.c_str(), str.length(), 0); } diff --git a/src/tripwire/syslog_trip.cpp b/src/tripwire/syslog_trip.cpp index b3a82b1..3ab4246 100644 --- a/src/tripwire/syslog_trip.cpp +++ b/src/tripwire/syslog_trip.cpp @@ -49,11 +49,8 @@ #include "tw/twerrors.h" #include "tw/twstrings.h" -// TODO: Handle this in a proper autoconf way -#if IS_AROS +#if HAVE_PROTO_BSDSOCKET_H # include -# define openlog(a, b, c) -# define closelog() #endif /////////////////////////////////////////////////////////////////////////////// @@ -70,8 +67,14 @@ void cSyslog::Log(const TCHAR* programName, cSyslog::LogType logType, const TCHA const char* ident = programName; const char* msg = message; +#if HAVE_OPENLOG openlog(ident, LOG_PID, LOG_USER); +#endif + syslog(LOG_NOTICE, "%s", msg); +#if HAVE_CLOSELOG closelog(); #endif + +#endif } diff --git a/src/tripwire/twcmdline.cpp b/src/tripwire/twcmdline.cpp index 7f1bef1..d032817 100644 --- a/src/tripwire/twcmdline.cpp +++ b/src/tripwire/twcmdline.cpp @@ -512,15 +512,11 @@ static void FillOutConfigInfo(cTWModeCommon* pModeInfo, const cConfigFile& cf) if (cf.Lookup(TSTRING(_T("HASH_DIRECT_IO")), str)) { -#if SUPPORTS_DIRECT_IO if (_tcsicmp(str.c_str(), _T("true")) == 0) { pModeInfo->mbDirectIO = true; cArchiveSigGen::SetUseDirectIO(true); } -#else - throw eTWDirectIONotSupported(); -#endif } if (cf.Lookup(TSTRING(_T("RESOLVE_IDS_TO_NAMES")), str)) diff --git a/src/tw/Makefile.in b/src/tw/Makefile.in index 517566b..d2dbac9 100644 --- a/src/tw/Makefile.in +++ b/src/tw/Makefile.in @@ -217,6 +217,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORE_CRYPT_O = @CORE_CRYPT_O@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ diff --git a/src/tw/twinit.cpp b/src/tw/twinit.cpp index 058ac8f..23a8ffa 100644 --- a/src/tw/twinit.cpp +++ b/src/tw/twinit.cpp @@ -79,9 +79,18 @@ #if IS_AROS #include + +#if HAVE_PROTO_EXEC_H #include +#endif + +#if HAVE_PROTO_BSDSOCKET_H #include +#endif + +#if HAVE_BSDSOCKET_SOCKETBASETAGS_H #include +#endif static bool aros_socketbase_init(); #endif diff --git a/src/twadmin/Makefile.in b/src/twadmin/Makefile.in index f0df39b..de13006 100644 --- a/src/twadmin/Makefile.in +++ b/src/twadmin/Makefile.in @@ -206,6 +206,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORE_CRYPT_O = @CORE_CRYPT_O@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ diff --git a/src/twcrypto/Makefile.in b/src/twcrypto/Makefile.in index 9931036..2b26d0f 100644 --- a/src/twcrypto/Makefile.in +++ b/src/twcrypto/Makefile.in @@ -212,6 +212,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORE_CRYPT_O = @CORE_CRYPT_O@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ diff --git a/src/twparser/Makefile.in b/src/twparser/Makefile.in index 1406e12..4f49930 100644 --- a/src/twparser/Makefile.in +++ b/src/twparser/Makefile.in @@ -213,6 +213,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORE_CRYPT_O = @CORE_CRYPT_O@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ diff --git a/src/twprint/Makefile.in b/src/twprint/Makefile.in index 2338d61..da81015 100644 --- a/src/twprint/Makefile.in +++ b/src/twprint/Makefile.in @@ -206,6 +206,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORE_CRYPT_O = @CORE_CRYPT_O@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ diff --git a/src/twtest/Makefile.in b/src/twtest/Makefile.in index 5c4d0d9..e32f38d 100644 --- a/src/twtest/Makefile.in +++ b/src/twtest/Makefile.in @@ -246,6 +246,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORE_CRYPT_O = @CORE_CRYPT_O@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ diff --git a/src/twtest/platform_t.cpp b/src/twtest/platform_t.cpp index a2d530b..f824d08 100644 --- a/src/twtest/platform_t.cpp +++ b/src/twtest/platform_t.cpp @@ -83,7 +83,8 @@ template AlignMe::AlignMe() // to have any need for that behavior, which begs the question of why // this test exists in the first place. // -bcox -#if (!IS_HPUX && !IS_SOLARIS) //Turns out Solaris SPARC is unhappy with this test too, btw +//Turns out Solaris SPARC is unhappy with this test too, btw +#if ENABLE_ALIGNMENT_TEST //TCOUT << _T("Testing alignment of size ") << ALIGN_SIZE << std::endl; // access a value in the byte array to see if it is aligned. if it isn't and the CPU @@ -233,96 +234,9 @@ template bool CanBeRepresentedAs(E e, T t) //////////////////////////// - -#if IS_LINUX -const TSTRING expected_os("Linux"); -#elif IS_DARWIN -const TSTRING expected_os("Darwin"); -#elif IS_CYGWIN -const TSTRING expected_os("CYGWIN_NT"); -#elif IS_DOS_DJGPP -const TSTRING expected_os("FreeDOS"); // This will likely fail for other DOS flavors -#elif IS_ANDROID -const TSTRING expected_os("Android"); -#elif IS_DRAGONFLYBSD -const TSTRING expected_os("DragonFly"); -#elif IS_MIDNIGHTBSD -const TSTRING expected_os("MidnightBSD"); -#elif IS_FREEBSD -const TSTRING expected_os("FreeBSD"); -#elif IS_NETBSD -const TSTRING expected_os("NetBSD"); -#elif IS_MIRBSD -const TSTRING expected_os("MirBSD"); -#elif IS_BITRIG -const TSTRING expected_os("Bitrig"); -#elif IS_LIBERTYBSD -const TSTRING expected_os("LibertyBSD"); -#elif IS_OPENBSD -const TSTRING expected_os("OpenBSD"); -#elif IS_SOLARIS -const TSTRING expected_os("SunOS"); -#elif (IS_OS400 || IS_PASE) -const TSTRING expected_os("OS400"); -#elif IS_AIX -const TSTRING expected_os("AIX"); -#elif IS_HPUX -const TSTRING expected_os("HP-UX"); -#elif IS_IRIX -const TSTRING expected_os("IRIX"); -#elif IS_OSF1 -const TSTRING expected_os("Tru64"); -#elif IS_MINIX -const TSTRING expected_os("Minix"); -#elif IS_HURD -const TSTRING expected_os("GNU"); -#elif IS_HAIKU -const TSTRING expected_os("Haiku"); -#elif IS_SYLLABLE -const TSTRING expected_os("Syllable"); -#elif IS_SKYOS -const TSTRING expected_os("SkyOS"); -#elif IS_SORTIX -const TSTRING expected_os("Sortix"); -#elif IS_MINT -const TSTRING expected_os("MiNT"); -#elif IS_AROS -const TSTRING expected_os("AROS"); -#elif IS_RTEMS -const TSTRING expected_os("RTEMS"); -#elif IS_RISCOS -const TSTRING expected_os("RISC OS"); -#elif IS_RISCOS -const TSTRING expected_os("Redox"); -#elif IS_QNX -const TSTRING expected_os("QNX"); -#else -const TSTRING expected_os("?!?!?"); -#endif - -void TestPlatformDetection() -{ -#if HAVE_SYS_UTSNAME_H - struct utsname os_info; -#if UNAME_SUCCESS_POSIX // Solaris documents uname() as succeding w/ any nonnegative value. This is actually the behavior specified by the POSIX standard, though in practice everyone else seems to return 0 on success. - TEST(uname(&os_info) >= 0); -#else - TEST(uname(&os_info) == 0); -#endif - - TSTRING observed_os(os_info.sysname); - - if (observed_os != expected_os) - TCERR << "Expected OS: " << expected_os << " | Observed OS: " << observed_os << std::endl; - - TEST(observed_os == expected_os); -#endif -} - void RegisterSuite_Platform() { RegisterTest("Platform", "Alignment", TestAlignment); RegisterTest("Platform", "Alignment2", TestAlignment2); RegisterTest("Platform", "Sizes", TestSizes); - RegisterTest("Platform", "PlatformDetection", TestPlatformDetection); } diff --git a/src/twtest/test.h b/src/twtest/test.h index 67de908..35c1894 100644 --- a/src/twtest/test.h +++ b/src/twtest/test.h @@ -98,7 +98,7 @@ void fail(const std::string& reason); // Could use AX_FUNC_MKDIR autoconf macro if we need to handle // any additional cases besides these -#if IS_MINGW +#if MKDIR_TAKES_SINGLE_ARG # define tw_mkdir(a,b) mkdir(a) #else # define tw_mkdir(a,b) mkdir(a,b) diff --git a/src/util/Makefile.in b/src/util/Makefile.in index 870a220..0298c99 100644 --- a/src/util/Makefile.in +++ b/src/util/Makefile.in @@ -211,6 +211,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CORE_CRYPT_O = @CORE_CRYPT_O@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ diff --git a/src/util/fileutil.cpp b/src/util/fileutil.cpp index 48027b2..4950ecf 100644 --- a/src/util/fileutil.cpp +++ b/src/util/fileutil.cpp @@ -206,7 +206,7 @@ bool cFileUtil::BackupFile(const TSTRING& filename, bool printWarningOnFailure) throw eFileWrite(filename, iFSServices::GetInstance()->GetErrString()); } -#if IS_DOS_DJGPP +#if USES_DOS_DEVICE_PATH TSTRING backup_filename = cDosPath::BackupName(cDosPath::AsNative(filename)); #else TSTRING backup_filename = filename;