Micro template library A library for building device drivers
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

94 lignes
2.5 KiB

  1. /*!
  2. * \file /utl/core/version.h
  3. * \brief version and cpp version checks
  4. *
  5. * Copyright (C) 2018-2019 Christos Choutouridis
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU Lesser General Public License as
  9. * published by the Free Software Foundation, either version 3
  10. * of the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. *
  20. */
  21. #ifndef __utl_core_version_h__
  22. #define __utl_core_version_h__
  23. //!\defgroup version version
  24. //! Definitions of the utl version
  25. //!@{
  26. //! utl version
  27. #define UTL_VERSION "0.1.0"
  28. #define UTL_VERSION_MAJOR 0
  29. #define UTL_VERSION_MINOR 1
  30. #define UTL_VERSION_PATCH 0
  31. #define UTL_VERSION_VALUE ( (UTL_VERSION_MAJOR * 10000) \
  32. + (UTL_VERSION_MINOR * 100) \
  33. + UTL_VERSION_PATCH)
  34. //! C++ versions
  35. #define CXX_VER __cplusplus
  36. #define CXX_VER_STD_11 201103L
  37. #define CXX_VER_STD_14 201402L
  38. #define CXX_VER_STD_17 201703L
  39. //! Check for variable templates
  40. #ifndef CXX_VARIABLE_TEMPLATES
  41. #ifdef __cpp_variable_templates
  42. #define CXX_VARIABLE_TEMPLATES __cpp_variable_templates
  43. #else
  44. #define CXX_VARIABLE_TEMPLATES (CXX_VER >= CXX_VER_STD_14)
  45. #endif
  46. #endif
  47. //! Check concepts
  48. #ifndef CXX_CONCEPTS
  49. #ifdef __cpp_concepts
  50. #define CXX_CONCEPTS __cpp_concepts
  51. #else
  52. #define CXX_CONCEPTS 0
  53. #endif
  54. #endif
  55. //! Check for inline variables
  56. #ifndef CXX_INLINE_VARIABLES
  57. #ifdef __cpp_inline_variables
  58. #define CXX_INLINE_VARIABLES __cpp_inline_variables
  59. #else
  60. #define CXX_INLINE_VARIABLES (CXX_VER >= CXX_VER_STD_17)
  61. #endif
  62. #endif
  63. #ifndef CXX_FOLD_EXPRESSIONS
  64. #ifdef __cpp_fold_expressions
  65. #define CXX_FOLD_EXPRESSIONS __cpp_fold_expressions
  66. #else
  67. #define CXX_FOLD_EXPRESSIONS (CXX_VER >= CXX_VER_STD_17)
  68. #endif
  69. #endif
  70. /*
  71. * Workaround inspections
  72. */
  73. #if defined(__GNUC__) && (__GNUC__ < 5)
  74. // https://wg21.link/cwg1558
  75. #define UTL_WORKAROUND_CWG_1558
  76. #endif
  77. //! Base library requirement
  78. #if CXX_VER < CXX_VER_STD_14
  79. #error "uTL requires C++14"
  80. #endif
  81. //!@}
  82. #endif /* #ifndef __utl_core_version_h__ */