susumu.yata
null+****@clear*****
Tue Dec 16 10:40:31 JST 2014
susumu.yata 2014-10-30 11:41:08 +0900 (Thu, 30 Oct 2014) New Revision: 4973a3cfff45c9b45ca2b00a77c9824d4d7c87bd https://github.com/groonga/grnxx/commit/4973a3cfff45c9b45ca2b00a77c9824d4d7c87bd Message: Add feature macros. (#96) Added files: include/grnxx/features.hpp include/grnxx/features/Makefile.am include/grnxx/features/compiler.hpp include/grnxx/features/cpu.hpp include/grnxx/features/functions.hpp include/grnxx/features/os.hpp Modified files: configure.ac include/grnxx/Makefile.am Modified: configure.ac (+1 -0) =================================================================== --- configure.ac 2014-10-30 11:40:17 +0900 (fe647ad) +++ configure.ac 2014-10-30 11:41:08 +0900 (1b98252) @@ -55,6 +55,7 @@ AC_CONFIG_FILES([Makefile include/grnxx/data_types/Makefile include/grnxx/data_types/scalar/Makefile include/grnxx/data_types/vector/Makefile + include/grnxx/features/Makefile lib/Makefile lib/grnxx/Makefile src/Makefile Modified: include/grnxx/Makefile.am (+3 -1) =================================================================== --- include/grnxx/Makefile.am 2014-10-30 11:40:17 +0900 (5764e08) +++ include/grnxx/Makefile.am 2014-10-30 11:41:08 +0900 (4be99d9) @@ -1,7 +1,9 @@ SUBDIRS = \ - data_types + data_types \ + features pkginclude_HEADERS = \ + features.hpp \ library.hpp # column.hpp \ Added: include/grnxx/features.hpp (+9 -0) 100644 =================================================================== --- /dev/null +++ include/grnxx/features.hpp 2014-10-30 11:41:08 +0900 (9ec5c2e) @@ -0,0 +1,9 @@ +#ifndef GRNXX_FEATURES_HPP +#define GRNXX_FEATURES_HPP + +#include "grnxx/features/compiler.hpp" +#include "grnxx/features/cpu.hpp" +#include "grnxx/features/functions.hpp" +#include "grnxx/features/os.hpp" + +#endif // GRNXX_FEATURES_HPP Added: include/grnxx/features/Makefile.am (+0 -0) 100644 =================================================================== --- /dev/null +++ include/grnxx/features/Makefile.am 2014-10-30 11:41:08 +0900 (e69de29) Added: include/grnxx/features/compiler.hpp (+52 -0) 100644 =================================================================== --- /dev/null +++ include/grnxx/features/compiler.hpp 2014-10-30 11:41:08 +0900 (941d8bf) @@ -0,0 +1,52 @@ +#ifndef GRNXX_FEATURES_COMPILER_HPP +#define GRNXX_FEATURES_COMPILER_HPP + +#ifdef _MSC_VER +# define GRNXX_MSC +# define GRNXX_MSC_VERSION _MSC_VER +#endif // _MSC_VER + +// NOTE: 64-bit MinGW defines both __MINGW32__ and __MINGW64__, +// but the following uses the logical OR of them for clarification. +#if defined(__MINGW32__) || defined(__MINGW64__) +# define GRNXX_MINGW +# ifdef __MINGW64__ +# define GRNXX_MINGW_MAJOR __MINGW64_MAJOR_VERSION +# define GRNXX_MINGW_MINOR __MINGW64_MINOR_VERSION +# else // __MINGW64__ +# define GRNXX_MINGW_MAJOR __MINGW32_MAJOR_VERSION +# define GRNXX_MINGW_MINOR __MINGW32_MINOR_VERSION +# endif // __MINGW64__ +# define GRNXX_MINGW_MAKE_VERSION(major, minor) ((major * 100) + minor) +# define GRNXX_MINGW_VERSION GRNXX_MINGW_MAKE_VERSION(\ + GRNXX_MINGW_MAJOR, GRNXX_MINGW_MINOR) +#endif // defined(__MINGW32__) || defined(__MINGW64__) + +#ifdef __clang__ +# define GRNXX_CLANG +# define GRNXX_CLANG_MAJOR __clang_major__ +# define GRNXX_CLANG_MINOR __clang_minor__ +# define GRNXX_CLANG_PATCH_LEVEL __clang_patchlevel__ +# define GRNXX_CLANG_VERSION __clang_version__ +#endif // __clang__ + +#ifdef __GNUC__ +# define GRNXX_GNUC +# define GRNXX_GNUC_MAJOR __GNUC__ +# ifdef __GNUC_MINOR__ +# define GRNXX_GNUC_MINOR __GNUC_MINOR__ +# else // __GNUC_MINOR__ +# define GRNXX_GNUC_MINOR 0 +# endif // __GNUC_MINOR__ +# ifdef __GNUC_PATCHLEVEL__ +# define GRNXX_GNUC_PATCH_LEVEL __GNUC_PATCHLEVEL__ +# else // __GNUC_PATCHLEVEL__ +# define GRNXX_GNUC_PATCH_LEVEL 0 +# endif // __GNUC_PATCHLEVEL__ +# define GRNXX_GNUC_MAKE_VERSION(major, minor, patch_level)\ + ((major * 10000) + (minor * 100) + patch_level) +# define GRNXX_GNUC_VERSION GRNXX_GNUC_MAKE_VERSION(\ + GRNXX_GNUC_MAJOR, GRNXX_GNUC_MINOR, GRNXX_GNUC_PATCH_LEVEL) +#endif // defined(__GNUC__) + +#endif // GRNXX_FEATURES_COMPILER_HPP Added: include/grnxx/features/cpu.hpp (+8 -0) 100644 =================================================================== --- /dev/null +++ include/grnxx/features/cpu.hpp 2014-10-30 11:41:08 +0900 (58bf26a) @@ -0,0 +1,8 @@ +#ifndef GRNXX_FEATURES_CPU_HPP +#define GRNXX_FEATURES_CPU_HPP + +#if defined(__x86_64__) || defined(__X86_64__) +# define GRNXX_X86_64 +#endif // defined(__x86_64__) || defined(__X86_64__) + +#endif // GRNXX_FEATURES_CPU_HPP Added: include/grnxx/features/functions.hpp (+4 -0) 100644 =================================================================== --- /dev/null +++ include/grnxx/features/functions.hpp 2014-10-30 11:41:08 +0900 (c359552) @@ -0,0 +1,4 @@ +#ifndef GRNXX_FEATURES_FUNCTIONS_HPP +#define GRNXX_FEATURES_FUNCTIONS_HPP + +#endif // GRNXX_FEATURES_FUNCTIONS_HPP Added: include/grnxx/features/os.hpp (+13 -0) 100644 =================================================================== --- /dev/null +++ include/grnxx/features/os.hpp 2014-10-30 11:41:08 +0900 (bd37661) @@ -0,0 +1,13 @@ +#ifndef GRNXX_FEATURES_OS_HPP +#define GRNXX_FEATURES_OS_HPP + +#ifdef _WIN32 +# define GRNXX_WIN +# ifdef _WIN64 +# define GRNXX_WIN64 _WIN64 +# else // _WIN64 +# define GRNXX_WIN32 _WIN32 +# endif // _WIN64 +#endif // _WIN32 + +#endif // GRNXX_FEATURES_OS_HPP -------------- next part -------------- HTML����������������������������... 下载