You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

272 lines
9.8 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: rangelib/rangelib.hpp
  3. *
  4. * Purpose: Root header for the STLSoft implementation of RangeLib.
  5. *
  6. * Created: 12th October 2004
  7. * Updated: 2nd March 2012
  8. *
  9. * Home: http://stlsoft.org/
  10. *
  11. * Copyright (c) 2004-2012, Matthew Wilson and Synesis Software
  12. * All rights reserved.
  13. *
  14. * Redistribution and use in source and binary forms, with or without
  15. * modification, are permitted provided that the following conditions are met:
  16. *
  17. * - Redistributions of source code must retain the above copyright notice, this
  18. * list of conditions and the following disclaimer.
  19. * - Redistributions in binary form must reproduce the above copyright notice,
  20. * this list of conditions and the following disclaimer in the documentation
  21. * and/or other materials provided with the distribution.
  22. * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
  23. * any contributors may be used to endorse or promote products derived from
  24. * this software without specific prior written permission.
  25. *
  26. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  27. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  28. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  29. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  30. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  31. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  32. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  33. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  34. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  35. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  36. * POSSIBILITY OF SUCH DAMAGE.
  37. *
  38. * ////////////////////////////////////////////////////////////////////// */
  39. #ifndef RANGELIB_INCL_RANGELIB_HPP_RANGELIB
  40. #define RANGELIB_INCL_RANGELIB_HPP_RANGELIB
  41. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  42. # define RANGELIB_VER_RANGELIB_HPP_RANGELIB_MAJOR 1
  43. # define RANGELIB_VER_RANGELIB_HPP_RANGELIB_MINOR 4
  44. # define RANGELIB_VER_RANGELIB_HPP_RANGELIB_REVISION 1
  45. # define RANGELIB_VER_RANGELIB_HPP_RANGELIB_EDIT 29
  46. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  47. /** \file rangelib/rangelib.hpp
  48. *
  49. * \brief [C++ only] The root header for the \ref group__project__rangelib "RangeLib" project.
  50. */
  51. /* /////////////////////////////////////////////////////////////////////////
  52. * RangeLib version
  53. *
  54. * The libraries version information is comprised of major, minor and revision
  55. * components.
  56. *
  57. * The major version is denoted by the _RANGELIB_VER_MAJOR preprocessor symbol.
  58. * A changes to the major version component implies that a dramatic change has
  59. * occurred in the libraries, such that considerable changes to source dependent
  60. * on previous versions would need to be effected.
  61. *
  62. * The minor version is denoted by the _RANGELIB_VER_MINOR preprocessor symbol.
  63. * Changes to the minor version component imply that a significant change has
  64. * occurred to the libraries, either in the addition of new functionality or in
  65. * the destructive change to one or more components such that recomplilation and
  66. * code change may be necessitated.
  67. *
  68. * The revision version is denoted by the _RANGELIB_VER_REVISION preprocessor
  69. * symbol. Changes to the revision version component imply that a bug has been
  70. * fixed. Dependent code should be recompiled in order to pick up the changes.
  71. *
  72. * In addition to the individual version symbols - _RANGELIB_VER_MAJOR,
  73. * _RANGELIB_VER_MINOR and _RANGELIB_VER_REVISION - a composite symbol _RANGELIB_VER
  74. * is defined, where the upper 8 bits are 0, bits 16-23 represent the major
  75. * component, bits 8-15 represent the minor component, and bits 0-7 represent
  76. * the revision component.
  77. *
  78. * Each release of the libraries will bear a different version, and that version
  79. * will also have its own symbol: Version 1.0.1 specifies _RANGELIB_VER_1_0_1.
  80. *
  81. * Thus the symbol _RANGELIB_VER may be compared meaningfully with a specific
  82. * version symbol, e.g. #if _RANGELIB_VER >= _RANGELIB_VER_1_0_1
  83. */
  84. /** \brief \def _RANGELIB_VER_MAJOR
  85. * The major version number of RangeLib
  86. *
  87. * \ingroup group__library__rangelib
  88. */
  89. /** \brief \def _RANGELIB_VER_MINOR
  90. * The minor version number of RangeLib
  91. *
  92. * \ingroup group__library__rangelib
  93. */
  94. /** \brief \def _RANGELIB_VER_REVISION
  95. * The revision version number of RangeLib
  96. *
  97. * \ingroup group__library__rangelib
  98. */
  99. /** \brief \def _RANGELIB_VER
  100. * The current composite version number of RangeLib
  101. *
  102. * \ingroup group__library__rangelib
  103. */
  104. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  105. # define _RANGELIB_VER_1_0_1 0x00010001 /*!< Version 1.0.1 */
  106. # define _RANGELIB_VER_1_0_2 0x00010002 /*!< Version 1.0.2 */
  107. # define _RANGELIB_VER_1_0_3 0x00010003 /*!< Version 1.0.3 */
  108. # define _RANGELIB_VER_1_0_4 0x00010004 /*!< Version 1.0.4 */
  109. # define _RANGELIB_VER_1_1_1 0x00010101 /*!< Version 1.1.1 (with STLSoft 1.9.1) */
  110. # define _RANGELIB_VER_1_1_2 0x00010102 /*!< Version 1.1.2 (with STLSoft 1.9.25) */
  111. # define _RANGELIB_VER_1_1_3 0x010103ff /*!< Version 1.1.3 (with STLSoft 1.9.113) */
  112. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  113. #define _RANGELIB_VER_MAJOR 1
  114. #define _RANGELIB_VER_MINOR 1
  115. #define _RANGELIB_VER_REVISION 3
  116. #define _RANGELIB_VER _RANGELIB_VER_1_1_3
  117. /* /////////////////////////////////////////////////////////////////////////
  118. * Auto-generation and compatibility
  119. */
  120. /*
  121. [Incompatibilies-start]
  122. STLSOFT_COMPILER_IS_MSVC: _MSC_VER < 1200
  123. [Incompatibilies-end]
  124. */
  125. /* /////////////////////////////////////////////////////////////////////////
  126. * Includes
  127. */
  128. #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
  129. # include <stlsoft/stlsoft.h>
  130. #endif /* !STLSOFT_INCL_STLSOFT_H_STLSOFT */
  131. /* /////////////////////////////////////////////////////////////////////////
  132. * STLSoft version compatibility
  133. */
  134. #if !defined(_STLSOFT_VER) || \
  135. _STLSOFT_VER < 0x010971ff
  136. # error RangeLib is only compatible with STLSoft version 1.9.113, or later
  137. #endif /* _STLSOFT_VER */
  138. /* /////////////////////////////////////////////////////////////////////////
  139. * Compiler compatibility
  140. *
  141. * Currently the only compilers supported by the RangeLib libraries are
  142. *
  143. * Borland C++ 5.6+
  144. * Comeau 4.3.3+
  145. * Digital Mars C/C++ 8.42+
  146. * Metrowerks 3.0+ (CodeWarrior 8.0+)
  147. * Intel C/C++ 8.0+
  148. * Visual C++ 6.0+
  149. */
  150. #if defined(STLSOFT_COMPILER_IS_BORLAND)
  151. /* Borland C++ */
  152. # if __BORLANDC__ < 0x0560
  153. # error Versions of Borland C++ prior to 5.6 are not supported by the RangeLib libraries
  154. # elif __BORLANDC__ <= 0x0564
  155. # if defined(STLSOFT_COMPILE_VERBOSE)
  156. # pragma message("RangeLib is only partially supported on Borland C/C++ versions 5.6 and 5.6.4")
  157. # endif /* STLSOFT_COMPILE_VERBOSE */
  158. # endif /* __BORLANDC__ */
  159. #elif defined(STLSOFT_COMPILER_IS_COMO)
  160. /* Comeau C++ */
  161. # if __COMO_VERSION__ < 4303
  162. # error Versions of Comeau C++ prior to 4.3.3 are not supported by the RangeLib libraries
  163. # endif /* __DMC__ */
  164. #elif defined(STLSOFT_COMPILER_IS_DMC)
  165. /* Digital Mars C/C++ */
  166. # if __DMC__ < 0x0842
  167. # error Versions of Digital Mars C/C++ prior to 8.42 are not supported by the RangeLib libraries
  168. # endif /* __DMC__ */
  169. #elif defined(STLSOFT_COMPILER_IS_GCC)
  170. /* Digital Mars C/C++ */
  171. # if __GNUC__ < 3 || \
  172. ( __GNUC__ == 3 && \
  173. __GNUC_MINOR__ < 2)
  174. # error Versions of GCC prior to 3.2 are not supported by the RangeLib libraries
  175. # endif /* __DMC__ */
  176. #elif defined(STLSOFT_COMPILER_IS_INTEL)
  177. /* Intel C++ */
  178. # if (__INTEL_COMPILER < 700)
  179. # error Versions of Intel C++ prior to 7.0 are not supported by the RangeLib libraries
  180. # endif /* __INTEL_COMPILER */
  181. #elif defined(STLSOFT_COMPILER_IS_MWERKS)
  182. /* Metrowerks C++ */
  183. # if (__MWERKS__ & 0xFF00) < 0x3000
  184. # error Versions of Metrowerks CodeWarrior C++ prior to 8.x are not supported by the RangeLib libraries
  185. # endif /* __MWERKS__ */
  186. #elif defined(STLSOFT_COMPILER_IS_MSVC)
  187. /* Visual C++ */
  188. # if _MSC_VER < 1200
  189. # error Versions of Visual C++ prior to 5.0 are not supported by the RangeLib libraries
  190. # elif _MSC_VER < 1310
  191. # if defined(STLSOFT_COMPILE_VERBOSE)
  192. # pragma message("RangeLib is only partially supported on Visual C++ versions 6.0 and 7.0")
  193. # endif /* STLSOFT_COMPILE_VERBOSE */
  194. # endif /* _MSC_VER */
  195. #else /* ? compiler */
  196. /* No recognised compiler */
  197. # ifdef _STLSOFT_FORCE_ANY_COMPILER
  198. # define _RANGELIB_COMPILER_IS_UNKNOWN
  199. # ifdef STLSOFT_COMPILE_VERBOSE
  200. # pragma message("Compiler is unknown to RangeLib")
  201. # endif /* STLSOFT_COMPILE_VERBOSE */
  202. # else /* ? _STLSOFT_FORCE_ANY_COMPILER */
  203. # error Currently only Borland C++, Digital Mars C/C++, Intel C/C++, Metrowerks CodeWarrior and Visual C++ compilers are supported by the RangeLib libraries
  204. # endif /* _STLSOFT_FORCE_ANY_COMPILER */
  205. #endif /* compiler */
  206. /* /////////////////////////////////////////////////////////////////////////
  207. * Namespace
  208. */
  209. #ifndef RANGELIB_NO_NAMESPACE
  210. # if defined(_STLSOFT_NO_NAMESPACE) || \
  211. defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
  212. /* There is no stlsoft namespace, so must define ::rangelib */
  213. namespace rangelib
  214. {
  215. # else
  216. /* Define stlsoft::rangelib_project */
  217. namespace stlsoft
  218. {
  219. namespace rangelib_project
  220. {
  221. # endif /* _STLSOFT_NO_NAMESPACE */
  222. #endif /* !RANGELIB_NO_NAMESPACE */
  223. /* ////////////////////////////////////////////////////////////////////// */
  224. #ifndef RANGELIB_NO_NAMESPACE
  225. # if defined(_STLSOFT_NO_NAMESPACE) || \
  226. defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
  227. } // namespace rangelib
  228. # else
  229. } // namespace rangelib_project
  230. } // namespace stlsoft
  231. namespace rangelib = ::stlsoft::rangelib_project;
  232. # endif /* _STLSOFT_NO_NAMESPACE */
  233. #endif /* !RANGELIB_NO_NAMESPACE */
  234. /* ////////////////////////////////////////////////////////////////////// */
  235. #endif /* !RANGELIB_INCL_RANGELIB_HPP_RANGELIB */
  236. /* ///////////////////////////// end of file //////////////////////////// */