diff --git a/config.h.in b/config.h.in index 0bb1744..a533797 100644 --- a/config.h.in +++ b/config.h.in @@ -18,6 +18,12 @@ /* Uses the Clang compiler */ #undef HAVE_CLANG +/* Define to 1 if you have the `close' function. */ +#undef HAVE_CLOSE + +/* Define to 1 if you have the `closedir' function. */ +#undef HAVE_CLOSEDIR + /* Define to 1 if you have the header file. */ #undef HAVE_COMMONCRYPTO_COMMONDIGEST_H @@ -36,12 +42,24 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DOOR_H +/* Define to 1 if you have the `fclose' function. */ +#undef HAVE_FCLOSE + /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H +/* Define to 1 if you have the `fopen' function. */ +#undef HAVE_FOPEN + +/* Define to 1 if you have the `fread' function. */ +#undef HAVE_FREAD + /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #undef HAVE_FSEEKO +/* Define to 1 if you have the `fstatat' function. */ +#undef HAVE_FSTATAT + /* Uses the GNU gcc compiler */ #undef HAVE_GCC @@ -69,6 +87,15 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LANGINFO_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS + +/* Define to 1 if you have the header file. */ +#undef HAVE_LOCALE + +/* Define to 1 if you have the `lstat' function. */ +#undef HAVE_LSTAT + /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H @@ -81,6 +108,15 @@ /* Define to 1 if you have the `mktemp' function. */ #undef HAVE_MKTEMP +/* Define to 1 if you have the `open' function. */ +#undef HAVE_OPEN + +/* Define to 1 if you have the `openat' function. */ +#undef HAVE_OPENAT + +/* Define to 1 if you have the `opendir' function. */ +#undef HAVE_OPENDIR + /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_MD5_H @@ -99,9 +135,27 @@ /* Define to 1 if you have the `posix_fadvise' function. */ #undef HAVE_POSIX_FADVISE +/* Define to 1 if you have the `read' function. */ +#undef HAVE_READ + +/* Define to 1 if you have the `readdir' function. */ +#undef HAVE_READDIR + +/* Define to 1 if you have the `readlink' function. */ +#undef HAVE_READLINK + +/* Define to 1 if you have the `readlinkat' function. */ +#undef HAVE_READLINKAT + /* Define to 1 if you have the header file. */ #undef HAVE_SIGNUM_H +/* Define to 1 if you have the `stat' function. */ +#undef HAVE_STAT + +/* Define to 1 if you have the `statx' function. */ +#undef HAVE_STATX + /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H @@ -111,6 +165,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H +/* Define if STLport library is used */ +#undef HAVE_STLPORT + /* Define to 1 if you have the `strftime' function. */ #undef HAVE_STRFTIME @@ -123,6 +180,12 @@ /* Define to 1 if `st_blocks' is a member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BLOCKS +/* Define to 1 if `st_flags' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_FLAGS + +/* Define to 1 if `st_gen' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_GEN + /* Define to 1 if `st_rdev' is a member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_RDEV diff --git a/configure b/configure index 743d5ee..9e95299 100755 --- a/configure +++ b/configure @@ -5090,15 +5090,15 @@ fi if test "${with_stlport_dir+set}" = set; then : withval=$with_stlport_dir; if test "x$withval" != "xno" ; then - stlport_base = $withval - stlport_include = "${stlport_base}/stlport" - stlport_lib = "${stlport_base}/lib" - stlport_paths = "-I ${stlport_include} -L ${stlport_lib}" + stlport_base=$withval + stlport_include="${stlport_base}/stlport" + stlport_lib="${stlport_base}/lib" + stlport_paths="-I ${stlport_include} -L ${stlport_lib}" - CPPFLAGS = "${CPPFLAGS} ${stlport_paths}" + CPPFLAGS="${CPPFLAGS} ${stlport_paths}" CFLAGS="${CFLAGS} ${stlport_paths}" CXXFLAGS="${CXXFLAGS} ${stlport_paths}" - LDFLAGS="${LDFLAGS} ${stlport_lib} -lstlport_gcc" + LDFLAGS="${LDFLAGS} ${stlport_lib} -lstlport_gcc -lm" # Append lib dir to LD_LIBRARY_PATH (or set LD_LIBRARY_PATH if unset) # This is mostly for the benefit of configure-time test programs. LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+:LD_LIBRARY_PATH}${stlport_lib} @@ -6160,6 +6160,24 @@ cat >>confdefs.h <<_ACEOF _ACEOF +fi +ac_fn_cxx_check_member "$LINENO" "struct stat" "st_flags" "ac_cv_member_struct_stat_st_flags" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_flags" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_FLAGS 1 +_ACEOF + + +fi +ac_fn_cxx_check_member "$LINENO" "struct stat" "st_gen" "ac_cv_member_struct_stat_st_gen" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_gen" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_GEN 1 +_ACEOF + + fi @@ -6400,6 +6418,67 @@ fi done +for ac_func in openat open read close +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 fopen fread fclose +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 opendir readdir closedir +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 statx fstatat lstat stat +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 readlinkat readlink +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_header in fcntl.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" @@ -6423,15 +6502,16 @@ fi done -# Check whether --enable-commoncrypto was given. +if [ "${host_os}" == "darwin" ]; then + # Check whether --enable-commoncrypto was given. if test "${enable_commoncrypto+set}" = set; then : enableval=$enable_commoncrypto; fi -if test "x${enable_commoncrypto}" != "xno" -then - for ac_header in CommonCrypto/CommonDigest.h + if test "x${enable_commoncrypto}" != "xno" + then + for ac_header in CommonCrypto/CommonDigest.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "CommonCrypto/CommonDigest.h" "ac_cv_header_CommonCrypto_CommonDigest_h" "$ac_includes_default" if test "x$ac_cv_header_CommonCrypto_CommonDigest_h" = xyes; then : @@ -6443,9 +6523,11 @@ fi done + fi fi -for ac_header in door.h +if [ "${host_os}" == solaris* ]; then + for ac_header in door.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "door.h" "ac_cv_header_door_h" "$ac_includes_default" if test "x$ac_cv_header_door_h" = xyes; then : @@ -6467,8 +6549,7 @@ fi done - -for ac_header in port.h + for ac_header in port.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "port.h" "ac_cv_header_port_h" "$ac_includes_default" if test "x$ac_cv_header_port_h" = xyes; then : @@ -6490,6 +6571,7 @@ fi done +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } @@ -6562,10 +6644,9 @@ fi -UNAME=`uname` -if [ $UNAME != "AROS" ]; then +if [ "${host_os}" != "aros" ]; then if test -c "/dev/random"; then @@ -6926,15 +7007,26 @@ fi 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 +for ac_header in limits +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 : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIMITS 1 +_ACEOF + +fi + +done -ac_fn_cxx_check_header_mongrel "$LINENO" "locale" "ac_cv_header_locale" "$ac_includes_default" +for ac_header in locale +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "locale" "ac_cv_header_locale" "$ac_includes_default" if test "x$ac_cv_header_locale" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LOCALE 1 +_ACEOF else @@ -6945,7 +7037,7 @@ if ${ac_cv_stlportdir+:} false; then : else found_locale="" - for inclpath in /usr/local/include /usr/local/include/stlport + for inclpath in ${stlport_include} /usr/local/include /usr/local/include/stlport do CPPFLAGS_save=${CPPFLAGS} CPPFLAGS="${CPPFLAGS} -I${inclpath}" @@ -6994,11 +7086,14 @@ $as_echo "$ac_cv_stlportdir" >&6; } fi +done + if test "x${ac_cv_stlportdir}" != "x" then - CPPFLAGS="${CPPFLAGS} -I${ac_cv_stlportdir}" + CPPFLAGS="${CPPFLAGS} -I ${ac_cv_stlportdir}" fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -7037,7 +7132,8 @@ if test "x$ac_cv_func_pthread_getspecific" = xyes; then : else LDFLAGS="${LDFLAGS_TEMP}" - as_fn_error $? "No posix threads detected, cannot continue." "$LINENO" 5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No posix threads detected; OST may not link." >&5 +$as_echo "$as_me: WARNING: No posix threads detected; OST may not link." >&2;} fi @@ -7054,7 +7150,7 @@ if ${ac_cv_stlportlib+:} false; then : else found_lib="" - for inclpath in /usr/local/lib /usr/local/lib/stlport + for inclpath in ${stlport_lib} /usr/local/lib /usr/local/lib/stlport do for stllib in stlport stlport_gcc do @@ -7113,18 +7209,19 @@ fi $as_echo "$ac_cv_stlportlib" >&6; } if test "x${ac_cv_stlportdir}" != "x" then - LDFLAGS="${LDFLAGS} -L${ac_cv_stlportlib}" + LDFLAGS="${LDFLAGS} -L ${ac_cv_stlportlib}" LIBS="${LIBS} -l${stllib}" + +$as_echo "#define HAVE_LOCALE 1" >>confdefs.h + + +$as_echo "#define HAVE_STLPORT 1" >>confdefs.h + fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -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 for ac_header in wchar.h @@ -7142,10 +7239,10 @@ done cat >>confdefs.h <<_ACEOF -#define TARGET_OS "${target}" +#define TARGET_OS "${host}" _ACEOF -case $target in +case $host in i386-*-freebsd*) ;; alpha-*-freebsd*) diff --git a/configure.ac b/configure.ac index 557b5e8..a99276e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,9 +1,10 @@ -zdnl Process this file with autoconf to produce a configure script. +dnl Process this file with autoconf to produce a configure script. dnl dnl AC_INIT([tripwire], [2.4.3.8], [https://github.com/Tripwire/tripwire-open-source/issues], [tripwire], [https://github.com/Tripwire/tripwire-open-source]) AC_CONFIG_SRCDIR([src/tw/tw.cpp]) +AC_CANONICAL_HOST([]) AC_CANONICAL_TARGET([]) AM_INIT_AUTOMAKE AM_CONFIG_HEADER(config.h) @@ -149,15 +150,15 @@ AC_ARG_WITH(stlport-dir, [ --with-stlport-dir=PATH Specify path to STLport installation ], [ if test "x$withval" != "xno" ; then - stlport_base = $withval - stlport_include = "${stlport_base}/stlport" - stlport_lib = "${stlport_base}/lib" - stlport_paths = "-I ${stlport_include} -L ${stlport_lib}" + stlport_base=$withval + stlport_include="${stlport_base}/stlport" + stlport_lib="${stlport_base}/lib" + stlport_paths="-I ${stlport_include} -L ${stlport_lib}" - CPPFLAGS = "${CPPFLAGS} ${stlport_paths}" + CPPFLAGS="${CPPFLAGS} ${stlport_paths}" CFLAGS="${CFLAGS} ${stlport_paths}" CXXFLAGS="${CXXFLAGS} ${stlport_paths}" - LDFLAGS="${LDFLAGS} ${stlport_lib} -lstlport_gcc" + LDFLAGS="${LDFLAGS} ${stlport_lib} -lstlport_gcc -lm" # Append lib dir to LD_LIBRARY_PATH (or set LD_LIBRARY_PATH if unset) # This is mostly for the benefit of configure-time test programs. LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+:LD_LIBRARY_PATH}${stlport_lib} @@ -219,7 +220,7 @@ dnl whether or not to generate debuging code? dnl this gets defined elsewhere based on config args AC_DEFINE(NDEBUG, 1, [don't generate debuging code]) dnl look for struct stat members that aren't always there -AC_CHECK_MEMBERS([struct stat.st_rdev, struct stat.st_blocks]) +AC_CHECK_MEMBERS([struct stat.st_rdev, struct stat.st_blocks, struct stat.st_flags, struct stat.st_gen]) dnl detect large file support & use it where available AC_SYS_LARGEFILE @@ -231,23 +232,37 @@ AC_CHECK_FUNCS(strftime gethostname gethostid) AC_CHECK_FUNCS(mkstemp mktemp, break) AC_CHECK_FUNCS(swab) +dnl posix way to read files +AC_CHECK_FUNCS(openat open read close) +dnl standard libc way to read files +AC_CHECK_FUNCS(fopen fread fclose) +dnl only standard way to read dir contents +AC_CHECK_FUNCS(opendir readdir closedir) +dnl posix (and extended) ways to get file attributes +AC_CHECK_FUNCS(statx fstatat lstat stat) +dnl posix way to get symlink contents +AC_CHECK_FUNCS(readlinkat readlink) + dnl check for posix_fadvise AC_CHECK_HEADERS(fcntl.h, [AC_CHECK_FUNCS(posix_fadvise)]) -dnl check for OSX builtin hash algorithms -AC_ARG_ENABLE(commoncrypto, +if [[ "${host_os}" == "darwin" ]]; then + dnl check for OSX builtin hash algorithms + AC_ARG_ENABLE(commoncrypto, [ --disable-commoncrypto Don't use CommonCrypto hash implementations (OSX only)]) -if test "x${enable_commoncrypto}" != "xno" -then - AC_CHECK_HEADERS(CommonCrypto/CommonDigest.h) + if test "x${enable_commoncrypto}" != "xno" + then + AC_CHECK_HEADERS(CommonCrypto/CommonDigest.h) + fi fi -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)]) +if [[ "${host_os}" == solaris* ]]; then + 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)]) +fi dnl check for existence of fseeko() as well as ftello() AC_FUNC_FSEEKO @@ -257,7 +272,6 @@ dnl ############################################## dnl check for various RNG/PRNG devices dnl ############################################## -UNAME=`uname` dnl ############################################## dnl AROS pops up a "Please insert disk" dialog for /dev @@ -265,7 +279,7 @@ dnl if script looks for devices (which don't exist) dnl so don't even try looking. dnl ############################################## -if [[ $UNAME != "AROS" ]]; then +if [[ "${host_os}" != "aros" ]]; then if test -c "/dev/random"; then AC_DEFINE(HAVE_DEV_RANDOM, [1], [Has /dev/random]) @@ -315,18 +329,20 @@ then ], [:]) ]) fi -dnl check for stl library -AC_LANG_SAVE -AC_LANG_CPLUSPLUS +dnl Check for STL support, either native or STLport dnl dnl Check for STL headers dnl -AC_CHECK_HEADER(locale,, [ +AC_CHECK_HEADERS(limits) + +dnl Use as a proxy for C++98-compliant-ish STL +dnl and look for STLport if file isn't found immediately +AC_CHECK_HEADERS(locale,,[ dnl Don't have native STL headers, look in other places AC_CACHE_CHECK([for STLport directory], ac_cv_stlportdir, [ found_locale="" - for inclpath in /usr/local/include /usr/local/include/stlport + for inclpath in ${stlport_include} /usr/local/include /usr/local/include/stlport do CPPFLAGS_save=${CPPFLAGS} CPPFLAGS="${CPPFLAGS} -I${inclpath}" @@ -351,10 +367,12 @@ AC_CHECK_HEADER(locale,, [ fi ]) ]) + if test "x${ac_cv_stlportdir}" != "x" then - CPPFLAGS="${CPPFLAGS} -I${ac_cv_stlportdir}" + CPPFLAGS="${CPPFLAGS} -I ${ac_cv_stlportdir}" fi + AC_TRY_LINK([#include ],,,[ dnl Don't have native STL library, look in other places dnl First check for POSIX threads if we compile STLport, because it needs it @@ -369,13 +387,13 @@ AC_CHECK_HEADER(locale,, [ unset ac_cv_func_pthread_getspecific AC_CHECK_FUNC(pthread_getspecific, [:], [ LDFLAGS="${LDFLAGS_TEMP}" - AC_MSG_ERROR([No posix threads detected, cannot continue.]) ]) + AC_MSG_WARN([No posix threads detected; OST may not link.]) ]) ]) ]) AC_CACHE_CHECK([for STLport library directory], ac_cv_stlportlib, [ found_lib="" - for inclpath in /usr/local/lib /usr/local/lib/stlport + for inclpath in ${stlport_lib} /usr/local/lib /usr/local/lib/stlport do for stllib in stlport stlport_gcc do @@ -411,11 +429,13 @@ AC_CHECK_HEADER(locale,, [ ]) if test "x${ac_cv_stlportdir}" != "x" then - LDFLAGS="${LDFLAGS} -L${ac_cv_stlportlib}" + LDFLAGS="${LDFLAGS} -L ${ac_cv_stlportlib}" LIBS="${LIBS} -l${stllib}" + AC_DEFINE(HAVE_LOCALE, 1, [Define to 1 if you have the header file.]) + AC_DEFINE(HAVE_STLPORT, 1, [Define if STLport library is used]) fi ]) -AC_LANG_RESTORE + dnl ##################### dnl STL specific headers @@ -425,8 +445,8 @@ AC_CHECK_HEADERS(wchar.h) dnl ####################################################################### dnl Local checks/hacks. The goal is to make this part as short as possible dnl ####################################################################### -AC_DEFINE_UNQUOTED(TARGET_OS, "${target}", [Target OS]) -case $target in +AC_DEFINE_UNQUOTED(TARGET_OS, "${host}", [Target OS]) +case $host in i386-*-freebsd*) ;; alpha-*-freebsd*) diff --git a/src/core/ntdbs.h b/src/core/ntdbs.h index 677a98f..2269ff4 100644 --- a/src/core/ntdbs.h +++ b/src/core/ntdbs.h @@ -89,7 +89,9 @@ typedef std::basic_string dbstring; #if WCHAR_IS_32_BITS // We already have a dbstring implicitly in wstring!!! -#include +#if HAVE_LOCALE +# include +#endif // specialize *std*::char_traits!!! diff --git a/src/core/platform.h b/src/core/platform.h index d3f0c7c..ef08730 100644 --- a/src/core/platform.h +++ b/src/core/platform.h @@ -309,7 +309,8 @@ // Used in twlocale # 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 IS_KAI || HAVE_GCC +//# define USE_CLIB_LOCALE IS_KAI || HAVE_GCC +# define USE_CLIB_LOCALE (!HAVE_LOCALE) # 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 @@ -321,6 +322,9 @@ # define SUPPORTS_POSIX_THREADS (!SUPPORTS_WIN32_THREADS) // Miscellaneous +# define SUPPORTS_C_FILE_IO (HAVE_FOPEN && HAVE_FREAD && HAVE_FCLOSE) +# define SUPPORTS_POSIX_FILE_IO (HAVE_OPEN && HAVE_READ && HAVE_CLOSE) + # define WCHAR_IS_16_BITS IS_WIN32 # define WCHAR_IS_32_BITS IS_UNIX # define WCHAR_REP_IS_UCS2 IS_WIN32 @@ -354,7 +358,7 @@ // (see http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html#tag_04_11 ) // The only platform OST works on (afaik) that actually defines a double-slash behavior is Cygwin // which uses this syntax for UNC paths. So we'll allow leading double slashes there, but -// continue removing them on all other platforms +// continue removing them on all other platforms for now. # define USE_DEV_URANDOM (HAVE_DEV_URANDOM && ENABLE_DEV_URANDOM) diff --git a/src/core/stdcore.h b/src/core/stdcore.h index e073e1b..7b94311 100644 --- a/src/core/stdcore.h +++ b/src/core/stdcore.h @@ -104,9 +104,13 @@ #include #include #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