/*!
 * \file   /utl/core/version.h
 * \brief  version and cpp version checks
 *
 * Copyright (C) 2018-2019 Christos Choutouridis
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 3
 * of the License, or (at your option) any later version.
 *
 * This program 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#ifndef __utl_core_version_h__
#define __utl_core_version_h__

//!\defgroup version version
//! Definitions of the utl version
//!@{

//! utl version
#define UTL_VERSION       "0.1.0"
#define UTL_VERSION_MAJOR  0
#define UTL_VERSION_MINOR  1
#define UTL_VERSION_PATCH  0
#define UTL_VERSION_VALUE ( (UTL_VERSION_MAJOR * 10000) \
                          + (UTL_VERSION_MINOR * 100)   \
                          + UTL_VERSION_PATCH)

//! C++ versions
#define CXX_VER            __cplusplus
#define CXX_VER_STD_11     201103L
#define CXX_VER_STD_14     201402L
#define CXX_VER_STD_17     201703L

//! Check for variable templates
#ifndef CXX_VARIABLE_TEMPLATES
 #ifdef  __cpp_variable_templates
  #define CXX_VARIABLE_TEMPLATES __cpp_variable_templates
 #else
  #define CXX_VARIABLE_TEMPLATES (CXX_VER >= CXX_VER_STD_14)
 #endif
#endif

//! Check concepts
#ifndef CXX_CONCEPTS
 #ifdef __cpp_concepts
  #define CXX_CONCEPTS __cpp_concepts
 #else
  #define CXX_CONCEPTS 0
 #endif
#endif

//! Check for inline variables
#ifndef CXX_INLINE_VARIABLES
 #ifdef __cpp_inline_variables
  #define CXX_INLINE_VARIABLES __cpp_inline_variables
 #else
  #define CXX_INLINE_VARIABLES (CXX_VER >= CXX_VER_STD_17)
 #endif
#endif

#ifndef CXX_FOLD_EXPRESSIONS
 #ifdef __cpp_fold_expressions
  #define CXX_FOLD_EXPRESSIONS __cpp_fold_expressions
 #else
  #define CXX_FOLD_EXPRESSIONS (CXX_VER >= CXX_VER_STD_17)
 #endif
#endif

/*
 * Workaround inspections
 */
#if defined(__GNUC__) && (__GNUC__ < 5)
 // https://wg21.link/cwg1558
 #define UTL_WORKAROUND_CWG_1558
#endif


//! Base library requirement
#if CXX_VER < CXX_VER_STD_14
#error "uTL requires C++14"
#endif

//!@}
#endif /* #ifndef __utl_core_version_h__ */
