2005-06-22 05:23:22 +02:00
|
|
|
#ifndef CONFIG_H_INCLUDED
|
|
|
|
#define CONFIG_H_INCLUDED
|
2005-01-27 16:50:11 +01:00
|
|
|
|
2004-08-10 18:04:21 +02:00
|
|
|
|
2005-06-22 05:23:22 +02:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// user-specified configuration choices
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#undef CONFIG_DISABLE_EXCEPTIONS
|
|
|
|
|
|
|
|
#undef CONFIG_USE_MMGR
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// auto-detect OS and platform via predefined macros
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// get compiler versions with consistent names + format:
|
|
|
|
// (major*100 + minor), or 0 if not present. note that more than
|
|
|
|
// one *_VERSION may be non-zero due to interoperability (e.g. ICC with MSC).
|
|
|
|
// .. ICC
|
|
|
|
#if defined(__INTEL_COMPILER)
|
|
|
|
# define ICC_VERSION __INTEL_COMPILER
|
|
|
|
#else
|
|
|
|
# define ICC_VERSION 0
|
|
|
|
#endif
|
|
|
|
// .. VC
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
# define MSC_VERSION _MSC_VER
|
|
|
|
#else
|
|
|
|
# define MSC_VERSION 0
|
|
|
|
#endif
|
|
|
|
// .. GCC
|
|
|
|
#ifdef __GNUC__
|
|
|
|
# define GCC_VERSION (__GNUC__*100 + __GNUC_MINOR__)
|
|
|
|
#else
|
|
|
|
# define GCC_VERSION 0
|
|
|
|
#endif
|
|
|
|
|
2005-06-27 02:25:10 +02:00
|
|
|
// STL
|
2005-07-03 22:47:24 +02:00
|
|
|
// .. pull in the Dinkumware header that defines _CPPLIB_VER
|
|
|
|
#if MSC_VERSION != 0
|
|
|
|
# include <yvals.h>
|
|
|
|
#endif
|
2005-06-27 02:25:10 +02:00
|
|
|
#if defined(_CPPLIB_VER)
|
|
|
|
# define STL_DINKUMWARE _CPPLIB_VER
|
|
|
|
#else
|
|
|
|
# define STL_DINKUMWARE 0
|
|
|
|
#endif
|
|
|
|
|
2005-06-22 05:23:22 +02:00
|
|
|
// OS
|
|
|
|
// .. Windows
|
2004-08-10 18:04:21 +02:00
|
|
|
#if defined(_WIN32) || defined(WIN32)
|
2004-03-03 00:56:51 +01:00
|
|
|
# define OS_WIN
|
2005-06-22 05:23:22 +02:00
|
|
|
// .. Linux
|
2004-08-10 18:04:21 +02:00
|
|
|
#elif defined(linux) || defined(__linux) || defined(__linux__)
|
2004-03-03 00:56:51 +01:00
|
|
|
# define OS_LINUX
|
2004-06-02 16:31:27 +02:00
|
|
|
# define OS_UNIX
|
2005-06-22 05:23:22 +02:00
|
|
|
// .. Mac OS X
|
2004-08-10 18:04:21 +02:00
|
|
|
#elif defined(MAC_OS_X
|
2004-03-03 00:56:51 +01:00
|
|
|
# define OS_MACOSX
|
2004-06-02 16:31:27 +02:00
|
|
|
# define OS_UNIX
|
2005-06-22 05:23:22 +02:00
|
|
|
// .. BSD
|
2004-08-10 18:04:21 +02:00
|
|
|
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
|
|
|
# define OS_BSD
|
2005-06-22 05:23:22 +02:00
|
|
|
# define OS_UNIX
|
|
|
|
// .. Solaris
|
2004-08-10 18:04:21 +02:00
|
|
|
#elif defined(SOLARIS)
|
|
|
|
# define OS_SOLARIS
|
2005-06-22 05:23:22 +02:00
|
|
|
# define OS_UNIX
|
|
|
|
// .. BeOS
|
2004-08-10 18:04:21 +02:00
|
|
|
#elif defined(__BEOS__)
|
|
|
|
# define OS_BEOS
|
2005-06-22 05:23:22 +02:00
|
|
|
// .. Mac OS 9 or below
|
|
|
|
#elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
|
|
|
|
# define OS_MAC
|
|
|
|
// .. Amiga
|
2004-08-10 18:04:21 +02:00
|
|
|
#elif defined(__amigaos__)
|
|
|
|
# define OS_AMIGA
|
2005-06-22 05:23:22 +02:00
|
|
|
// .. Unix-based
|
2004-08-10 18:04:21 +02:00
|
|
|
#elif defined(unix) || defined(__unix) || defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE)
|
|
|
|
# define OS_UNIX
|
2005-06-22 05:23:22 +02:00
|
|
|
// .. unknown
|
2004-03-03 00:56:51 +01:00
|
|
|
#else
|
|
|
|
# error "unknown OS - add define here"
|
|
|
|
#endif
|
|
|
|
|
2005-06-25 09:43:13 +02:00
|
|
|
// byte order
|
|
|
|
#if defined(__i386__) || defined(__i386) || defined(_M_IX86) || \
|
|
|
|
defined(__ia64__) || defined(__ia64) || defined(_M_IA64) || \
|
|
|
|
defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA) || \
|
|
|
|
defined(__arm__) || \
|
|
|
|
defined(__MIPSEL__) || \
|
|
|
|
defined(__LITTLE_ENDIAN__)
|
|
|
|
# define LITTLE_ENDIAN
|
|
|
|
#else
|
|
|
|
# define BIG_ENDIAN
|
|
|
|
#endif
|
|
|
|
|
2004-03-03 00:56:51 +01:00
|
|
|
|
2005-06-22 05:23:22 +02:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// auto-detect platform features, given the above information
|
|
|
|
//-----------------------------------------------------------------------------
|
2004-06-02 17:00:23 +02:00
|
|
|
|
2005-06-22 05:23:22 +02:00
|
|
|
// compiler support for C99
|
|
|
|
// (this is more convenient than testing __STDC_VERSION__ directly)
|
|
|
|
#undef HAVE_C99
|
2005-07-03 22:47:24 +02:00
|
|
|
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
|
|
|
|
# define HAVE_C99
|
2004-06-02 17:00:23 +02:00
|
|
|
#endif
|
|
|
|
|
2005-06-22 05:23:22 +02:00
|
|
|
// gettimeofday()
|
|
|
|
#undef HAVE_GETTIMEOFDAY
|
2004-06-02 16:31:27 +02:00
|
|
|
#ifdef OS_UNIX
|
|
|
|
# define HAVE_GETTIMEOFDAY
|
|
|
|
#endif
|
|
|
|
|
2005-06-22 05:23:22 +02:00
|
|
|
// X server
|
|
|
|
#undef HAVE_X
|
2004-06-02 16:31:27 +02:00
|
|
|
#ifdef OS_LINUX
|
|
|
|
# define HAVE_X
|
|
|
|
#endif
|
2004-03-03 00:56:51 +01:00
|
|
|
|
2005-06-22 05:23:22 +02:00
|
|
|
// __asm{} blocks (Intel syntax)
|
|
|
|
#undef HAVE_ASM
|
2005-07-03 22:47:24 +02:00
|
|
|
#if MSC_VERSION != 0
|
2005-06-22 05:23:22 +02:00
|
|
|
# define HAVE_ASM
|
|
|
|
#endif
|
2004-06-02 17:00:23 +02:00
|
|
|
|
2005-06-22 05:23:22 +02:00
|
|
|
// precompiled headers (affects what precompiled.h pulls in; see there)
|
|
|
|
#undef HAVE_PCH
|
|
|
|
#if (MSC_VERSION != 0) || (GCC_VERSION > 304)
|
|
|
|
# define HAVE_PCH
|
|
|
|
#endif
|
2005-03-10 21:28:25 +01:00
|
|
|
|
2005-06-22 05:23:22 +02:00
|
|
|
// VC debug memory allocator / leak detector
|
|
|
|
#undef HAVE_VC_DEBUG_ALLOC
|
2005-07-03 22:47:24 +02:00
|
|
|
#if MSC_VERSION != 0
|
2005-06-22 05:23:22 +02:00
|
|
|
# define HAVE_VC_DEBUG_ALLOC
|
|
|
|
#endif
|
|
|
|
// .. only in full-debug mode;
|
|
|
|
#if defined(NDEBUG) || defined(TESTING)
|
|
|
|
# undef HAVE_VC_DEBUG_ALLOC
|
2005-03-10 21:28:25 +01:00
|
|
|
#endif
|
2005-06-22 05:23:22 +02:00
|
|
|
// .. require PCH, because it makes sure system headers are included before
|
|
|
|
// redefining new (otherwise, tons of errors result);
|
|
|
|
#if !defined(HAVE_PCH)
|
|
|
|
# undef HAVE_VC_DEBUG_ALLOC
|
|
|
|
#endif
|
|
|
|
// .. disable on ICC9, because the ICC 9.0.006 beta appears to generate
|
|
|
|
// incorrect code when we redefine new.
|
|
|
|
// TODO: remove when no longer necessary
|
|
|
|
#if ICC_VERSION == 900
|
|
|
|
# undef HAVE_VC_DEBUG_ALLOC
|
|
|
|
#endif
|
|
|
|
|
2005-07-03 22:47:24 +02:00
|
|
|
// nonstandard STL containers
|
|
|
|
#undef HAVE_STL_HASH
|
|
|
|
#undef HAVE_STL_SLIST
|
|
|
|
#if STL_DINKUMWARE != 0
|
|
|
|
# define HAVE_STL_HASH
|
|
|
|
#endif
|
2005-06-25 09:43:13 +02:00
|
|
|
|
2005-06-22 05:23:22 +02:00
|
|
|
#endif // #ifndef CONFIG_H_INCLUDED
|