<commit_before>/**
 * @file	Macro.h
 * @author	<NAME><<EMAIL>>
 * @date	2013/01/28
 * @version	1.0
 *
 * @brief LLBC library all basic macros define.
 */
#ifndef __LLBC_COM_MACRO_H__
#define __LLBC_COM_MACRO_H__

#include "llbc/common/PFConfig.h"

// The llbc namespace define.
#define LLBC_NAMESPACE ::llbc::
#define LLBC_NS        LLBC_NAMESPACE

// The llbc internal namespace  define.
#define LLBC_INTERNAL_NAMESPACE ::__llbc::
#define LLBC_INTERNAL_NS        LLBC_INTERNAL_NAMESPACE
#define LLBC_INL_NS             LLBC_INTERNAL_NAMESPACE

// llbc library namespace macros(begin/end) define.
#define __LLBC_NS_BEGIN \
    namespace llbc {    \

#define __LLBC_NS_END   \
    }                   \

// llbc library internal namespace macros(begin/end) define.
#define __LLBC_INTERNAL_NS_BEGIN \
    namespace __llbc {           \

#define __LLBC_INTERNAL_NS_END   \
    }                            \

// llbc library error describe buffer size.
#define __LLBC_ERROR_DESC_SIZE    2048

// Debug macro define.
#ifdef DEBUG
 #ifndef LLBC_DEBUG
  #define LLBC_DEBUG 1
 #endif
#else
 #ifdef LLBC_DEBUG
  #error "Defined LLBC_DEBUG macro, but DEBUG macro undefined!"
 #endif
#endif

// NDebug/Release macro define.
#ifndef LLBC_DEBUG
 #define LLBC_NDEBUG 1
 #define LLBC_RELEASE 1
#endif

// Exception throw macro define.
#define LLBC_THROW(e, s) throw e(s)

// The likely & unlikely builtin expect macro.
#ifdef __GNUC__
 #ifndef LIKELY
  #define LIKELY(x) __builtin_expect(!!(x), 1)
 #endif
 #ifndef UNLIKELY
  #define UNLIKELY(x) __builtin_expect(!!(x), 0)
 #endif
#else
 #ifndef LIKELY
  #define LIKELY(x) (x)
 #endif
 #ifndef UNLIKELY
  #define UNLIKELY(x) (x)
 #endif
#endif // __GNUC__

// Min / Max macro define.
#ifndef MIN
#define MIN(x, y)           \
    ((x) < (y) ? (x) : (y)) \

#endif

#ifndef MAX
#define MAX(x, y)           \
    ((x) > (y) ? (x) : (y)) \

#endif

// ISUNSIGNED macro define.
#define LLBC_ISUNSIGNED_TYPE(type)     ((type)(0 - 1) > 0)
#define LLBC_ISUNSIGNED_VAL(type, val) ((type)val >= 0 && (type)~a >= (type)0)

// Extern macro define.
#ifdef __cplusplus
 #define LLBC_INLINE     inline
 #define LLBC_EXTERN     extern
 #define LLBC_EXTERN_C   extern "C"
#else
 #define LLBC_INLINE     inline
 #define LLBC_EXTERN     extern
 #define LLBC_EXTERN_C   
#endif

// Extern "C" macro define.
#ifdef __cplusplus
 #define LLBC_BEGIN_C_DECL extern "C" {
 #define LLBC_END_C_DECL }
#else
 #define LLBC_BEGIN_C_DECL
 #define LLBC_END_C_DECL
#endif

// The hidden macro define.
#if LLBC_TARGET_PLATFORM_LINUX
 #ifndef LLBC_HIDDEN
  #define LLBC_HIDDEN
 #endif
#elif LLBC_TARGET_PLATFORM_WIN32
 #ifndef LLBC_HIDDEN
  #define LLBC_HIDDEN
 #endif
#elif LLBC_TARGET_PLATFORM_IPHONE
 #ifndef LLBC_HIDDEN
  #define LLBC_HIDDEN
 #endif
#elif LLBC_TARGET_PLATFORM_MAC
 #ifndef LLBC_HIDDEN
  #define LLBC_HIDDEN
 #endif
#elif LLBC_TARGET_PLATFORM_ANDROID
 #ifndef LLBC_HIDDEN
  #define LLBC_HIDDEN
 #endif
#endif

