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

This commit is contained in:
Brian Cox 2019-10-10 14:11:21 -07:00
parent a4e53b9e64
commit 4e0c1249e4
45 changed files with 1475 additions and 2072 deletions

View File

@ -218,6 +218,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CORE_CRYPT_O = @CORE_CRYPT_O@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@

View File

@ -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 <bsdsocket/socketbasetags.h> 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 <dirent.h> 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 <limits> header file. */
#undef HAVE_LIMITS
/* Define to 1 if you have the <limits.h> 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 <malloc.h> 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 <openssl/sha.h> 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 <proto/bsdsocket.h> header file. */
#undef HAVE_PROTO_BSDSOCKET_H
/* Define to 1 if you have the <proto/exec.h> header file. */
#undef HAVE_PROTO_EXEC_H
/* Define to 1 if you have the <pthread.h> header file. */
#undef HAVE_PTHREAD_H
@ -369,9 +396,15 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the <unixlib/local.h> header file. */
#undef HAVE_UNIXLIB_LOCAL_H
/* Define to 1 if you have the <varargs.h> 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 <wchar.h> 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__

1315
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -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 <locale> as a proxy for C++98-compliant-ish STL
dnl and look for STLport if file isn't found immediately

View File

@ -195,6 +195,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CORE_CRYPT_O = @CORE_CRYPT_O@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@

View File

@ -167,6 +167,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CORE_CRYPT_O = @CORE_CRYPT_O@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@

View File

@ -167,6 +167,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CORE_CRYPT_O = @CORE_CRYPT_O@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@

View File

@ -167,6 +167,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CORE_CRYPT_O = @CORE_CRYPT_O@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@

View File

@ -193,6 +193,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CORE_CRYPT_O = @CORE_CRYPT_O@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@

View File

@ -224,6 +224,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CORE_CRYPT_O = @CORE_CRYPT_O@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@

View File

@ -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);

View File

@ -47,7 +47,7 @@
#include "fileerror.h"
#endif
#if IS_MINT // for off_t
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif

View File

@ -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 <unixlib/local.h>
#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;

View File

@ -105,11 +105,6 @@
#include <assert.h>
#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 */

View File

@ -200,11 +200,9 @@ template<> struct std::char_traits<dbchar_t>
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<dbchar_t>
{
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<dbchar_t>
{
return 0;
}
# endif //IS_STDLIB_MODENA
#endif //IS_STDLIB_MODENA
static int_type eof()
{

View File

@ -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

View File

@ -45,50 +45,6 @@
#include "platform.h"
//--Disable some level 4 warnings
#if IS_MSVC
# define NOMINMAX //--Disable min/max macros
#include <xstddef> // 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 <cstdio>
@ -104,20 +60,17 @@
#include <algorithm>
#include <set>
#include <stack>
#if HAVE_LOCALE
# include <locale>
#endif
#if HAVE_LIMITS
# include <limits>
#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

View File

@ -137,7 +137,7 @@ private:
enum Limits
{
LIMIT_MIN = -1,
LIMIT_MAX = 1000000
LIMIT_MAX = INT_MAX
};
virtual int GetMax()

View File

@ -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<double>::max() >= TSS_UINT64_MAX);
return (cFormatNumberUtil<double, TCHAR>::Format((double)ui, strBuf));
#endif
}
}

View File

@ -37,13 +37,18 @@
#include "platform.h"
#if HAVE_STDINT_H
#include <stdint.h>
# include <stdint.h>
#endif
#if HAVE_LIMITS_H
# include <limits.h>
#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 <limits.h> // 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 <limits>
#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
//-----------------------------------------------------------------------------

View File

@ -214,6 +214,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CORE_CRYPT_O = @CORE_CRYPT_O@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@

View File

@ -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

View File

@ -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>
{{{
}}}
###############################################################################

View File

@ -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

View File

@ -211,6 +211,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CORE_CRYPT_O = @CORE_CRYPT_O@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@

View File

@ -219,6 +219,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CORE_CRYPT_O = @CORE_CRYPT_O@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@

View File

@ -214,6 +214,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CORE_CRYPT_O = @CORE_CRYPT_O@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@

View File

@ -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)

View File

@ -206,6 +206,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CORE_CRYPT_O = @CORE_CRYPT_O@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@

View File

@ -210,6 +210,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CORE_CRYPT_O = @CORE_CRYPT_O@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@

View File

@ -36,15 +36,13 @@
#include "core/error.h"
#endif
#if IS_REDOX
# define restrict __restrict__
#endif
#if SUPPORTS_NETWORKING && HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#define SOCKET int
#ifndef SOCKET
#define SOCKET int
#endif
///////////////////////////////////////////////////////////////////////////////
//

View File

@ -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 <unistd.h>
# 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);
}

View File

@ -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 <proto/bsdsocket.h>
# 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
}

View File

@ -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))

View File

@ -217,6 +217,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CORE_CRYPT_O = @CORE_CRYPT_O@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@

View File

@ -79,9 +79,18 @@
#if IS_AROS
#include <errno.h>
#if HAVE_PROTO_EXEC_H
#include <proto/exec.h>
#endif
#if HAVE_PROTO_BSDSOCKET_H
#include <proto/bsdsocket.h>
#endif
#if HAVE_BSDSOCKET_SOCKETBASETAGS_H
#include <bsdsocket/socketbasetags.h>
#endif
static bool aros_socketbase_init();
#endif

View File

@ -206,6 +206,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CORE_CRYPT_O = @CORE_CRYPT_O@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@

View File

@ -212,6 +212,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CORE_CRYPT_O = @CORE_CRYPT_O@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@

View File

@ -213,6 +213,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CORE_CRYPT_O = @CORE_CRYPT_O@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@

View File

@ -206,6 +206,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CORE_CRYPT_O = @CORE_CRYPT_O@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@

View File

@ -246,6 +246,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CORE_CRYPT_O = @CORE_CRYPT_O@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@

View File

@ -83,7 +83,8 @@ template<class T, int ALIGN_SIZE> AlignMe<T, ALIGN_SIZE>::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<class E, class T> 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);
}

View File

@ -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)

View File

@ -211,6 +211,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CORE_CRYPT_O = @CORE_CRYPT_O@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@

View File

@ -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;