<commit_before>﻿//======================================================================
//-----------------------------------------------------------------------
/**
 * @file        iutest_compiler.hpp
 * @brief       iris unit test compiler 依存の吸収 ファイル
 *
 * @author      t.shirayanagi
 * @par         copyright
 * Copyright (C) 2011-2019, <NAME>\n
 * This software is released under the new BSD License,
 * see LICENSE
*/
//-----------------------------------------------------------------------
//======================================================================
#ifndef INCG_IRIS_IUTEST_COMPILER_HPP_6DDB27E8_E2FF_4754_80B0_F500025820C4_
#define INCG_IRIS_IUTEST_COMPILER_HPP_6DDB27E8_E2FF_4754_80B0_F500025820C4_

//======================================================================
// include

//======================================================================
// define
#if defined(_MSC_VER) && _MSC_VER == 1700
#  ifndef _VARIADIC_MAX
#    define _VARIADIC_MAX   10
#  endif
#endif

// os
#if   defined(__CYGWIN__)
#  define IUTEST_OS_CYGWIN              1
#  define IUTEST_PLATFORM               "CYGWIN"
#elif defined(_WIN32) || defined(WIN32) || defined(__WIN32__) || defined(WINAPI_FAMILY)
#  define IUTEST_OS_WINDOWS             1
#  if !defined(WIN32_LEAN_AND_MEAN)
#    define WIN32_LEAN_AND_MEAN
#  endif
#  include <windows.h>
#  if defined(_WIN32_WCE)
#    define IUTEST_OS_WINDOWS_MOBILE    1
#    define IUTEST_PLATFORM             "Windows CE"
#  elif defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
#    define IUTEST_OS_WINDOWS_MINGW     1
#  elif defined(__WINE__)
#    define IUTEST_OS_WINDOWS_WINE      1
#    define IUTEST_PLATFORM             "WINE"
#  elif defined(__CUDACC__)
#    define IUTEST_OS_WINDOWS_CUDA      1
#  elif defined(WINAPI_FAMILY)
#    if defined(WINAPI_FAMILY_PHONE_APP) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
#      define IUTEST_OS_WINDOWS_PHONE   1
#      define IUTEST_PLATFORM           "Windows Phone"
#    elif defined(WINAPI_FAMILY_APP) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
#      define IUTEST_OS_WINDOWS_RT      1
#      define IUTEST_PLATFORM           "Windows RT"
#    else
#      define IUTEST_OS_WINDOWS_DESKTOP 1
#    endif
#  else
#    define IUTEST_OS_WINDOWS_DESKTOP   1
#  endif
#  if !defined(IUTEST_PLATFORM)
#    define IUTEST_PLATFORM             "Windows"
#  endif
#elif defined(__APPLE__)
#  include "TargetConditionals.h"
#  if TARGET_OS_IPHONE
#    define IUTEST_OS_IOS               1
#    define IUTEST_PLATFORM             "iOS"
#  else
#    define IUTEST_OS_MAC               1
#    define IUTEST_PLATFORM             "Mac OS"
#  endif
#elif defined(__FreeBSD__)
#  define IUTEST_OS_FREEBSD             1
#  define IUTEST_PLATFORM               "FreeBSD"
#elif defined(sun) || defined(__sun)
#  define IUTEST_OS_SOLARIS             1
#  define IUTEST_PLATFORM               "Solaris"
#elif defined(__linux__)
#  define IUTEST_OS_LINUX               1
#  if defined(ANDROID) || defined(__ANDROID__)
#    define IUTEST_OS_LINUX_ANDROID     1
#    define IUTEST_PLATFORM             "Android"
#  else
#    define IUTEST_PLATFORM             "LINUX"
#  endif
#elif defined(__native_client__)
#  define IUTEST_OS_NACL                1   //!< @deprecated native client to eol
#  define IUTEST_PLATFORM               "Google Native Client"
#elif defined(__AVR32__) || defined(__avr32__)
#  define IUTEST_OS_AVR32               1
#  define IUTEST_PLATFORM               "AVR32"
#elif defined(__arm__)
#  define IUTEST_OS_ARM                 1
#  define IUTEST_PLATFORM               "ARM"
#endif