// The dllexport macro define.
#if LLBC_TARGET_PLATFORM_LINUX
 #ifndef LLBC_EXPORT
  #define LLBC_EXPORTING 0
  #define LLBC_EXPORT __attribute__ ((__visibility__("default")))
 #endif
#elif LLBC_TARGET_PLATFORM_WIN32
 #ifndef LLBC_EXPORT
  #define LLBC_EXPORTING 0
  #define LLBC_EXPORT __declspec(dllimport)
 #endif
#elif LLBC_TARGET_PLATFORM_IPHONE
 #ifndef LLBC_EXPORT
  #define LLBC_EXPORT __attribute__ ((__visibility__("default")))
 #endif
#elif LLBC_TARGET_PLATFORM_MAC
 #ifndef LLBC_EXPORT
  #define LLBC_EXPORTING 0
  #define LLBC_EXPORT __attribute__ ((__visibility__("default")))
 #endif
#elif LLBC_TARGET_PLATFORM_ANDROID
 #ifndef LLBC_EXPORT
  #define LLBC_EXPORTING 0
  #define LLBC_EXPORT __attribute__ ((__visibility__("default")))
 #endif
#endif

// ASSERT macro define.
#ifndef ASSERT
#define ASSERT(x) assert(x)
#endif

// Check we have a fully featured C++11 compiler or not?
#if !defined(_MSC_VER)
#if (__cplusplus > 197711L) || (defined(__STDCXX_VERSION__) && (__STDCXX_VERSION__ >= 201001L))
#define LLBC_CPP11
#endif
#endif
// ...at least partial C++11?
#if defined(LLBC_CPP11) && (defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(__GXX_EXPERIMENTAL_CPP0X__))
#define LLBC_CPP11_PARTICAL
#endif

// Disable assignments of objects.
#ifdef LLBC_CPP11_PARTICAL
#define LLBC_DISABLE_ASSIGNMENT(name)               \
private:                                            \<commit_msg>fix compile warning in MAC platform when enabled c++11 support<commit_after>/**
 * @file	Macro.h
 * @author	<NAME><<EMAIL>>
 * @date	2013/01/28
 * @version	1.0
 *
 * @brief LLBC library all basic macros define.
 */
#ifndef __LLBC_COM_MACRO_H__
#define __LLBC_COM_MACRO_H__

#include "llbc/common/PFConfig.h"

// The llbc namespace define.
#define LLBC_NAMESPACE ::llbc::
#define LLBC_NS        LLBC_NAMESPACE

// The llbc internal namespace  define.
#define LLBC_INTERNAL_NAMESPACE ::__llbc::
#define LLBC_INTERNAL_NS        LLBC_INTERNAL_NAMESPACE
#define LLBC_INL_NS             LLBC_INTERNAL_NAMESPACE

// llbc library namespace macros(begin/end) define.
#define __LLBC_NS_BEGIN \
    namespace llbc {    \

#define __LLBC_NS_END   \
    }                   \

// llbc library internal namespace macros(begin/end) define.
#define __LLBC_INTERNAL_NS_BEGIN \
    namespace __llbc {           \

#define __LLBC_INTERNAL_NS_END   \
    }                            \

// llbc library error describe buffer size.
#define __LLBC_ERROR_DESC_SIZE    2048

// Debug macro define.
#ifdef DEBUG
 #ifndef LLBC_DEBUG
  #define LLBC_DEBUG 1
 #endif
#else
 #ifdef LLBC_DEBUG
  #error "Defined LLBC_DEBUG macro, but DEBUG macro undefined!"
 #endif
#endif

// NDebug/Release macro define.
#ifndef LLBC_DEBUG
 #define LLBC_NDEBUG 1
 #define LLBC_RELEASE 1
#endif

// Exception throw macro define.
#define LLBC_THROW(e, s) throw e(s)

// The likely & unlikely builtin expect macro.
#ifdef __GNUC__
 #ifndef LIKELY
  #define LIKELY(x) __builtin_expect(!!(x), 1)
 #endif
 #ifndef UNLIKELY
  #define UNLIKELY(x) __builtin_expect(!!(x), 0)
 #endif
#else
 #ifndef LIKELY
  #define LIKELY(x) (x)
 #endif
 #ifndef UNLIKELY
  #define UNLIKELY(x) (x)
 #endif
#endif // __GNUC__

