<commit_before>﻿/* -*- coding: utf-8; mode: c++; tab-width: 3; indent-tabs-mode: nil -*-

Copyright 2010, 2011, 2012, 2013, 2014
<NAME>

This file is part of Abaclade.

Abaclade is free software: you can redistribute it and/or modify it under the terms of the GNU
General Public License as published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

Abaclade is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.

You should have received a copy of the GNU General Public License along with Abaclade. If not, see
<http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------------------------------*/

#ifndef _ABACLADE_HXX
#define _ABACLADE_HXX
#define _ABACLADE_HXX_INTERNAL


////////////////////////////////////////////////////////////////////////////////////////////////////
// abc namespace hierarchy

//! Abaclade’s top-level namespace.
namespace abc {
   //! Bit manipulation functions.
   namespace bitmanip {}

   //! Byte-ordering functions.
   namespace byteorder {}

   //! I/O classes and functions.
   namespace io {
      //! Classes and functions to perform I/O in binary mode (raw bytes).
      namespace binary {}

      //! Classes and functions to perform I/O in text mode (with encoding support).
      namespace text {}
   } //namespace io

   //! Mathematical functions and algorithms.
   namespace math {}

   //! Memory management functions and classes. Mostly a templated approach to C’s mem* functions.
   namespace memory {}

   //! Type traits and functions for numeric types.
   namespace numeric {}

   //! Provides facilities to interact with the underlying OS.
   namespace os {}

   //! Support for performance tracking.
   namespace perf {}

   /*! abc::_std contains STL implementation bits from ABC_STLIMPL that we may want to use when
   ABC_STLIMPL is not defined, as Abaclade-only alternatives to lacking/buggy host STL
   implementations. */
   namespace _std {}

   //! Top-level namespace for Abaclade’s testing framework.
   namespace testing {}

   //! Contains classes and functions to work with text strings and characters.
   namespace text {}
} //namespace abc

////////////////////////////////////////////////////////////////////////////////////////////////////
// abc globals – ABC_HOST_*

//! Version of Clang if building with it, or 0 otherwise.
#define ABC_HOST_CLANG 0
//! Version of GCC if building with it, or 0 otherwise.
#define ABC_HOST_GCC 0
//! Version of MSC if building with it, or 0 otherwise.
#define ABC_HOST_MSC 0