#if defined(IUTEST_OS_LINUX_ANDROID)
#  include <android/api-level.h>
#endif

// __cplusplus numbers

#define IUTEST_CPLUSPLUS_CXX11 201103L
#define IUTEST_CPLUSPLUS_CXX14 201402L
#define IUTEST_CPLUSPLUS_CXX17 201703L

// c++2a

#if !defined(IUTEST_HAS_CXX2A)
#  if (defined(__cplusplus) && __cplusplus > IUTEST_CPLUSPLUS_CXX17)
#    define IUTEST_HAS_CXX2A        1
#  elif (defined(_MSVC_LANG) && _MSVC_LANG > IUTEST_CPLUSPLUS_CXX17)
#    define IUTEST_HAS_CXX2A        1
#  endif
#endif

#if !defined(IUTEST_HAS_CXX2A)
#  define IUTEST_HAS_CXX2A          0
#endif

// c++17
//! is c++17 compiler
#if !defined(IUTEST_HAS_CXX17)
#  if (defined(__cplusplus) && __cplusplus >= IUTEST_CPLUSPLUS_CXX17)
#    define IUTEST_HAS_CXX17        1
#  elif (defined(_MSVC_LANG) && _MSVC_LANG >= IUTEST_CPLUSPLUS_CXX17)
#    define IUTEST_HAS_CXX17        1
#  endif
#endif

#if !defined(IUTEST_HAS_CXX17)
#  define IUTEST_HAS_CXX17          0
#endif

#if !defined(IUTEST_HAS_CXX1Z)
#  if (defined(__cplusplus) && __cplusplus > IUTEST_CPLUSPLUS_CXX14)
#    define IUTEST_HAS_CXX1Z        1
#  elif (defined(_MSVC_LANG) && _MSVC_LANG > IUTEST_CPLUSPLUS_CXX14)
#    define IUTEST_HAS_CXX1Z        1
#  endif
#endif

#if !defined(IUTEST_HAS_CXX1Z)
#  define IUTEST_HAS_CXX1Z          0
#endif

//! is c++14 compiler
#if !defined(IUTEST_HAS_CXX14)
#  if (defined(__cplusplus) && __cplusplus >= IUTEST_CPLUSPLUS_CXX14)
#    define IUTEST_HAS_CXX14        1
#  elif (defined(_MSVC_LANG) && _MSVC_LANG >= IUTEST_CPLUSPLUS_CXX14)
#    define IUTEST_HAS_CXX14        1
#  endif
#endif

#if !defined(IUTEST_HAS_CXX14)
#  define IUTEST_HAS_CXX14          0
#endif

//! is c++11 compiler
#if !defined(IUTEST_HAS_CXX11)
#  if (defined(__cplusplus) && __cplusplus >= IUTEST_CPLUSPLUS_CXX11) || defined(__GXX_EXPERIMENTAL_CXX0X__)
#    define IUTEST_HAS_CXX11        1
#  endif
#endif

#if !defined(IUTEST_HAS_CXX11)
#  define IUTEST_HAS_CXX11          0
#endif



// c++17 features

//! inline variable
#if !defined(IUTEST_HAS_INLINE_VARIABLE)
#if defined(__clang__)
#  if IUTEST_HAS_CXX1Z && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 9))
#    define IUTEST_HAS_INLINE_VARIABLE      1
#  endif
#endif
#endif

#if !defined(IUTEST_HAS_INLINE_VARIABLE)
#  define IUTEST_HAS_INLINE_VARIABLE        0
#endif

//! constexpr if
#if !defined(IUTEST_HAS_CONSTEXPR_IF)
#  if   defined(__cpp_if_constexpr) && __cpp_if_constexpr >= 201606
#    define IUTEST_HAS_CONSTEXPR_IF         1
#  elif defined(_MSC_VER)
#    if _MSC_VER >= 1910 && IUTEST_HAS_CXX17<commit_msg>fix cxx11 detect macro in visual studio<commit_after>﻿//======================================================================
//-----------------------------------------------------------------------
/**
 * @file        iutest_compiler.hpp
 * @brief       iris unit test compiler 依存の吸収 ファイル
 *
 * @author      t.shirayanagi
 * @par         copyright
 * Copyright (C) 2011-2019, <NAME>\n
 * This software is released under the new BSD License,
 * see LICENSE
*/
//-----------------------------------------------------------------------
//======================================================================
#ifndef INCG_IRIS_IUTEST_COMPILER_HPP_6DDB27E8_E2FF_4754_80B0_F500025820C4_
#define INCG_IRIS_IUTEST_COMPILER_HPP_6DDB27E8_E2FF_4754_80B0_F500025820C4_