// Min / Max macro define.
#ifndef MIN
#define MIN(x, y)           \
    ((x) < (y) ? (x) : (y)) \

#endif

#ifndef MAX
#define MAX(x, y)           \
    ((x) > (y) ? (x) : (y)) \

#endif

// ISUNSIGNED macro define.
#define LLBC_ISUNSIGNED_TYPE(type)     ((type)(0 - 1) > 0)
#define LLBC_ISUNSIGNED_VAL(type, val) ((type)val >= 0 && (type)~a >= (type)0)

// Extern macro define.
#ifdef __cplusplus
 #define LLBC_INLINE     inline
 #define LLBC_EXTERN     extern
 #define LLBC_EXTERN_C   extern "C"
#else
 #define LLBC_INLINE     inline
 #define LLBC_EXTERN     extern
 #define LLBC_EXTERN_C   
#endif

// Extern "C" macro define.
#ifdef __cplusplus
 #define LLBC_BEGIN_C_DECL extern "C" {
 #define LLBC_END_C_DECL }
#else
 #define LLBC_BEGIN_C_DECL
 #define LLBC_END_C_DECL
#endif

// The hidden macro define.
#if LLBC_TARGET_PLATFORM_LINUX
 #ifndef LLBC_HIDDEN
  #define LLBC_HIDDEN
 #endif
#elif LLBC_TARGET_PLATFORM_WIN32
 #ifndef LLBC_HIDDEN
  #define LLBC_HIDDEN
 #endif
#elif LLBC_TARGET_PLATFORM_IPHONE
 #ifndef LLBC_HIDDEN
  #define LLBC_HIDDEN
 #endif
#elif LLBC_TARGET_PLATFORM_MAC
 #ifndef LLBC_HIDDEN
  #define LLBC_HIDDEN
 #endif
#elif LLBC_TARGET_PLATFORM_ANDROID
 #ifndef LLBC_HIDDEN
  #define LLBC_HIDDEN
 #endif
#endif

// The dllexport macro define.
#if LLBC_TARGET_PLATFORM_LINUX
 #ifndef LLBC_EXPORT
  #define LLBC_EXPORTING 0
  #define LLBC_EXPORT __attribute__ ((__visibility__("default")))
 #endif
#elif LLBC_TARGET_PLATFORM_WIN32
 #ifndef LLBC_EXPORT
  #define LLBC_EXPORTING 0
  #define LLBC_EXPORT __declspec(dllimport)
 #endif
#elif LLBC_TARGET_PLATFORM_IPHONE
 #ifndef LLBC_EXPORT
  #define LLBC_EXPORT __attribute__ ((__visibility__("default")))
 #endif
#elif LLBC_TARGET_PLATFORM_MAC
 #ifndef LLBC_EXPORT
  #define LLBC_EXPORTING 0
  #define LLBC_EXPORT __attribute__ ((__visibility__("default")))
 #endif
#elif LLBC_TARGET_PLATFORM_ANDROID
 #ifndef LLBC_EXPORT
  #define LLBC_EXPORTING 0
  #define LLBC_EXPORT __attribute__ ((__visibility__("default")))
 #endif
#endif

// ASSERT macro define.
#ifndef ASSERT
#define ASSERT(x) assert(x)
#endif

// Check we have a fully featured C++11 compiler or not?
#if !defined(_MSC_VER)
#if (__cplusplus > 197711L) || (defined(__STDCXX_VERSION__) && (__STDCXX_VERSION__ >= 201001L))
#define LLBC_CPP11
#endif
#endif
// ...at least partial C++11?
#if defined(LLBC_CPP11) && (defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(__GXX_EXPERIMENTAL_CPP0X__))
#define LLBC_CPP11_PARTICAL
#endif

// Define register keyword to empty n c++11(in c++11 standard, register is deprecated)
#ifdef LLBC_CPP11
#define register
#endif

// Disable assignments of objects.
#ifdef LLBC_CPP11_PARTICAL
#define LLBC_DISABLE_ASSIGNMENT(name)               \
private:                                            \
{'fraction_non_alphanumeric': 0.10001131349700193, 'fraction_numerical': 0.014028736282384885, 'mean_word_length': 3.9302844394868934, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1188744', 'n_tokens_mistral': 3413, 'n_tokens_neox': 3242, 'n_words': 814}