#if defined(__clang__)
   #undef ABC_HOST_CLANG
   #define ABC_HOST_CLANG \
      (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
#elif defined(__GNUC__)
   #undef ABC_HOST_GCC
   #define ABC_HOST_GCC \
      (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
   #if ABC_HOST_GCC < 40400
      #error "Unsupported version of GCC: >= 4.4 required, 4.6 suggested"
   #endif
#elif defined(_MSC_VER)
   #undef ABC_HOST_MSC
   #define ABC_HOST_MSC _MSC_VER
   #if ABC_HOST_MSC < 1600
      #error "Unsupported version of MSC: >= MSC 16 / VC++ 10 / VS 2010 required"
   #endif
#endif

// Compatibility with compilers that don’t support feature checking.
#ifndef __has_feature
   #define __has_feature(x) \
      0
#endif

#if ABC_HOST_MSC
   // Suppress unnecessary warnings.

   // “enumerator 'name' in switch of enum 'type' is not explicitly handled by a case label
   #pragma warning(disable: 4061)
   // “enumerator 'name' in switch of enum 'type' is not handled”
   #pragma warning(disable: 4062)
   // “conditional expression is constant”
   #pragma warning(disable: 4127)
   // “'class' : inherits 'base::member' via dominance” – it points out the obvious and intended.
   #pragma warning(disable: 4250)
   // “'class1 member' : class 'template class2' needs to have dll-interface to be used by clients
   // of class 'class1'”
   #pragma warning(disable: 4251)
   // “'class' : class has virtual functions, but destructor is not virtual”
   #pragma warning(disable: 4265)
   // “C++ exception specification ignored except to indicate a function is not __declspec(nothrow)”
   #pragma warning(disable: 4290)
   // “cast truncates constant value” – would be useful, but it’s raised too easily by MSC16.
   #pragma warning(disable: 4310)
   // “'class' : default constructor could not be generated”
   #pragma warning(disable: 4510)
   // “'class' : assignment operator could not be generated”
   #pragma warning(disable: 4512)
   // “class 'class' can never be instantiated - user defined constructor required”
   #pragma warning(disable: 4610)
   // “'class' : copy constructor could not be generated because a base class copy constructor is
   // inaccessible”
   #pragma warning(disable: 4625)
   // “'class' : assignment operator could not be generated because a base class assignment operator
   // is inaccessible”
   #pragma warning(disable: 4626)
   // “throwing 'abc::_exception_aggregator<TAbc>' the following types will not be considered at the
   // catch site”
   #pragma warning(disable: 4673)
   // “potentially uninitialized local variable 'var' used” – would be useful, but it’s raised too
   // easily by MSC16.
   #pragma warning(disable: 4701)
   // “'function' : function not inlined”
   #pragma warning(disable: 4710)
   // “function 'function' selected for automatic inline expansion”
   #pragma warning(disable: 4711)
   // “'struct' : 'n' bytes padding added after data member 'member'”
   #pragma warning(disable: 4820)
#endif //if ABC_HOST_MSC

#define ABC_HOST_API_WIN32 0
#define ABC_HOST_API_WIN64 0
#define ABC_HOST_API_LINUX 0
#define ABC_HOST_API_POSIX 0

#if defined(_WIN32)
   // Compiling for Win32.
   #undef ABC_HOST_API_WIN32
   #define ABC_HOST_API_WIN32 1
   #ifdef _WIN64
      // Compiling for Win64 (coexists with ABC_HOST_API_WIN32).
      #undef ABC_HOST_API_WIN64
      #define ABC_HOST_API_WIN64 1
   #endif
#elif defined(__linux__)
   // Compiling for Linux.
   #undef ABC_HOST_API_LINUX
   #define ABC_HOST_API_LINUX 1
   #undef ABC_HOST_API_POSIX
   #define ABC_HOST_API_POSIX 1
#elif defined(__posix__)
   // Compiling for POSIX.<commit_msg>Detect building with OSX/iOS as target<commit_after>﻿/* -*- coding: utf-8; mode: c++; tab-width: 3; indent-tabs-mode: nil -*-

Copyright 2010, 2011, 2012, 2013, 2014
<NAME>

This file is part of Abaclade.

Abaclade is free software: you can redistribute it and/or modify it under the terms of the GNU
General Public License as published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

Abaclade is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.

You should have received a copy of the GNU General Public License along with Abaclade. If not, see
<http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------------------------------*/

#ifndef _ABACLADE_HXX
#define _ABACLADE_HXX
#define _ABACLADE_HXX_INTERNAL


////////////////////////////////////////////////////////////////////////////////////////////////////
// abc namespace hierarchy

//! Abaclade’s top-level namespace.
namespace abc {
   //! Bit manipulation functions.
   namespace bitmanip {}

   //! Byte-ordering functions.
   namespace byteorder {}

   //! I/O classes and functions.
   namespace io {
      //! Classes and functions to perform I/O in binary mode (raw bytes).
      namespace binary {}

      //! Classes and functions to perform I/O in text mode (with encoding support).
      namespace text {}
   } //namespace io

   //! Mathematical functions and algorithms.
   namespace math {}

   //! Memory management functions and classes. Mostly a templated approach to C’s mem* functions.
   namespace memory {}

   //! Type traits and functions for numeric types.
   namespace numeric {}

   //! Provides facilities to interact with the underlying OS.
   namespace os {}

   //! Support for performance tracking.
   namespace perf {}

   /*! abc::_std contains STL implementation bits from ABC_STLIMPL that we may want to use when
   ABC_STLIMPL is not defined, as Abaclade-only alternatives to lacking/buggy host STL
   implementations. */
   namespace _std {}

   //! Top-level namespace for Abaclade’s testing framework.
   namespace testing {}

   //! Contains classes and functions to work with text strings and characters.
   namespace text {}
} //namespace abc

////////////////////////////////////////////////////////////////////////////////////////////////////
// abc globals – ABC_HOST_*

//! Version of Clang if building with it, or 0 otherwise.
#define ABC_HOST_CLANG 0
//! Version of GCC if building with it, or 0 otherwise.
#define ABC_HOST_GCC 0
//! Version of MSC if building with it, or 0 otherwise.
#define ABC_HOST_MSC 0

#if defined(__clang__)
   #undef ABC_HOST_CLANG
   #define ABC_HOST_CLANG \
      (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
#elif defined(__GNUC__)
   #undef ABC_HOST_GCC
   #define ABC_HOST_GCC \
      (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
   #if ABC_HOST_GCC < 40400
      #error "Unsupported version of GCC: >= 4.4 required, 4.6 suggested"
   #endif
#elif defined(_MSC_VER)
   #undef ABC_HOST_MSC
   #define ABC_HOST_MSC _MSC_VER
   #if ABC_HOST_MSC < 1600
      #error "Unsupported version of MSC: >= MSC 16 / VC++ 10 / VS 2010 required"
   #endif
#endif

// Compatibility with compilers that don’t support feature checking.
#ifndef __has_feature
   #define __has_feature(x) \
      0
#endif

#if ABC_HOST_MSC
   // Suppress unnecessary warnings.

   // “enumerator 'name' in switch of enum 'type' is not explicitly handled by a case label
   #pragma warning(disable: 4061)
   // “enumerator 'name' in switch of enum 'type' is not handled”
   #pragma warning(disable: 4062)
   // “conditional expression is constant”
   #pragma warning(disable: 4127)
   // “'class' : inherits 'base::member' via dominance” – it points out the obvious and intended.
   #pragma warning(disable: 4250)
   // “'class1 member' : class 'template class2' needs to have dll-interface to be used by clients
   // of class 'class1'”
   #pragma warning(disable: 4251)
   // “'class' : class has virtual functions, but destructor is not virtual”
   #pragma warning(disable: 4265)
   // “C++ exception specification ignored except to indicate a function is not __declspec(nothrow)”
   #pragma warning(disable: 4290)
   // “cast truncates constant value” – would be useful, but it’s raised too easily by MSC16.
   #pragma warning(disable: 4310)
   // “'class' : default constructor could not be generated”
   #pragma warning(disable: 4510)
   // “'class' : assignment operator could not be generated”
   #pragma warning(disable: 4512)
   // “class 'class' can never be instantiated - user defined constructor required”
   #pragma warning(disable: 4610)
   // “'class' : copy constructor could not be generated because a base class copy constructor is
   // inaccessible”
   #pragma warning(disable: 4625)
   // “'class' : assignment operator could not be generated because a base class assignment operator
   // is inaccessible”
   #pragma warning(disable: 4626)
   // “throwing 'abc::_exception_aggregator<TAbc>' the following types will not be considered at the
   // catch site”
   #pragma warning(disable: 4673)
   // “potentially uninitialized local variable 'var' used” – would be useful, but it’s raised too
   // easily by MSC16.
   #pragma warning(disable: 4701)
   // “'function' : function not inlined”
   #pragma warning(disable: 4710)
   // “function 'function' selected for automatic inline expansion”
   #pragma warning(disable: 4711)
   // “'struct' : 'n' bytes padding added after data member 'member'”
   #pragma warning(disable: 4820)
#endif //if ABC_HOST_MSC

#define ABC_HOST_API_DARWIN 0
#define ABC_HOST_API_LINUX 0
#define ABC_HOST_API_POSIX 0
#define ABC_HOST_API_WIN32 0
#define ABC_HOST_API_WIN64 0

#if defined(_WIN32)
   // Compiling for Win32.
   #undef ABC_HOST_API_WIN32
   #define ABC_HOST_API_WIN32 1
   #ifdef _WIN64
      // Compiling for Win64 (coexists with ABC_HOST_API_WIN32).
      #undef ABC_HOST_API_WIN64
      #define ABC_HOST_API_WIN64 1
   #endif
#elif defined(__linux__)
   // Compiling for Linux.
   #undef ABC_HOST_API_LINUX
   #define ABC_HOST_API_LINUX 1
   #undef ABC_HOST_API_POSIX
   #define ABC_HOST_API_POSIX 1
#elif defined(__MACH__) && defined(__APPLE__)
   // Compiling for Darwin (OSX/iOS)
   #undef ABC_HOST_API_DARWIN
   #define ABC_HOST_API_DARWIN 1
   #undef ABC_HOST_API_POSIX
   #define ABC_HOST_API_POSIX 1
#elif defined(__posix__)
   // Compiling for POSIX.
{'fraction_non_alphanumeric': 0.1287995087503838, 'fraction_numerical': 0.02724900214921707, 'mean_word_length': 2.923215898825655, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '72989', 'n_tokens_mistral': 4048, 'n_tokens_neox': 3659, 'n_words': 1438}