//======================================================================
// include

//======================================================================
// define
#if defined(_MSC_VER) && _MSC_VER == 1700
#  ifndef _VARIADIC_MAX
#    define _VARIADIC_MAX   10
#  endif
#endif

// os
#if   defined(__CYGWIN__)
#  define IUTEST_OS_CYGWIN              1
#  define IUTEST_PLATFORM               "CYGWIN"
#elif defined(_WIN32) || defined(WIN32) || defined(__WIN32__) || defined(WINAPI_FAMILY)
#  define IUTEST_OS_WINDOWS             1
#  if !defined(WIN32_LEAN_AND_MEAN)
#    define WIN32_LEAN_AND_MEAN
#  endif
#  include <windows.h>
#  if defined(_WIN32_WCE)
#    define IUTEST_OS_WINDOWS_MOBILE    1
#    define IUTEST_PLATFORM             "Windows CE"
#  elif defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
#    define IUTEST_OS_WINDOWS_MINGW     1
#  elif defined(__WINE__)
#    define IUTEST_OS_WINDOWS_WINE      1
#    define IUTEST_PLATFORM             "WINE"
#  elif defined(__CUDACC__)
#    define IUTEST_OS_WINDOWS_CUDA      1
#  elif defined(WINAPI_FAMILY)
#    if defined(WINAPI_FAMILY_PHONE_APP) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
#      define IUTEST_OS_WINDOWS_PHONE   1
#      define IUTEST_PLATFORM           "Windows Phone"
#    elif defined(WINAPI_FAMILY_APP) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
#      define IUTEST_OS_WINDOWS_RT      1
#      define IUTEST_PLATFORM           "Windows RT"
#    else
#      define IUTEST_OS_WINDOWS_DESKTOP 1
#    endif
#  else
#    define IUTEST_OS_WINDOWS_DESKTOP   1
#  endif
#  if !defined(IUTEST_PLATFORM)
#    define IUTEST_PLATFORM             "Windows"
#  endif
#elif defined(__APPLE__)
#  include "TargetConditionals.h"
#  if TARGET_OS_IPHONE
#    define IUTEST_OS_IOS               1
#    define IUTEST_PLATFORM             "iOS"
#  else
#    define IUTEST_OS_MAC               1
#    define IUTEST_PLATFORM             "Mac OS"
#  endif
#elif defined(__FreeBSD__)
#  define IUTEST_OS_FREEBSD             1
#  define IUTEST_PLATFORM               "FreeBSD"
#elif defined(sun) || defined(__sun)
#  define IUTEST_OS_SOLARIS             1
#  define IUTEST_PLATFORM               "Solaris"
#elif defined(__linux__)
#  define IUTEST_OS_LINUX               1
#  if defined(ANDROID) || defined(__ANDROID__)
#    define IUTEST_OS_LINUX_ANDROID     1
#    define IUTEST_PLATFORM             "Android"
#  else
#    define IUTEST_PLATFORM             "LINUX"
#  endif
#elif defined(__native_client__)
#  define IUTEST_OS_NACL                1   //!< @deprecated native client to eol
#  define IUTEST_PLATFORM               "Google Native Client"
#elif defined(__AVR32__) || defined(__avr32__)
#  define IUTEST_OS_AVR32               1
#  define IUTEST_PLATFORM               "AVR32"
#elif defined(__arm__)
#  define IUTEST_OS_ARM                 1
#  define IUTEST_PLATFORM               "ARM"
#endif

#if defined(IUTEST_OS_LINUX_ANDROID)
#  include <android/api-level.h>
#endif

// __cplusplus numbers

