diff --git a/config.h.in b/config.h.in index 6afbdcd..d54a083 100644 --- a/config.h.in +++ b/config.h.in @@ -3,6 +3,15 @@ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD +/* The normal alignment of `int', in bytes. */ +#undef ALIGNOF_INT + +/* The normal alignment of `long', in bytes. */ +#undef ALIGNOF_LONG + +/* The normal alignment of `long long', in bytes. */ +#undef ALIGNOF_LONG_LONG + /* Compile with debug code */ #undef DEBUG @@ -12,12 +21,12 @@ /* this is the prefix for STL exception functions */ #undef EXCEPTION_NAMESPACE +/* Define to 1 if you have the `bind' function. */ +#undef HAVE_BIND + /* Define to 1 if you have the header file. */ #undef HAVE_BITS_SIGNUM_H -/* Define to 1 if you have the `break' function. */ -#undef HAVE_BREAK - /* Define to 1 if you have the `broken_ac_check_func' function. */ #undef HAVE_BROKEN_AC_CHECK_FUNC @@ -42,6 +51,13 @@ /* Define to 1 if you have the header file. */ #undef HAVE_COMMONCRYPTO_COMMONDIGEST_H +/* Define to 1 if you have the `connect' function. */ +#undef HAVE_CONNECT + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_DIRENT_H + /* Define to 1 if you have the `door_create' function. */ #undef HAVE_DOOR_CREATE @@ -129,15 +145,27 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H +/* Define to 1 if you have the `memcpy_s' function. */ +#undef HAVE_MEMCPY_S + /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H +/* Define to 1 if you have the `mkfifo' function. */ +#undef HAVE_MKFIFO + +/* Define to 1 if you have the `mknod' function. */ +#undef HAVE_MKNOD + /* Define to 1 if you have the `mkstemp' function. */ #undef HAVE_MKSTEMP /* Define to 1 if you have the `mktemp' function. */ #undef HAVE_MKTEMP +/* Define to 1 if you have the header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H + /* Define to 1 if you have the `open' function. */ #undef HAVE_OPEN @@ -174,6 +202,9 @@ /* 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_PTHREAD_H + /* Define to 1 if you have the header file. */ #undef HAVE_PWD_H @@ -231,6 +262,9 @@ /* Define to 1 if `st_attrib' is a member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_ATTRIB +/* Define to 1 if `st_blksize' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_BLKSIZE + /* Define to 1 if `st_blocks' is a member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BLOCKS @@ -258,6 +292,10 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYSLOG_H +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_DIR_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILE_H @@ -267,6 +305,10 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MOUNT_H +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_NDIR_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H @@ -303,6 +345,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UTSNAME_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_WAIT_H + /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H @@ -312,6 +357,9 @@ /* Define to 1 if you have the `tzset' function. */ #undef HAVE_TZSET +/* Define to 1 if the system has the type `uintptr_t'. */ +#undef HAVE_UINTPTR_T + /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H @@ -333,12 +381,6 @@ /* Define to 1 if you have the `_exit' function. */ #undef HAVE__EXIT -/* Is byte aligned */ -#undef IS_BYTE_ALIGNED - -/* Is a unix type platform */ -#undef IS_UNIX - /* Compile without debug code */ #undef NDEBUG @@ -375,6 +417,9 @@ /* The size of `time_t', as computed by sizeof. */ #undef SIZEOF_TIME_T +/* The size of `wchar_t', as computed by sizeof. */ +#undef SIZEOF_WCHAR_T + /* Don't use gethostbyname() on Solaris */ #undef SOLARIS_NO_GETHOSTBYNAME @@ -425,9 +470,17 @@ /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES +/* Define to 1 if type `char' is unsigned and you are not using gcc. */ +#ifndef __CHAR_UNSIGNED__ +# undef __CHAR_UNSIGNED__ +#endif + /* Define to empty if `const' does not conform to ANSI C. */ #undef const +/* Define to `int' if doesn't define. */ +#undef gid_t + /* Define to the equivalent of the C99 'restrict' keyword, or to nothing if this is not supported. Do not define if restrict is supported directly. */ @@ -445,4 +498,11 @@ /* Define to `unsigned int' if does not define. */ #undef size_t +/* Define to `int' if doesn't define. */ +#undef uid_t + +/* Define to the type of an unsigned integer type wide enough to hold a + pointer, if such a type exists, and if the system does not define it. */ +#undef uintptr_t + #include "core/fixups.h" diff --git a/configure b/configure index 25e640a..0ff26f8 100755 --- a/configure +++ b/configure @@ -1670,6 +1670,52 @@ fi } # ac_fn_cxx_try_run +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + 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>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; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + 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_cxx_try_link + # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using @@ -2086,52 +2132,6 @@ $as_echo "$ac_res" >&6; } } # ac_fn_cxx_check_member -# ac_fn_cxx_try_link LINENO -# ------------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - 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>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; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - 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_cxx_try_link - # ac_fn_cxx_check_func LINENO FUNC VAR # ------------------------------------ # Tests whether FUNC exists, setting the cache variable VAR accordingly @@ -4869,17 +4869,13 @@ fi -if test "x${GXX}" != "x"; then +if test "x${CXX}" = "xg++"; then $as_echo "#define HAVE_GCC 1" >>confdefs.h CFLAGS=${CFLAGS:-"-O -pipe"} CXXFLAGS=${CXXFLAGS:-"-O -pipe"} -else - -$as_echo "#define HAVE_GCC 0" >>confdefs.h - fi if test "x${CXX}" = "xclang++"; then @@ -4889,10 +4885,6 @@ $as_echo "#define HAVE_CLANG 1" >>confdefs.h CFLAGS=${CFLAGS:-"-O -pipe"} CXXFLAGS=${CXXFLAGS:-"-O -pipe"} -else - -$as_echo "#define HAVE_CLANG 0" >>confdefs.h - fi if test "x${CXX}" = "xgxlc++"; then @@ -4904,10 +4896,6 @@ $as_echo "#define HAVE_IBM_GXLC 1" >>confdefs.h CFLAGS=${CFLAGS:-"-O -maix64 -Wx,-qinfo=all" } CXXFLAGS=${CXXFLAGS:-"-O -maix64 -Wx,-qinfo=all"} ARFLAGS=${ARFLAGS:-"-X 64"} -else - -$as_echo "#define HAVE_IBM_GXLC 0" >>confdefs.h - fi if test "x${CXX}" = "xxlc++_r"; then @@ -4916,13 +4904,9 @@ $as_echo "#define HAVE_IBM_XLC 1" >>confdefs.h export OBJECT_MODE=64 - CFLAGS=${CFLAGS:-"-O -q64 -qinfo=all"} - CXXFLAGS=${CXXFLAGS:-"-O -q64 -qinfo=all"} + 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"} -else - -$as_echo "#define HAVE_IBM_XLC 0" >>confdefs.h - fi @@ -4930,20 +4914,12 @@ if test "x${CXX}" = "xsunCC"; then $as_echo "#define HAVE_ORACLE_SUNCC 1" >>confdefs.h -else - -$as_echo "#define HAVE_ORACLE_SUNCC 0" >>confdefs.h - fi if test "x${CXX}" = "xaCC"; then $as_echo "#define HAVE_HP_ACC 1" >>confdefs.h -else - -$as_echo "#define HAVE_HP_ACC 0" >>confdefs.h - fi @@ -5020,14 +4996,6 @@ fi -# This is primarily to support old compilers that don’t understand -Wextra -#AC_ARG_ENABLE(extrawarnings, [ —-disable-extrawarnings do not compile with -Wextra warnings enabled]) -#if test "x$enable_extrawarnings" != "xno" -#then -# CFLAGS="${CFLAGS} -Wextra -Wno-unused-parameter" -# CXXFLAGS="${CXXFLAGS} -Wextra -Wno-unused-parameter" -#fi - # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; @@ -5491,6 +5459,165 @@ $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } +if eval \${$as_ac_Header+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include <$ac_hdr> + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$as_ac_Header=yes" +else + eval "$as_ac_Header=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_ac_Header + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break +fi +done +if ${ac_cv_search_opendir+:} false; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break +fi +done +if ${ac_cv_search_opendir+:} false; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +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 @@ -5508,67 +5635,60 @@ fi done -for ac_header in sys/param.h +for ac_header in grp.h do : - ac_fn_cxx_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_param_h" = xyes; then : + ac_fn_cxx_check_header_mongrel "$LINENO" "grp.h" "ac_cv_header_grp_h" "$ac_includes_default" +if test "x$ac_cv_header_grp_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_PARAM_H 1 +#define HAVE_GRP_H 1 _ACEOF fi done -for ac_header in sys/mount.h +for ac_header in langinfo.h do : - ac_fn_cxx_check_header_compile "$LINENO" "sys/mount.h" "ac_cv_header_sys_mount_h" "#if defined(HAVE_SYS_PARAM_H) -#include -#endif - -" -if test "x$ac_cv_header_sys_mount_h" = xyes; then : + ac_fn_cxx_check_header_mongrel "$LINENO" "langinfo.h" "ac_cv_header_langinfo_h" "$ac_includes_default" +if test "x$ac_cv_header_langinfo_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_MOUNT_H 1 +#define HAVE_LANGINFO_H 1 _ACEOF fi done -for ac_header in sys/ustat.h sys/sysmacros.h sys/syslog.h sys/socket.h +for ac_header in memory.h do : - 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 : + ac_fn_cxx_check_header_mongrel "$LINENO" "memory.h" "ac_cv_header_memory_h" "$ac_includes_default" +if test "x$ac_cv_header_memory_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_MEMORY_H 1 _ACEOF fi done -for ac_header in unistd.h sys/unistd.h pwd.h grp.h termios.h +for ac_header in pthread.h do : - 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 : + ac_fn_cxx_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_PTHREAD_H 1 _ACEOF fi done -for ac_header in syslog.h langinfo.h sys/statfs.h sys/select.h sys/time.h sys/file.h +for ac_header in pwd.h do : - 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 : + ac_fn_cxx_check_header_mongrel "$LINENO" "pwd.h" "ac_cv_header_pwd_h" "$ac_includes_default" +if test "x$ac_cv_header_pwd_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_PWD_H 1 _ACEOF fi @@ -5601,19 +5721,195 @@ fi done -for ac_header in sys/utsname.h memory.h +for ac_header in stdint.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDINT_H 1 +_ACEOF + +fi + +done + +for ac_header in syslog.h sys/syslog.h do : 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 `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + break +fi + +done + +for ac_header in termios.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default" +if test "x$ac_cv_header_termios_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_TERMIOS_H 1 _ACEOF fi done +for ac_header in unistd.h sys/unistd.h +do : + 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 `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + break +fi + +done + + +for ac_header in sys/file.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_file_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_FILE_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/param.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_PARAM_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/mount.h +do : + ac_fn_cxx_check_header_compile "$LINENO" "sys/mount.h" "ac_cv_header_sys_mount_h" "#if defined(HAVE_SYS_PARAM_H) +#include +#endif + +" +if test "x$ac_cv_header_sys_mount_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_MOUNT_H 1 +_ACEOF + +fi + +done + + +for ac_header in sys/select.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_select_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_SELECT_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/socket.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_socket_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_SOCKET_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/statfs.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/statfs.h" "ac_cv_header_sys_statfs_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_statfs_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_STATFS_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/sysmacros.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_SYSMACROS_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/time.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_time_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_TIME_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/ustat.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/ustat.h" "ac_cv_header_sys_ustat_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ustat_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_USTAT_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/utsname.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/utsname.h" "ac_cv_header_sys_utsname_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_utsname_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_UTSNAME_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/wait.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_wait_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_WAIT_H 1 +_ACEOF + +fi + +done + + for ac_header in sys/fs/vx_ioctl.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "sys/fs/vx_ioctl.h" "ac_cv_header_sys_fs_vx_ioctl_h" "$ac_includes_default" @@ -5735,6 +6031,73 @@ _ACEOF fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } +if ${ac_cv_type_uid_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "uid_t" >/dev/null 2>&1; then : + ac_cv_type_uid_t=yes +else + ac_cv_type_uid_t=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } +if test $ac_cv_type_uid_t = no; then + +$as_echo "#define uid_t int" >>confdefs.h + + +$as_echo "#define gid_t int" >>confdefs.h + +fi + + + ac_fn_cxx_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default" +if test "x$ac_cv_type_uintptr_t" = xyes; then : + +$as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h + +else + for ac_type in 'unsigned int' 'unsigned long int' \ + 'unsigned long long int'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +cat >>confdefs.h <<_ACEOF +#define uintptr_t $ac_type +_ACEOF + + ac_type= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test -z "$ac_type" && break + done +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : @@ -5994,6 +6357,40 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 +$as_echo_n "checking whether char is unsigned... " >&6; } +if ${ac_cv_c_char_unsigned+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((char) -1) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_c_char_unsigned=no +else + ac_cv_c_char_unsigned=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 +$as_echo "$ac_cv_c_char_unsigned" >&6; } +if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then + $as_echo "#define __CHAR_UNSIGNED__ 1" >>confdefs.h + +fi + + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. @@ -6126,6 +6523,145 @@ cat >>confdefs.h <<_ACEOF _ACEOF +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of wchar_t" >&5 +$as_echo_n "checking size of wchar_t... " >&6; } +if ${ac_cv_sizeof_wchar_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (wchar_t))" "ac_cv_sizeof_wchar_t" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_wchar_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (wchar_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_wchar_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_wchar_t" >&5 +$as_echo "$ac_cv_sizeof_wchar_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_WCHAR_T $ac_cv_sizeof_wchar_t +_ACEOF + + + +# The cast to long int works around a bug in the HP C Compiler, +# see AC_CHECK_SIZEOF for more information. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of int" >&5 +$as_echo_n "checking alignment of int... " >&6; } +if ${ac_cv_alignof_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_cxx_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_int" "$ac_includes_default +#ifndef offsetof +# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) +#endif +typedef struct { char x; int y; } ac__type_alignof_;"; then : + +else + if test "$ac_cv_type_int" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute alignment of int +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_alignof_int=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_int" >&5 +$as_echo "$ac_cv_alignof_int" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define ALIGNOF_INT $ac_cv_alignof_int +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler, +# see AC_CHECK_SIZEOF for more information. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of long" >&5 +$as_echo_n "checking alignment of long... " >&6; } +if ${ac_cv_alignof_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_cxx_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_long" "$ac_includes_default +#ifndef offsetof +# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) +#endif +typedef struct { char x; long y; } ac__type_alignof_;"; then : + +else + if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute alignment of long +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_alignof_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_long" >&5 +$as_echo "$ac_cv_alignof_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define ALIGNOF_LONG $ac_cv_alignof_long +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler, +# see AC_CHECK_SIZEOF for more information. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of long long" >&5 +$as_echo_n "checking alignment of long long... " >&6; } +if ${ac_cv_alignof_long_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_cxx_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_long_long" "$ac_includes_default +#ifndef offsetof +# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) +#endif +typedef struct { char x; long long y; } ac__type_alignof_;"; then : + +else + if test "$ac_cv_type_long_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute alignment of long long +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_alignof_long_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_long_long" >&5 +$as_echo "$ac_cv_alignof_long_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define ALIGNOF_LONG_LONG $ac_cv_alignof_long_long +_ACEOF + + $as_echo "#define USES_1S_COMPLEMENT 0" >>confdefs.h @@ -6138,17 +6674,10 @@ $as_echo "#define USES_SIGNED_MAGNITUDE 0" >>confdefs.h -$as_echo "#define IS_BYTE_ALIGNED 1" >>confdefs.h - - $as_echo "#define EXCEPTION_NAMESPACE std::" >>confdefs.h -$as_echo "#define IS_UNIX 1" >>confdefs.h - - - ac_fn_cxx_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default" if test "x$ac_cv_member_struct_stat_st_rdev" = xyes; then : @@ -6157,6 +6686,15 @@ cat >>confdefs.h <<_ACEOF _ACEOF +fi +ac_fn_cxx_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 +_ACEOF + + fi ac_fn_cxx_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default" if test "x$ac_cv_member_struct_stat_st_blocks" = xyes; then : @@ -6406,6 +6944,38 @@ rm -rf conftest* fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking POSIX termios" >&5 +$as_echo_n "checking POSIX termios... " >&6; } +if ${ac_cv_sys_posix_termios+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +/* SunOS 4.0.3 has termios.h but not the library calls. */ + tcgetattr(0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_sys_posix_termios=yes +else + ac_cv_sys_posix_termios=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_posix_termios" >&5 +$as_echo "$ac_cv_sys_posix_termios" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 $as_echo_n "checking for C/C++ restrict keyword... " >&6; } if ${ac_cv_c_restrict+:} false; then : @@ -6476,7 +7046,7 @@ _ACEOF fi done -for ac_func in getaddrinfo gethostname gethostbyname gethostid getuid +for ac_func in getaddrinfo gethostname gethostbyname gethostid 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" @@ -6488,7 +7058,18 @@ _ACEOF fi done -for ac_func in mkstemp mktemp tmpnam break +for ac_func in getuid +do : + ac_fn_cxx_check_func "$LINENO" "getuid" "ac_cv_func_getuid" +if test "x$ac_cv_func_getuid" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETUID 1 +_ACEOF + +fi +done + +for ac_func in mkstemp mktemp tmpnam 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" @@ -6496,11 +7077,11 @@ 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 - + break fi done -for ac_func in swab tzset _exit popen +for ac_func in swab tzset _exit popen memcpy_s 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" @@ -6574,7 +7155,7 @@ fi done -for ac_func in chown chmod link symlink +for ac_func in chown chmod link symlink mknod mkfifo 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" @@ -6598,7 +7179,19 @@ _ACEOF fi done -for ac_func in fork execve posix_spawn socket +for ac_func in fork 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" +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 socket connect bind 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" diff --git a/configure.ac b/configure.ac index 2ec4e50..d87c239 100644 --- a/configure.ac +++ b/configure.ac @@ -46,13 +46,12 @@ dnl ######################################### dnl Set up per-compiler constants & base args dnl ######################################### -if test "x${GXX}" != "x"; then +dnl if test "x${GXX}" != "x"; then +if test "x${CXX}" = "xg++"; then AC_DEFINE(HAVE_GCC, 1, [Uses the GNU gcc compiler]) CFLAGS=${CFLAGS:-"-O -pipe"} CXXFLAGS=${CXXFLAGS:-"-O -pipe"} -else - AC_DEFINE(HAVE_GCC, 0, [Uses the GNU gcc compiler]) fi if test "x${CXX}" = "xclang++"; then @@ -60,8 +59,6 @@ if test "x${CXX}" = "xclang++"; then CFLAGS=${CFLAGS:-"-O -pipe"} CXXFLAGS=${CXXFLAGS:-"-O -pipe"} -else - AC_DEFINE(HAVE_CLANG, 0, [Uses the Clang compiler]) fi if test "x${CXX}" = "xgxlc++"; then @@ -72,8 +69,6 @@ dnl OBJECT_MODE needs to be set while compiling CFLAGS=${CFLAGS:-"-O -maix64 -Wx,-qinfo=all" } CXXFLAGS=${CXXFLAGS:-"-O -maix64 -Wx,-qinfo=all"} ARFLAGS=${ARFLAGS:-"-X 64"} -else - AC_DEFINE(HAVE_IBM_GXLC, 0, [Uses the gxlc++ compiler]) fi if test "x${CXX}" = "xxlc++_r"; then @@ -81,25 +76,19 @@ if test "x${CXX}" = "xxlc++_r"; then dnl OBJECT_MODE needs to be set while compiling export OBJECT_MODE=64 - CFLAGS=${CFLAGS:-"-O -q64 -qinfo=all"} - CXXFLAGS=${CXXFLAGS:-"-O -q64 -qinfo=all"} + 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"} -else - AC_DEFINE(HAVE_IBM_XLC, 0, [Uses the IBM XL C++ compiler]) fi dnl *** TODO these compilers need work on default args **** if test "x${CXX}" = "xsunCC"; then AC_DEFINE(HAVE_ORACLE_SUNCC, 1, [Uses the sunCC compiler]) -else - AC_DEFINE(HAVE_ORACLE_SUNCC, 0, [Uses the sunCC compiler]) fi if test "x${CXX}" = "xaCC"; then AC_DEFINE(HAVE_HP_ACC, 1, [Uses the aCC compiler]) -else - AC_DEFINE(HAVE_HP_ACC, 0, [Uses the aCC compiler]) fi dnl ###################### @@ -113,14 +102,9 @@ dnl AX_CHECK_COMPILE_FLAG([-Weverything], [CXXFLAGS="$CXXFLAGS -Weverything"]) dnl ##################### dnl Configuration options dnl ##################### - -# This is primarily to support old compilers that don’t understand -Wextra -#AC_ARG_ENABLE(extrawarnings, [ —-disable-extrawarnings do not compile with -Wextra warnings enabled]) -#if test "x$enable_extrawarnings" != "xno" -#then -# CFLAGS="${CFLAGS} -Wextra -Wno-unused-parameter" -# CXXFLAGS="${CXXFLAGS} -Wextra -Wno-unused-parameter" -#fi +dnl +dnl These options generally expect a compiler+linker +dnl that understand gcc-like command line options. AC_ARG_ENABLE(static, [ --enable-static compile static binaries]) if test "x$enable_static" = xyes @@ -184,21 +168,40 @@ dnl ####################### dnl Checks for header files dnl ####################### AC_HEADER_STDC +AC_HEADER_DIRENT + +AC_CHECK_HEADERS(grp.h) +AC_CHECK_HEADERS(langinfo.h) +AC_CHECK_HEADERS(memory.h) +AC_CHECK_HEADERS(pthread.h) +AC_CHECK_HEADERS(pwd.h) +AC_CHECK_HEADERS(signum.h bits/signum.h, break) +AC_CHECK_HEADERS(stdarg.h varargs.h, break) +AC_CHECK_HEADERS(stdint.h) +AC_CHECK_HEADERS(syslog.h sys/syslog.h, break) +AC_CHECK_HEADERS(termios.h) +AC_CHECK_HEADERS(unistd.h sys/unistd.h, break) + +AC_CHECK_HEADERS(sys/file.h) AC_CHECK_HEADERS(sys/param.h) AC_CHECK_HEADERS(sys/mount.h,,, [[#if defined(HAVE_SYS_PARAM_H) #include #endif ]]) -AC_CHECK_HEADERS(sys/ustat.h sys/sysmacros.h sys/syslog.h sys/socket.h) -AC_CHECK_HEADERS(unistd.h sys/unistd.h pwd.h grp.h termios.h) -AC_CHECK_HEADERS(syslog.h langinfo.h sys/statfs.h sys/select.h sys/time.h sys/file.h) -AC_CHECK_HEADERS(signum.h bits/signum.h, break ) -AC_CHECK_HEADERS(stdarg.h varargs.h, break ) -AC_CHECK_HEADERS(sys/utsname.h memory.h) + +AC_CHECK_HEADERS(sys/select.h) +AC_CHECK_HEADERS(sys/socket.h) +AC_CHECK_HEADERS(sys/statfs.h) +AC_CHECK_HEADERS(sys/sysmacros.h) +AC_CHECK_HEADERS(sys/time.h) +AC_CHECK_HEADERS(sys/ustat.h) +AC_CHECK_HEADERS(sys/utsname.h) +AC_CHECK_HEADERS(sys/wait.h) + AC_CHECK_HEADERS(sys/fs/vx_ioctl.h) -dnl # Special case for malloc.h, because it's depreciated on most systems. +dnl # Special case for malloc.h, because it's deprecated on most systems. CPPFLAGS_SAVE="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} -Werror" AC_CHECK_HEADERS(malloc.h) @@ -209,38 +212,46 @@ dnl Checks for typedefs, structures, and compiler characteristics dnl ############################################################# AC_C_CONST AC_TYPE_SIZE_T +AC_TYPE_UID_T +AC_TYPE_UINTPTR_T AC_HEADER_TIME AC_C_BIGENDIAN +AC_C_CHAR_UNSIGNED + AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long long) AC_CHECK_SIZEOF(time_t) +AC_CHECK_SIZEOF(wchar_t) -dnl All platforms we support use 2's complement, are byte aligned, etc... +AC_CHECK_ALIGNOF(int) +AC_CHECK_ALIGNOF(long) +AC_CHECK_ALIGNOF(long long) + +dnl TODO: These could be replaced with actual detection logic, for the few +dnl remaining platforms that have non-2s complement signed ints AC_DEFINE(USES_1S_COMPLEMENT, 0, [Uses one's complement]) AC_DEFINE(USES_2S_COMPLEMENT, 1, [Uses two's complement]) AC_DEFINE(USES_SIGNED_MAGNITUDE, 0, [Uses signed magnitute]) -AC_DEFINE(IS_BYTE_ALIGNED, 1, [Is byte aligned]) AC_DEFINE(EXCEPTION_NAMESPACE, std::, [this is the prefix for STL exception functions]) -dnl We used to check for UNIX or Unix-like target platforms, -dnl but that is a little extreme, so just assume that the -dnl target is unix. This can still be changed in config.h -AC_DEFINE(IS_UNIX, 1, [Is a unix type platform]) - 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: -dnl st_rdev & st_blocks are standard but a few platforms don't have them. +dnl st_rdev, st_blksize, & st_blocks are standard but a few platforms don't have them. dnl st_flags & st_gen are BSD-isms & are mostly seen there, including macOS dnl st_flag (singular) is AIX-only, while st_attrib holds DOS attribute bits on VxWorks -AC_CHECK_MEMBERS([struct stat.st_rdev, struct stat.st_blocks, struct stat.st_flags, struct stat.st_gen, struct stat.st_flag, struct stat.st_attrib]) +AC_CHECK_MEMBERS([struct stat.st_rdev, struct stat.st_blksize, struct stat.st_blocks, struct stat.st_flags, struct stat.st_gen, struct stat.st_flag, struct stat.st_attrib]) dnl detect large file support & use it where available AC_SYS_LARGEFILE +dnl detect whether Posix termios is available. +dnl we use termios to turn echo off when user is entering a passphrase +AC_SYS_POSIX_TERMIOS + dnl detect whether C++ compiler supports any variant of 'restrict' keyword dnl (the macro says 'C' but works for both C & C++) AC_C_RESTRICT @@ -254,9 +265,11 @@ dnl ############################# dnl Checks for standard functions dnl ############################# AC_CHECK_FUNCS(strftime) -AC_CHECK_FUNCS(getaddrinfo gethostname gethostbyname gethostid getuid) -AC_CHECK_FUNCS(mkstemp mktemp tmpnam break) -AC_CHECK_FUNCS(swab tzset _exit popen) +AC_CHECK_FUNCS(getaddrinfo gethostname gethostbyname gethostid) +AC_CHECK_FUNCS(getuid) +dnl various ways of creating/naming temp files +AC_CHECK_FUNCS(mkstemp mktemp tmpnam, break) +AC_CHECK_FUNCS(swab tzset _exit popen memcpy_s) dnl posix way to read files AC_CHECK_FUNCS(openat open read close) @@ -270,11 +283,13 @@ dnl posix way to get symlink contents AC_CHECK_FUNCS(readlinkat readlink) dnl posix fns that make filesystem changes -AC_CHECK_FUNCS(chown chmod link symlink) +AC_CHECK_FUNCS(chown chmod link symlink mknod mkfifo) dnl posix syslog fns AC_CHECK_FUNCS(openlog syslog closelog) -dnl posix process & networking stuff -AC_CHECK_FUNCS(fork execve posix_spawn socket) +dnl posix process fns +AC_CHECK_FUNCS(fork execve posix_spawn) +dnl bsd socket fns +AC_CHECK_FUNCS(socket connect bind) dnl posix user & group stuff AC_CHECK_FUNCS(setuid setgid getgrgid) diff --git a/src/core/file.h b/src/core/file.h index 825e52a..7fd1cce 100644 --- a/src/core/file.h +++ b/src/core/file.h @@ -173,7 +173,7 @@ public: static bool IsAbsolutePath(const TSTRING& in); }; -# if IS_DOS_DJGPP +# if USES_DOS_DEVICE_PATH # define cDevicePath cDosPath # elif IS_AROS # define cDevicePath cArosPath diff --git a/src/core/file_unix.cpp b/src/core/file_unix.cpp index cca8466..60ba87e 100644 --- a/src/core/file_unix.cpp +++ b/src/core/file_unix.cpp @@ -39,11 +39,6 @@ #endif #include "core/stdcore.h" - -#if !IS_UNIX -# error Need to be unix to use unixfsservices -#endif - #include "core/file.h" //#include diff --git a/src/core/msystem.cpp b/src/core/msystem.cpp index 800b76e..d978f8c 100644 --- a/src/core/msystem.cpp +++ b/src/core/msystem.cpp @@ -72,25 +72,36 @@ #include "config.h" #include #include + #if !IS_SORTIX && HAVE_SYS_FILE_H -# include +# include #endif + #include -#include -#include -#if HAVE_MALLOC_H && !IS_AROS -#include + +#if HAVE_SYS_WAIT_H +# include #endif + +#include + +#if HAVE_MALLOC_H && !IS_AROS +# include +#endif + #include //#include #include "tw_signal.h" + #ifdef __STDC__ -# include -# include +# include +# include #endif + #ifdef HAVE_SYS_PARAM_H -# include +# include #endif + #include #include "msystem.h" diff --git a/src/core/platform.h b/src/core/platform.h index 5d9bc3c..e49cefe 100644 --- a/src/core/platform.h +++ b/src/core/platform.h @@ -33,12 +33,16 @@ // platform.h // +#ifndef __PLATFORM_H +#define __PLATFORM_H + #ifdef HAVE_CONFIG_H #include #endif -#ifndef __PLATFORM_H -# define __PLATFORM_H +#if HAVE_STDINT_H +#include +#endif //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. @@ -51,9 +55,12 @@ # define OS_UNKNOWN 0 -# define OS_WIN32 0x0101 -# define OS_CYGWIN 0x0102 -# define OS_DOS_DJGPP 0x0103 +# 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 @@ -75,6 +82,7 @@ # define OS_IRIX 0x0403 # define OS_OSF1 0x0404 # define OS_OS400 0x0405 +# define OS_MVS 0x0406 # define OS_MINIX 0x0501 # define OS_HURD 0x0502 @@ -88,10 +96,13 @@ # define OS_RISCOS 0x050A # define OS_REDOX 0x050B # define OS_QNX 0x050C -# define OS_VXWORKS 0x50D -# define OS_LYNXOS 0x50E -# define OS_OS9 0x50F // For Microware's OS-9, not the Apple one. -# define OS_PLAN9 0x510 +# 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 @@ -102,6 +113,7 @@ // 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 @@ -110,10 +122,11 @@ # define COMP_KAI_IRIX 0x0206 # define COMP_KAI_OSF1ALPHA 0x0207 -# define COMP_SUNPRO 0x0301 +# define COMP_SUNPRO 0x0301 # define COMP_XL_C 0x0302 # define COMP_ACC 0x0303 + //============================================================================= // Platform detection // @@ -124,13 +137,54 @@ // // OS The OS // COMP The compiler -// -// PLEASE NOTE: Do not set any preprocessor variable other than the above three in this -// section. Use the following sections for anything that does not fall into -// the above catagories. +// plus IS_xxx macros for the OS & compiler + + +////////////////////////////// +// Compiler detection + +# if defined(HAVE_GCC) +# define COMP COMP_GCC +# define IS_GCC 1 + +# elif defined(HAVE_CLANG) +# define COMP COMP_CLANG +# define IS_CLANG 1 + +# elif defined(HAVE_MSVC) +# define COMP COMP_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 || 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 +# endif + + +////////////////////////// +// OS detection # if defined(_WIN32) -# define OS OS_WIN32 +# if defined(__MINGW32__) +# define OS OS_WIN32_MINGW +# define IS_MINGW 1 +# else +# define OS OS_WIN32 +# endif # define IS_WIN32 1 # elif defined(__CYGWIN__) @@ -141,6 +195,15 @@ # define OS OS_DOS_DJGPP # define IS_DOS_DJGPP 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 + // Detect Android first, since Linux macros are also defined there # elif defined(__ANDROID__) # define OS OS_ANDROID @@ -193,6 +256,8 @@ # 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 @@ -220,6 +285,12 @@ # 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 @@ -287,22 +358,6 @@ # endif - /* XXX: COMP may now not resolve, because autoconf may - * detect GCC. This is done in the hopes that all - * COMP detections, and indeed both OS & COMP detechtions - * will eventualy be done automatically. - * - * This means, the former "#if !defined(COMP)" will - * temporarily have to also check the HAVE_[compiler] - * #defines until all compilers are checked by autoconf, - * at which point this can be removed completely. - * - * PH - 20010311 - */ -# if !defined(COMP) && !defined(HAVE_GCC) -# error COMP definition did not resolve. Check "platform.h". -# endif - //============================================================================= // Platform Macros (a.k.a. "IS_" macros) // @@ -335,47 +390,42 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// complier detection -# define IS_KAI \ - (COMP == COMP_KAI_GCC || COMP == COMP_KAI_SUNPRO || COMP == COMP_KAI_GLIBC || COMP == COMP_KAI_VISUALAGE || \ - COMP == COMP_KAI_HPANSIC || COMP == COMP_KAI_IRIX || COMP == COMP_KAI_OSF1ALPHA) -# define IS_MSVC (COMP == COMP_MSVC) -# define IS_SUNPRO (COMP == COMP_SUNPRO) - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// Unicode -# define SUPPORTS_UNICODE IS_WIN32 // The OS supports Unicode - // 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)) // 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 (!HAVE_LOCALE || HAVE_GCC || IS_KAI) + # 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 USE_CLIB_LOCALE (IS_ALPHA || IS_IRIX || (IS_KAI && !IS_KAI_3_4)) + // Threading API # define SUPPORTS_WIN32_THREADS IS_WIN32 -# define SUPPORTS_POSIX_THREADS (HAVE_PTHREAD_GETSPECIFIC) +# 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 WCHAR_IS_16_BITS IS_WIN32 -# define WCHAR_IS_32_BITS IS_UNIX -# define WCHAR_REP_IS_UCS2 IS_WIN32 +# 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 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 after getting new ver of KAI # define USES_GLIBC ((COMP == COMP_KAI_GLIBC) || HAVE_GCC) # define SUPPORTS_MEMBER_TEMPLATES (!IS_SUNPRO) @@ -386,8 +436,11 @@ # define SUPPORTS_SYSLOG (HAVE_SYSLOG && !IS_SKYOS && !IS_RISCOS) # define NEEDS_SWAB_IMPL (IS_CYGWIN || IS_SYLLABLE || IS_ANDROID || IS_SORTIX) # define USES_MBLEN (!IS_ANDROID && !IS_AROS) -# define USES_DEVICE_PATH (IS_AROS || IS_DOS_DJGPP || IS_WIN32 || IS_RISCOS || IS_REDOX) +# 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) + +// Linux is the only platform where direct i/o hashing has been tested & works properly so far. # define SUPPORTS_DIRECT_IO (IS_LINUX) // HP-UX does have posix_fadvise(), but sys/fcntl.h neglects to wrap it in extern "C" on @@ -397,24 +450,27 @@ # define SUPPORTS_POSIX_FADVISE (HAVE_POSIX_FADVISE && !IS_HPUX) # define READ_TAKES_CHAR_PTR (IS_VXWORKS) -# define BCOPY_TAKES_CHAR_PTR (IS_VXWORKS) -// Linux is the only platform where direct i/o hashing has been tested & works properly so far. - -# define SUPPORTS_TERMIOS (HAVE_TERMIOS_H && (!IS_RTEMS && !IS_REDOX)) // 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)) + +// 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) -# define SUPPORTS_DOUBLE_SLASH_PATH (IS_CYGWIN) + // 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 ) // The only platform OST is known to work 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 for now. -// Other platform known to use this include IBM z/OS and the ancient Apollo Domain/OS. +// which uses this syntax for UNC paths. OST also might Just Work under Unix System Services on +// z/OS / MVS / OS/390, which uses a leading double slash for dataset paths, so I'll add that +// 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) @@ -422,6 +478,7 @@ // which are only sometimes readable via ordinary file API # define SUPPORTS_NATIVE_OBJECTS (IS_AIX || IS_OS400) + // 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 @@ -429,24 +486,26 @@ #if IS_SOLARIS # define UNAME_SUCCESS_POSIX 1 #else -# define UNAME_SUCCESS_ZERO +# define UNAME_SUCCESS_ZERO 1 #endif +// Work around single-arg mkdir on MinGW. +// consider using autoconf AX_FUNC_MKDIR if +// we need to handle any more cases here +#if IS_MINGW +# define mkdir(a,b) mkdir(a) +#endif //============================================================================= // Miscellaneous // // Put all items that are not an "IS_" macro here. -# if IS_BYTE_ALIGNED -# define BYTE_ALIGN 8 -# else -# error Unknown Byte alignment -# endif +// This should ordinarily always be 8, but we'll do it the autoconf way just in case. +#define BYTE_ALIGN ALIGNOF_LONG_LONG // A scalar that matches the sizeof a pointer -typedef unsigned long ptr_size_type; // true for all of our current platforms - // TODO: I would like to use a XXXX_t like name +typedef uintptr_t ptr_size_type; // Check integer representation # if !(USES_2S_COMPLEMENT) diff --git a/src/core/unixfsservices.cpp b/src/core/unixfsservices.cpp index d7adf45..3fb967f 100644 --- a/src/core/unixfsservices.cpp +++ b/src/core/unixfsservices.cpp @@ -39,10 +39,6 @@ #include "core/corestrings.h" #include "core/file.h" -#if !IS_UNIX //encase this all in an ifdef so it won't cause compile errors -# error Must be unix for unixfsservices -#endif - //========================================================================= // STANDARD LIBRARY INCLUDES //========================================================================= @@ -51,8 +47,14 @@ //#include //#include -#include -#include +#if HAVE_UNISTD_H +# include +#endif + +#if HAVE_DIRENT_H +# include +#endif + //#include //#if HAVE_SYS_TIME_H @@ -80,25 +82,21 @@ //#endif #if HAVE_SYS_UTSNAME_H -#include +# include #endif #if HAVE_PWD_H -#include -#endif - -#if IS_REDOX -# define restrict __restrict__ +# include #endif #if HAVE_SYS_SOCKET_H -#include -#include -#include +# include +# include +# include #endif #if HAVE_GRP_H -#include +# include #endif #//include @@ -394,8 +392,13 @@ void cUnixFSServices::Stat(const TSTRING& strNameC, cFSStatArgs& statArgs) const statArgs.nlink = statbuf.st_nlink; statArgs.size = statbuf.st_size; statArgs.uid = statbuf.st_uid; - statArgs.blksize = statbuf.st_blksize; +#if HAVE_STRUCT_STAT_ST_BLKSIZE + statArgs.blksize = statbuf.st_blksize; +#else + statArgs.blksize = 0; +#endif + #if HAVE_STRUCT_STAT_ST_BLOCKS statArgs.blocks = statbuf.st_blocks; #else @@ -405,56 +408,58 @@ void cUnixFSServices::Stat(const TSTRING& strNameC, cFSStatArgs& statArgs) const // set the file type if (S_ISREG(statbuf.st_mode)) statArgs.mFileType = cFSStatArgs::TY_FILE; +#ifdef S_ISDIR else if (S_ISDIR(statbuf.st_mode)) statArgs.mFileType = cFSStatArgs::TY_DIR; +#endif +#ifdef S_ISLNK else if (S_ISLNK(statbuf.st_mode)) statArgs.mFileType = cFSStatArgs::TY_SYMLINK; +#endif +#ifdef S_ISBLK else if (S_ISBLK(statbuf.st_mode)) statArgs.mFileType = cFSStatArgs::TY_BLOCKDEV; +#endif +#ifdef S_ISCHR else if (S_ISCHR(statbuf.st_mode)) statArgs.mFileType = cFSStatArgs::TY_CHARDEV; +#endif +#ifdef S_ISFIFO else if (S_ISFIFO(statbuf.st_mode)) statArgs.mFileType = cFSStatArgs::TY_FIFO; +#endif #ifdef S_ISSOCK else if (S_ISSOCK(statbuf.st_mode)) statArgs.mFileType = cFSStatArgs::TY_SOCK; #endif - -#if HAVE_DOOR_CREATE +#ifdef S_ISDOOR else if (S_ISDOOR(statbuf.st_mode)) statArgs.mFileType = cFSStatArgs::TY_DOOR; #endif - -#if HAVE_PORT_CREATE +#ifdef S_ISPORT else if (S_ISPORT(statbuf.st_mode)) statArgs.mFileType = cFSStatArgs::TY_PORT; #endif - #ifdef S_ISNAM else if (S_ISNAM(statbuf.st_mode)) statArgs.mFileType = cFSStatArgs::TY_NAMED; #endif - #ifdef S_ISNATIVE else if (S_ISNATIVE(statbuf.st_mode)) statArgs.mFileType = cFSStatArgs::TY_NATIVE; #endif - #ifdef S_TYPEISMQ else if (S_TYPEISMQ(&statbuf)) statArgs.mFileType = cFSStatArgs::TY_MESSAGE_QUEUE; #endif - #ifdef S_TYPEISSEM else if (S_TYPEISSEM(&statbuf)) statArgs.mFileType = cFSStatArgs::TY_SEMAPHORE; #endif - #ifdef S_TYPEISSHM else if (S_TYPEISSHM(&statbuf)) statArgs.mFileType = cFSStatArgs::TY_SHARED_MEMORY; #endif - else statArgs.mFileType = cFSStatArgs::TY_INVALID; } diff --git a/src/core/unixfsservices.h b/src/core/unixfsservices.h index c7f4142..06644c3 100644 --- a/src/core/unixfsservices.h +++ b/src/core/unixfsservices.h @@ -38,10 +38,6 @@ #ifndef __UNIXFSSERVICES_H #define __UNIXFSSERVICES_H -#if !IS_UNIX -#error unixfsservices.h should only be included for instantiating cUnixFSServices objects. If you just want to use iFSServices methods, include fsservices.h. -#endif - //========================================================================= // INCLUDES //========================================================================= diff --git a/src/cryptlib/config.h b/src/cryptlib/config.h index 9fe0838..69a5825 100644 --- a/src/cryptlib/config.h +++ b/src/cryptlib/config.h @@ -177,7 +177,7 @@ typedef unsigned long dword; #endif // You may need to tweak this to fit your architecture -typedef unsigned long ptr_size_type; +typedef uintptr_t ptr_size_type; const unsigned int WORD_SIZE = sizeof(word); const unsigned int WORD_BITS = WORD_SIZE * 8; diff --git a/src/fco/signature.cpp b/src/fco/signature.cpp index bb960d9..ade3950 100644 --- a/src/fco/signature.cpp +++ b/src/fco/signature.cpp @@ -521,10 +521,10 @@ void cMD5Signature::Finit() #else MD5Final(&mMD5Info); -#if BCOPY_TAKES_CHAR_PTR - bcopy((char*)mMD5Info.digest, (char*)md5_digest, MD5_DIGEST_LENGTH); +#if HAVE_MEMCPY_S + memcpy_s(mMD5Info.digest, sizeof(mMD5Info.digest), md5_digest, MD5_DIGEST_LENGTH); #else - bcopy(mMD5Info.digest, md5_digest, MD5_DIGEST_LENGTH); + memcpy(mMD5Info.digest, md5_digest, MD5_DIGEST_LENGTH); #endif #endif diff --git a/src/fs/fspropcalc.cpp b/src/fs/fspropcalc.cpp index 95e5393..9e87e5d 100644 --- a/src/fs/fspropcalc.cpp +++ b/src/fs/fspropcalc.cpp @@ -78,9 +78,7 @@ static bool NeedsStat(const cFCOPropVector& v) bool cFSPropCalc::GetSymLinkStr(const TSTRING& strName, cArchive& arch, size_t size) { -#if !HAVE_READLINK - return false; -#else +#if SUPPORTS_SYMLINKS std::vector data(size + 1); char* buf = &data[0]; @@ -121,7 +119,9 @@ bool cFSPropCalc::GetSymLinkStr(const TSTRING& strName, cArchive& arch, size_t s arch.WriteBlob(buf, rtn); return true; -#endif +#else + return false; +#endif } void cFSPropCalc::AddPropCalcError(const eError& e) diff --git a/src/twtest/platform_t.cpp b/src/twtest/platform_t.cpp index da1972d..a2d530b 100644 --- a/src/twtest/platform_t.cpp +++ b/src/twtest/platform_t.cpp @@ -239,7 +239,7 @@ const TSTRING expected_os("Linux"); #elif IS_DARWIN const TSTRING expected_os("Darwin"); #elif IS_CYGWIN -const TSTRING expected_os("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 @@ -262,6 +262,8 @@ const TSTRING expected_os("LibertyBSD"); 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