From 07de990b35e4f1f8983b69dc2ca8f3a112322fec Mon Sep 17 00:00:00 2001 From: Sven Suursoho Date: Wed, 24 Sep 2008 00:55:08 +0300 Subject: [PATCH] Compile time configuration: drop untested combos * Architecture(s): PPC * Compiler(s): Intel, SunPro * OS(es): darwin, freebsd Will restore later --- sol/config/arch.hpp | 4 ---- sol/config/arch/module.cmake | 1 - sol/config/arch/ppc.hpp | 26 -------------------------- sol/config/compiler.hpp | 8 -------- sol/config/compiler/gcc.hpp | 2 +- sol/config/compiler/icc.hpp | 22 ---------------------- sol/config/compiler/module.cmake | 2 -- sol/config/compiler/sunpro.hpp | 22 ---------------------- sol/config/os.hpp | 8 -------- sol/config/os/darwin.hpp | 20 -------------------- sol/config/os/freebsd.hpp | 20 -------------------- sol/config/os/linux.hpp | 29 +++++++++++++++++++++++++++++ sol/config/os/module.cmake | 3 +-- sol/config/os/posix.hpp | 37 +++++++++++++++++++++++++++++++++++++ 14 files changed, 68 insertions(+), 136 deletions(-) delete mode 100644 sol/config/arch/ppc.hpp delete mode 100644 sol/config/compiler/icc.hpp delete mode 100644 sol/config/compiler/sunpro.hpp delete mode 100644 sol/config/os/darwin.hpp delete mode 100644 sol/config/os/freebsd.hpp create mode 100644 sol/config/os/posix.hpp diff --git a/sol/config/arch.hpp b/sol/config/arch.hpp index f1d8d1a..b7d8130 100644 --- a/sol/config/arch.hpp +++ b/sol/config/arch.hpp @@ -32,10 +32,6 @@ // x86 #define SOL_ARCH_CONFIG "sol/config/arch/x86.hpp" -#elif defined(__ppc__) || defined(__POWERPC__) || defined(_ARCH_PPC) - // PowerPC - #define SOL_ARCH_CONFIG "sol/config/arch/ppc.hpp" - #else #error "Unknown architecture" #endif diff --git a/sol/config/arch/module.cmake b/sol/config/arch/module.cmake index 5f0575c..f1311ba 100644 --- a/sol/config/arch/module.cmake +++ b/sol/config/arch/module.cmake @@ -1,5 +1,4 @@ sol_headers( - ppc.hpp x86.hpp x86_64.hpp ) diff --git a/sol/config/arch/ppc.hpp b/sol/config/arch/ppc.hpp deleted file mode 100644 index 2916a7d..0000000 --- a/sol/config/arch/ppc.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#if !defined(sol_config_arch_ppc_hpp_included) -#define sol_config_arch_ppc_hpp_included -/// \addtogroup sol_config -/// \{ - - -/** - * \file sol/config/arch/ppc.hpp - * \brief PowerPC-specific configuration - * \author Sven Suursoho - */ - - -#define SOL_ARCH_PPC 1 - -#define SOL_ARCH_NAME "ppc" - - -#if !defined(SOL_BYTE_ORDER) - /// Byte ordering - #define SOL_BYTE_ORDER SOL_BIG_ENDIAN -#endif - - -/// \} -#endif // sol_config_arch_ppc_hpp_included diff --git a/sol/config/compiler.hpp b/sol/config/compiler.hpp index c483b2d..7036ca4 100644 --- a/sol/config/compiler.hpp +++ b/sol/config/compiler.hpp @@ -18,18 +18,10 @@ #if defined(SOL_COMPILER_CONFIG) // already have user specified compiler config header -#elif defined(__INTEL_COMPILER) - // icc - #define SOL_COMPILER_CONFIG "sol/config/compiler/icc.hpp" - #elif defined(__GNUC__) // gcc #define SOL_COMPILER_CONFIG "sol/config/compiler/gcc.hpp" -#elif defined(__SUNPRO_CC) - // sunCC - #define SOL_COMPILER_CONFIG "sol/config/compiler/sunpro.hpp" - #else #error "Unknown compiler" #endif diff --git a/sol/config/compiler/gcc.hpp b/sol/config/compiler/gcc.hpp index 29efb68..2001d46 100644 --- a/sol/config/compiler/gcc.hpp +++ b/sol/config/compiler/gcc.hpp @@ -23,7 +23,7 @@ #define SOL_COMPILER_NAME "g++" #define SOL_COMPILER_VERSION \ - ((__GNUC__ << 16) | (__GNUC_MINOR__ << 8) | __GNUC_PATCHLEVEL__) + SOL_MAKE_VERSION(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__) // diff --git a/sol/config/compiler/icc.hpp b/sol/config/compiler/icc.hpp deleted file mode 100644 index 18dc1e8..0000000 --- a/sol/config/compiler/icc.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#if !defined(sol_config_compiler_icc_hpp_included) -#define sol_config_compiler_icc_hpp_included -/// \addtogroup sol_config -/// \{ - - -/** - * \file sol/config/compiler/icc.hpp - * \brief Intel icc-specific compiler configuration - * \author Sven Suursoho - */ - - -#define SOL_COMPILER_INTEL 1 - -#define SOL_COMPILER_NAME "icc" - -#define SOL_COMPILER_VERSION __INTEL_COMPILER - - -/// \} -#endif // sol_config_compiler_icc_hpp_included diff --git a/sol/config/compiler/module.cmake b/sol/config/compiler/module.cmake index b1a67d6..513f64a 100644 --- a/sol/config/compiler/module.cmake +++ b/sol/config/compiler/module.cmake @@ -1,5 +1,3 @@ sol_headers( gcc.hpp - icc.hpp - sunpro.hpp ) diff --git a/sol/config/compiler/sunpro.hpp b/sol/config/compiler/sunpro.hpp deleted file mode 100644 index 574315c..0000000 --- a/sol/config/compiler/sunpro.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#if !defined(sol_config_compiler_icc_hpp_included) -#define sol_config_compiler_icc_hpp_included -/// \addtogroup sol_config -/// \{ - - -/** - * \file sol/config/compiler/icc.hpp - * \brief SunPro sunCC-specific compiler configuration - * \author Sven Suursoho - */ - - -#define SOL_COMPILER_SUN 1 - -#define SOL_COMPILER_NAME "sunCC" - -#define SOL_COMPILER_VERSION __SUNPRO_CC - - -/// \} -#endif // sol_config_compiler_icc_hpp_included diff --git a/sol/config/os.hpp b/sol/config/os.hpp index 97d45b5..590173a 100644 --- a/sol/config/os.hpp +++ b/sol/config/os.hpp @@ -22,14 +22,6 @@ // linux #define SOL_OS_CONFIG "sol/config/os/linux.hpp" -#elif defined(__FreeBSD__) - // Darwin - #define SOL_OS_CONFIG "sol/config/os/freebsd.hpp" - -#elif defined(__APPLE__) - // Darwin - #define SOL_OS_CONFIG "sol/config/os/darwin.hpp" - #else #error "Unknown OS" #endif diff --git a/sol/config/os/darwin.hpp b/sol/config/os/darwin.hpp deleted file mode 100644 index 07cac50..0000000 --- a/sol/config/os/darwin.hpp +++ /dev/null @@ -1,20 +0,0 @@ -#if !defined(sol_config_os_darwin_hpp_included) -#define sol_config_os_darwin_hpp_included -/// \addtogroup sol_config -/// \{ - - -/** - * \file sol/config/os/darwin.hpp - * \brief Darwin (mac) specific environment configuration - * \author Sven Suursoho - */ - - -#define SOL_OS_DARWIN 1 - -#define SOL_OS_NAME "Darwin" - - -/// \} -#endif // sol_config_os_darwin_hpp_included diff --git a/sol/config/os/freebsd.hpp b/sol/config/os/freebsd.hpp deleted file mode 100644 index dbb2d06..0000000 --- a/sol/config/os/freebsd.hpp +++ /dev/null @@ -1,20 +0,0 @@ -#if !defined(sol_config_os_freebsd_hpp_included) -#define sol_config_os_freebsd_hpp_included -/// \addtogroup sol_config -/// \{ - - -/** - * \file sol/config/os/freebsd.hpp - * \brief FreeBSD-specific environment configuration - * \author Sven Suursoho - */ - - -#define SOL_OS_FREEBSD 1 - -#define SOL_OS_NAME "FreeBSD" - - -/// \} -#endif // sol_config_os_freebsd_hpp_included diff --git a/sol/config/os/linux.hpp b/sol/config/os/linux.hpp index ba2f8df..672468e 100644 --- a/sol/config/os/linux.hpp +++ b/sol/config/os/linux.hpp @@ -11,10 +11,39 @@ */ +#include + + +// +// set OS name +// + #define SOL_OS_LINUX 1 #define SOL_OS_NAME "linux" +// +// glibc version +// + +#include +#define SOL_GLIBC_VERSION SOL_MAKE_VERSION(__GLIBC__,__GLIBC_MINOR__,0) + + +// +// cstdint | stdint.h | inttypes.h +// + +#if SOL_GLIBC_VERSION >= SOL_MAKE_VERSION(2,1,0) + #define SOL_HAS_STDINT_H +#endif + + +// Posix features +#define SOL_HAS_UNISTD_H +#include + + /// \} #endif // sol_config_os_linux_hpp_included diff --git a/sol/config/os/module.cmake b/sol/config/os/module.cmake index 47fc6ee..9b845a4 100644 --- a/sol/config/os/module.cmake +++ b/sol/config/os/module.cmake @@ -1,5 +1,4 @@ sol_headers( - darwin.hpp - freebsd.hpp linux.hpp + posix.hpp ) diff --git a/sol/config/os/posix.hpp b/sol/config/os/posix.hpp new file mode 100644 index 0000000..10770de --- /dev/null +++ b/sol/config/os/posix.hpp @@ -0,0 +1,37 @@ +#if !defined(sol_config_os_posix_hpp_included) +#define sol_config_os_posix_hpp_included +/// \addtogroup sol_config +/// \{ + + +/** + * \file sol/config/os/posix.hpp + * \brief Posix-specific environment configuration + * \author Sven Suursoho + */ + + +// +// OS name already set by our includer +// + +#define SOL_OS_POSIX 1 + + +// see "man unistd.h(0p)" +#if defined(SOL_HAS_UNISTD_H) + #include + + #if !defined(_POSIX_VERSION) + #error Symbol _POSIX_VERSION not defined by unistd.h + #endif + + // stdint.h + #if _POSIX_VERSION > 200100L + #define SOL_HAS_STDINT_H + #endif +#endif + + +/// \} +#endif // sol_config_os_posix_hpp_included -- 2.11.4.GIT