#define IUTEST_CPLUSPLUS_CXX11 201103L
#define IUTEST_CPLUSPLUS_CXX14 201402L
#define IUTEST_CPLUSPLUS_CXX17 201703L

// c++2a

#if !defined(IUTEST_HAS_CXX2A)
#  if (defined(__cplusplus) && __cplusplus > IUTEST_CPLUSPLUS_CXX17)
#    define IUTEST_HAS_CXX2A        1
#  elif (defined(_MSVC_LANG) && _MSVC_LANG > IUTEST_CPLUSPLUS_CXX17)
#    define IUTEST_HAS_CXX2A        1
#  endif
#endif

#if !defined(IUTEST_HAS_CXX2A)
#  define IUTEST_HAS_CXX2A          0
#endif

// c++17
//! is c++17 compiler
#if !defined(IUTEST_HAS_CXX17)
#  if (defined(__cplusplus) && __cplusplus >= IUTEST_CPLUSPLUS_CXX17)
#    define IUTEST_HAS_CXX17        1
#  elif (defined(_MSVC_LANG) && _MSVC_LANG >= IUTEST_CPLUSPLUS_CXX17)
#    define IUTEST_HAS_CXX17        1
#  endif
#endif

#if !defined(IUTEST_HAS_CXX17)
#  define IUTEST_HAS_CXX17          0
#endif

#if !defined(IUTEST_HAS_CXX1Z)
#  if (defined(__cplusplus) && __cplusplus > IUTEST_CPLUSPLUS_CXX14)
#    define IUTEST_HAS_CXX1Z        1
#  elif (defined(_MSVC_LANG) && _MSVC_LANG > IUTEST_CPLUSPLUS_CXX14)
#    define IUTEST_HAS_CXX1Z        1
#  endif
#endif

#if !defined(IUTEST_HAS_CXX1Z)
#  define IUTEST_HAS_CXX1Z          0
#endif

//! is c++14 compiler
#if !defined(IUTEST_HAS_CXX14)
#  if (defined(__cplusplus) && __cplusplus >= IUTEST_CPLUSPLUS_CXX14)
#    define IUTEST_HAS_CXX14        1
#  elif (defined(_MSVC_LANG) && _MSVC_LANG >= IUTEST_CPLUSPLUS_CXX14)
#    define IUTEST_HAS_CXX14        1
#  endif
#endif

#if !defined(IUTEST_HAS_CXX14)
#  define IUTEST_HAS_CXX14          0
#endif

//! is c++11 compiler
#if !defined(IUTEST_HAS_CXX11)
#  if (defined(__cplusplus) && __cplusplus >= IUTEST_CPLUSPLUS_CXX11) || defined(__GXX_EXPERIMENTAL_CXX0X__)
#    define IUTEST_HAS_CXX11        1
#  elif (defined(_MSVC_LANG) && _MSVC_LANG >= IUTEST_CPLUSPLUS_CXX11)
#    define IUTEST_HAS_CXX11        1
#  endif
#endif

#if !defined(IUTEST_HAS_CXX11)
#  define IUTEST_HAS_CXX11          0
#endif



// c++17 features

//! inline variable
#if !defined(IUTEST_HAS_INLINE_VARIABLE)
#if defined(__clang__)
#  if IUTEST_HAS_CXX1Z && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 9))
#    define IUTEST_HAS_INLINE_VARIABLE      1
#  endif
#endif
#endif

#if !defined(IUTEST_HAS_INLINE_VARIABLE)
#  define IUTEST_HAS_INLINE_VARIABLE        0
#endif

//! constexpr if
#if !defined(IUTEST_HAS_CONSTEXPR_IF)
#  if   defined(__cpp_if_constexpr) && __cpp_if_constexpr >= 201606
#    define IUTEST_HAS_CONSTEXPR_IF         1
#  elif defined(_MSC_VER)
#    if _MSC_VER >= 1910 && IUTEST_HAS_CXX17
{'fraction_non_alphanumeric': 0.14959114959114958, 'fraction_numerical': 0.0367965367965368, 'mean_word_length': 3.104968739717012, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 36, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3729739', 'n_tokens_mistral': 5044, 'n_tokens_neox': 4620, 'n_words': 842}