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.

557 lines
23 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: atlstl/atlstl.hpp
  3. *
  4. * Purpose: Root header for the ATLSTL libraries. Performs various compiler
  5. * and platform discriminations, and definitions of types.
  6. *
  7. * Created: 15th January 2002
  8. * Updated: 2nd March 2012
  9. *
  10. * Home: http://stlsoft.org/
  11. *
  12. * Copyright (c) 2002-2012, Matthew Wilson and Synesis Software
  13. * All rights reserved.
  14. *
  15. * Redistribution and use in source and binary forms, with or without
  16. * modification, are permitted provided that the following conditions are met:
  17. *
  18. * - Redistributions of source code must retain the above copyright notice, this
  19. * list of conditions and the following disclaimer.
  20. * - Redistributions in binary form must reproduce the above copyright notice,
  21. * this list of conditions and the following disclaimer in the documentation
  22. * and/or other materials provided with the distribution.
  23. * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
  24. * any contributors may be used to endorse or promote products derived from
  25. * this software without specific prior written permission.
  26. *
  27. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  28. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  29. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  30. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  31. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  32. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  33. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  34. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  35. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  36. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  37. * POSSIBILITY OF SUCH DAMAGE.
  38. *
  39. * ////////////////////////////////////////////////////////////////////// */
  40. #ifndef ATLSTL_INCL_ATLSTL_HPP_ATLSTL
  41. #define ATLSTL_INCL_ATLSTL_HPP_ATLSTL
  42. #define ATLSTL_INCL_H_ATLSTL /* Define the old header include guard */
  43. /* File version */
  44. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  45. # define ATLSTL_VER_ATLSTL_HPP_ATLSTL_MAJOR 3
  46. # define ATLSTL_VER_ATLSTL_HPP_ATLSTL_MINOR 5
  47. # define ATLSTL_VER_ATLSTL_HPP_ATLSTL_REVISION 1
  48. # define ATLSTL_VER_ATLSTL_HPP_ATLSTL_EDIT 106
  49. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  50. /** \file atlstl/atlstl.hpp
  51. *
  52. * \brief [C++ only; requires ATL library] The root header for the \ref group__project__atlstl "ATLSTL" project.
  53. */
  54. /* /////////////////////////////////////////////////////////////////////////
  55. * ATLSTL version
  56. *
  57. * The libraries version information is comprised of major, minor and revision
  58. * components.
  59. *
  60. * The major version is denoted by the _ATLSTL_VER_MAJOR preprocessor symbol.
  61. * A changes to the major version component implies that a dramatic change has
  62. * occurred in the libraries, such that considerable changes to source dependent
  63. * on previous versions would need to be effected.
  64. *
  65. * The minor version is denoted by the _ATLSTL_VER_MINOR preprocessor symbol.
  66. * Changes to the minor version component imply that a significant change has
  67. * occurred to the libraries, either in the addition of new functionality or in
  68. * the destructive change to one or more components such that recomplilation and
  69. * code change may be necessitated.
  70. *
  71. * The revision version is denoted by the _ATLSTL_VER_REVISION preprocessor
  72. * symbol. Changes to the revision version component imply that a bug has been
  73. * fixed. Dependent code should be recompiled in order to pick up the changes.
  74. *
  75. * In addition to the individual version symbols - _ATLSTL_VER_MAJOR,
  76. * _ATLSTL_VER_MINOR and _ATLSTL_VER_REVISION - a composite symbol _ATLSTL_VER
  77. * is defined, where the upper 8 bits are 0, bits 16-23 represent the major
  78. * component, bits 8-15 represent the minor component, and bits 0-7 represent
  79. * the revision component.
  80. *
  81. * Each release of the libraries will bear a different version, and that version
  82. * will also have its own symbol: Version 1.0.1 specifies _ATLSTL_VER_1_0_1.
  83. *
  84. * Thus the symbol _ATLSTL_VER may be compared meaningfully with a specific
  85. * version symbol, e.g. #if _ATLSTL_VER >= _ATLSTL_VER_1_0_1
  86. */
  87. /** \def _ATLSTL_VER_MAJOR
  88. * The major version number of ATLSTL
  89. */
  90. /** \def _ATLSTL_VER_MINOR
  91. * The minor version number of ATLSTL
  92. */
  93. /** \def _ATLSTL_VER_REVISION
  94. * The revision version number of ATLSTL
  95. */
  96. /** \def _ATLSTL_VER
  97. * The current composite version number of ATLSTL
  98. */
  99. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  100. # define _ATLSTL_VER_1_0_1 0x00010001 /*!< Version 1.0.1 */
  101. # define _ATLSTL_VER_1_1_1 0x00010101 /*!< Version 1.1.1 */
  102. # define _ATLSTL_VER_1_2_1 0x00010201 /*!< Version 1.2.1 */
  103. # define _ATLSTL_VER_1_2_2 0x00010202 /*!< Version 1.2.2 */
  104. # define _ATLSTL_VER_1_2_3 0x00010203 /*!< Version 1.2.3 */
  105. # define _ATLSTL_VER_1_2_4 0x00010204 /*!< Version 1.2.4 */
  106. # define _ATLSTL_VER_1_2_5 0x00010205 /*!< Version 1.2.5 */
  107. # define _ATLSTL_VER_1_2_6 0x00010206 /*!< Version 1.2.6 */
  108. # define _ATLSTL_VER_1_2_7 0x00010207 /*!< Version 1.2.7 */
  109. # define _ATLSTL_VER_1_2_8 0x00010208 /*!< Version 1.2.8 */
  110. # define _ATLSTL_VER_1_3_1 0x00010301 /*!< Version 1.3.1 */
  111. # define _ATLSTL_VER_1_4_1 0x00010401 /*!< Version 1.4.1 */
  112. # define _ATLSTL_VER_1_4_2 0x00010402 /*!< Version 1.4.2 */
  113. # define _ATLSTL_VER_1_4_3 0x00010403 /*!< Version 1.4.3 */
  114. # define _ATLSTL_VER_1_4_4 0x00010404 /*!< Version 1.4.4 */
  115. # define _ATLSTL_VER_1_5_1 0x00010501 /*!< Version 1.5.1 */
  116. # define _ATLSTL_VER_1_5_2 0x00010502 /*!< Version 1.5.2 */
  117. # define _ATLSTL_VER_1_6_1 0x00010601 /*!< Version 1.6.1 (with STLSoft 1.9.1) */
  118. # define _ATLSTL_VER_1_6_2 0x00010602 /*!< Version 1.6.2 (with STLSoft 1.9.25) */
  119. # define _ATLSTL_VER_1_6_3 0x010603ff /*!< Version 1.6.3 (with STLSoft 1.9.113) */
  120. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  121. #define _ATLSTL_VER_MAJOR 1
  122. #define _ATLSTL_VER_MINOR 6
  123. #define _ATLSTL_VER_REVISION 3
  124. #define _ATLSTL_VER _ATLSTL_VER_1_6_3
  125. /* /////////////////////////////////////////////////////////////////////////
  126. * Includes
  127. */
  128. #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
  129. # include <stlsoft/stlsoft.h>
  130. #endif /* !STLSOFT_INCL_STLSOFT_H_STLSOFT */
  131. #if defined(STLSOFT_COMPILER_IS_BORLAND)
  132. # pragma warn -8013 /* Suppresses "Possible use of 'f' before definition in '. . .'" */
  133. # pragma warn -8084 /* Suppresses "Suggest parentheses to clarify precedence in function 'f()'" */
  134. #endif /* compiler */
  135. #ifndef STLSOFT_INCL_H_ATLBASE
  136. # define STLSOFT_INCL_H_ATLBASE
  137. # include <atlbase.h> // ATL base header
  138. #endif /* !STLSOFT_INCL_H_ATLBASE */
  139. #if defined(STLSOFT_COMPILER_IS_BORLAND)
  140. # pragma warn .8013 /* Suppresses "Possible use of 'f' before definition in '. . .'" */
  141. # pragma warn .8084 /* Suppresses "Suggest parentheses to clarify precedence in function 'f()'" */
  142. #endif /* compiler */
  143. #ifdef STLSOFT_UNITTEST
  144. extern CComModule _Module;
  145. # include <stdio.h>
  146. #endif /* STLSOFT_UNITTEST */
  147. /* /////////////////////////////////////////////////////////////////////////
  148. * STLSoft version compatibility
  149. */
  150. #if !defined(_STLSOFT_VER) || \
  151. _STLSOFT_VER < 0x010971ff
  152. # error This version of the ATLSTL libraries requires STLSoft version 1.9.113, or later
  153. #endif /* _STLSOFT_VER */
  154. /* /////////////////////////////////////////////////////////////////////////
  155. * Compiler compatibility
  156. *
  157. * Currently the only compilers supported by the ATLSTL libraries are
  158. *
  159. * Borland C++ 5.5, 5.51, 5.6
  160. * Digital Mars C/C++ 8.26 - 8.32
  161. * Metrowerks 2.4 & 3.0 (CodeWarrior 7.0 & 8.0)
  162. * Intel C/C++ 6.0
  163. * Visual C++ 4.2, 5.0, 6.0, 7.0
  164. */
  165. #if defined(STLSOFT_COMPILER_IS_BORLAND)
  166. /* Borland C++ */
  167. # if __BORLANDC__ < 0x0550
  168. # error Versions of Borland C++ prior to 5.5 are not supported by the ATLSTL libraries
  169. # endif /* __BORLANDC__ */
  170. #elif defined(STLSOFT_COMPILER_IS_DMC)
  171. /* Digital Mars C/C++ */
  172. # if __DMC__ < 0x0826
  173. # error Versions of Digital Mars C/C++ prior to 8.26 are not supported by the ATLSTL libraries
  174. # endif /* __DMC__ */
  175. #elif defined(STLSOFT_COMPILER_IS_INTEL)
  176. /* Intel C++ */
  177. # if (__INTEL_COMPILER < 600)
  178. # error Versions of Intel C++ prior to 6.0 are not supported by the ATLSTL libraries
  179. # endif /* __INTEL_COMPILER */
  180. #elif defined(STLSOFT_COMPILER_IS_MWERKS)
  181. /* Metrowerks C++ */
  182. # if (__MWERKS__ & 0xFF00) < 0x2400
  183. # error Versions of Metrowerks CodeWarrior C++ prior to 7.0 are not supported by the ATLSTL libraries
  184. # endif /* __MWERKS__ */
  185. #elif defined(STLSOFT_COMPILER_IS_MSVC)
  186. /* Visual C++ */
  187. # if _MSC_VER < 1100
  188. # error Versions of Visual C++ prior to 5.0 are not supported by the ATLSTL libraries
  189. # endif /* _MSC_VER */
  190. #else /* ? compiler */
  191. /* No recognised compiler */
  192. # ifdef _STLSOFT_FORCE_ANY_COMPILER
  193. # define _ATLSTL_COMPILER_IS_UNKNOWN
  194. # ifdef STLSOFT_COMPILE_VERBOSE
  195. # pragma message("Compiler is unknown to ATLSTL")
  196. # endif /* STLSOFT_COMPILE_VERBOSE */
  197. # else /* ? _STLSOFT_FORCE_ANY_COMPILER */
  198. # error Currently only Borland C++, Digital Mars C/C++, Intel C/C++, Metrowerks CodeWarrior and Visual C++ compilers are supported by the ATLSTL libraries
  199. # endif /* _STLSOFT_FORCE_ANY_COMPILER */
  200. #endif /* compiler */
  201. /* /////////////////////////////////////////////////////////////////////////
  202. * Contract Enforcement
  203. *
  204. * The macro atlstl_assert provides standard debug-mode assert functionality.
  205. */
  206. /** \brief Defines a runtime assertion
  207. *
  208. * \ingroup group__library__macros__assertion
  209. *
  210. * \param expr Must be non-zero, or an assertion will be fired
  211. */
  212. #define ATLSTL_ASSERT(expr) STLSOFT_ASSERT(expr)
  213. /** \brief Defines a runtime assertion, with message
  214. *
  215. * \ingroup group__library__macros__assertion
  216. *
  217. * \param expr Must be non-zero, or an assertion will be fired
  218. * \param msg The literal character string message to be included in the assertion
  219. */
  220. #define ATLSTL_MESSAGE_ASSERT(msg, expr) STLSOFT_MESSAGE_ASSERT(msg, expr)
  221. /** \brief Defines a compile-time assertion
  222. *
  223. * \ingroup group__library__macros__assertion
  224. *
  225. * \param expr Must be non-zero, or compilation will fail
  226. */
  227. #define ATLSTL_STATIC_ASSERT(expr) STLSOFT_STATIC_ASSERT(expr)
  228. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  229. # define atlstl_assert(expr) ATLSTL_ASSERT(expr)
  230. # define atlstl_message_assert(msg, expr) ATLSTL_MESSAGE_ASSERT(msg, expr)
  231. # define atlstl_static_assert(expr) ATLSTL_STATIC_ASSERT(expr)
  232. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  233. /* /////////////////////////////////////////////////////////////////////////
  234. * Namespace
  235. *
  236. * The ATLSTL components are contained within the atlstl namespace. This is
  237. * usually an alias for stlsoft::atlstl_project,
  238. *
  239. * When compilers support namespaces they are defined by default. They can be
  240. * undefined using a cascasing system, as follows:
  241. *
  242. * If _STLSOFT_NO_NAMESPACES is defined, then _ATLSTL_NO_NAMESPACES is defined.
  243. *
  244. * If _ATLSTL_NO_NAMESPACES is defined, then _ATLSTL_NO_NAMESPACE is defined.
  245. *
  246. * If _ATLSTL_NO_NAMESPACE is defined, then the ATLSTL constructs are defined
  247. * in the global scope.
  248. *
  249. * If _STLSOFT_NO_NAMESPACES, _ATLSTL_NO_NAMESPACES and _ATLSTL_NO_NAMESPACE are
  250. * all undefined but the symbol _STLSOFT_NO_NAMESPACE is defined (whence the
  251. * namespace stlsoft does not exist), then the ATLSTL constructs are defined
  252. * within the atlstl namespace. The definition matrix is as follows:
  253. *
  254. * _STLSOFT_NO_NAMESPACE _ATLSTL_NO_NAMESPACE atlstl definition
  255. * --------------------- -------------------- -----------------
  256. * not defined not defined = stlsoft::atlstl_project
  257. * not defined defined not defined
  258. * defined not defined atlstl
  259. * defined defined not defined
  260. *
  261. *
  262. *
  263. * The macro atlstl_ns_qual() macro can be used to refer to elements in the
  264. * ATLSTL libraries irrespective of whether they are in the
  265. * stlsoft::atlstl_project (or atlstl) namespace or in the global namespace.
  266. *
  267. * Furthermore, some compilers do not support the standard library in the std
  268. * namespace, so the atlstl_ns_qual_std() macro can be used to refer to elements
  269. * in the ATLSTL libraries irrespective of whether they are in the std namespace
  270. * or in the global namespace.
  271. *
  272. *
  273. * The ATL libraries themselves may or may not be defined within the ATL
  274. * namespace, so the atlstl_ns_qual_stl() macro can be used to refer to
  275. * elements in the ATLSTL libraries irrespective of whether they are in the std
  276. * namespace or in the global namespace.
  277. */
  278. /* No STLSoft namespaces means no ATLSTL namespaces */
  279. #ifdef _STLSOFT_NO_NAMESPACES
  280. # define _ATLSTL_NO_NAMESPACES
  281. #endif /* _STLSOFT_NO_NAMESPACES */
  282. /* No ATLSTL namespaces means no atlstl namespace */
  283. #ifdef _ATLSTL_NO_NAMESPACES
  284. # define _ATLSTL_NO_NAMESPACE
  285. #endif /* _ATLSTL_NO_NAMESPACES */
  286. #ifndef _ATLSTL_NO_NAMESPACE
  287. # if defined(_STLSOFT_NO_NAMESPACE) || \
  288. defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
  289. /* There is no stlsoft namespace, so must define ::atlstl */
  290. /** \brief The <code class="namespace">atlstl</code> namespace contains all components
  291. * in the \ref group__project__atlstl "ATLSTL" project.
  292. *
  293. * By default, the <code>atlstl</code> namespace is actually an alias for
  294. * the namespace <code>stlsoft::atlstl_project</code>, which is where all
  295. * the \ref group__project__atlstl "ATLSTL" components actually reside. This
  296. * measure allows all components within the main the
  297. * \ref group__project__stlsoft "STLSoft" project (which are defined within
  298. * the <code>stlsoft</code> namespace) to be visible to all components
  299. * "within" the <code>atlstl</code> namespace. (Otherwise, there would be a
  300. * whole lot of onerous qualification throughout the code of all
  301. * \ref group__projects "sub-projects".)
  302. *
  303. * \note If either/both of the symbols <code>_STLSOFT_NO_NAMESPACES</code>
  304. * and <code>_ATLSTL_NO_NAMESPACE</code> are defined, all
  305. * \ref group__project__atlstl "ATLSTL" components will be defined in the
  306. * global namespace. Conversely, if the <code>_STLSOFT_NO_NAMESPACE</code>
  307. * symbol (not to be confused with the
  308. * <code>_STLSOFT_NO_NAMESPACES</code> symbol!) is defined - meaning that
  309. * all \ref group__project__stlsoft "main project" components are to be
  310. * defined in the global namespace, and <code>_ATLSTL_NO_NAMESPACE</code>
  311. * is <b>not</b> defined, then all \ref group__project__atlstl "ATLSTL"
  312. * components will be defined within a bona fide <code>atlstl</code>
  313. * namespace.
  314. *
  315. * \note This is a vestige of compatibility with compilers with
  316. * no (or no sensible) namespace support that is maintained for reasons of
  317. * backwards compatiblity and because it is, in <i>rare circumstances</i>, a
  318. * useful facility.
  319. */
  320. namespace atlstl
  321. {
  322. # else
  323. /* Define stlsoft::atlstl_project */
  324. namespace stlsoft
  325. {
  326. namespace atlstl_project
  327. {
  328. # endif /* _STLSOFT_NO_NAMESPACE */
  329. #else
  330. stlsoft_ns_using(move_lhs_from_rhs)
  331. #endif /* !_ATLSTL_NO_NAMESPACE */
  332. /** \def atlstl_ns_qual(x)
  333. * Qualifies with <b>atlstl::</b> if ATLSTL is using namespaces or, if not, does not qualify
  334. */
  335. /** \def atlstl_ns_using(x)
  336. * Declares a using directive (with respect to <b>atlstl</b>) if ATLSTL is using namespaces or, if not, does nothing
  337. */
  338. #ifndef _ATLSTL_NO_NAMESPACE
  339. # define atlstl_ns_qual(x) ::atlstl::x
  340. # define atlstl_ns_using(x) using ::atlstl::x;
  341. #else /* ? _ATLSTL_NO_NAMESPACE */
  342. # define atlstl_ns_qual(x) x
  343. # define atlstl_ns_using(x)
  344. #endif /* !_ATLSTL_NO_NAMESPACE */
  345. /** \def atlstl_ns_qual_std(x)
  346. * Qualifies with <b>std::</b> if ATLSTL is being translated in the context of the standard library being within the <b>std</b> namespace or, if not, does not qualify
  347. */
  348. /** \def atlstl_ns_using_std(x)
  349. * Declares a using directive (with respect to <b>std</b>) if ATLSTL is being translated in the context of the standard library being within the <b>std</b> namespace or, if not, does nothing
  350. */
  351. #ifdef STLSOFT_CF_std_NAMESPACE
  352. # define atlstl_ns_qual_std(x) ::std::x
  353. # define atlstl_ns_using_std(x) using ::std::x;
  354. #else /* ? STLSOFT_CF_std_NAMESPACE */
  355. # define atlstl_ns_qual_std(x) x
  356. # define atlstl_ns_using_std(x)
  357. #endif /* !STLSOFT_CF_std_NAMESPACE */
  358. /** \def atlstl_ns_qual_atl(x)
  359. * Qualifies with <b>ATL::</b> if ATLSTL is being translated in the context of ATL being within the <b>ATL</b> namespace or, if not, does not qualify
  360. */
  361. /** \def atlstl_ns_using_atl(x)
  362. * Declares a using directive (with respect to <b>ATL</b>) if ATLSTL is being translated in the context of ATL being within the <b>ATL</b> namespace or, if not, does nothing
  363. */
  364. #ifndef ATL_NO_NAMESPACE
  365. # define atlstl_ns_qual_atl(x) ::ATL::x
  366. # define atlstl_ns_using_atl(x) using ::ATL::x;
  367. #else /* ? ATL_NO_NAMESPACE */
  368. # define atlstl_ns_qual_atl(x) x
  369. # define atlstl_ns_using_atl(x)
  370. #endif /* !ATL_NO_NAMESPACE */
  371. /* /////////////////////////////////////////////////////////////////////////
  372. * Typedefs
  373. *
  374. * The ATLSTL uses a number of typedefs to aid in compiler-independence in the
  375. * libraries' main code.
  376. */
  377. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  378. typedef stlsoft_ns_qual(ss_char_a_t) as_char_a_t; //!< Ansi char type
  379. typedef stlsoft_ns_qual(ss_char_w_t) as_char_w_t; //!< Unicode char type
  380. typedef stlsoft_ns_qual(ss_sint8_t) as_sint8_t; //!< 8-bit signed integer
  381. typedef stlsoft_ns_qual(ss_uint8_t) as_uint8_t; //!< 8-bit unsigned integer
  382. typedef stlsoft_ns_qual(ss_int16_t) as_int16_t; //!< 16-bit integer
  383. typedef stlsoft_ns_qual(ss_sint16_t) as_sint16_t; //!< 16-bit signed integer
  384. typedef stlsoft_ns_qual(ss_uint16_t) as_uint16_t; //!< 16-bit unsigned integer
  385. typedef stlsoft_ns_qual(ss_int32_t) as_int32_t; //!< 32-bit integer
  386. typedef stlsoft_ns_qual(ss_sint32_t) as_sint32_t; //!< 32-bit signed integer
  387. typedef stlsoft_ns_qual(ss_uint32_t) as_uint32_t; //!< 32-bit unsigned integer
  388. #ifdef STLSOFT_CF_64BIT_INT_SUPPORT
  389. typedef stlsoft_ns_qual(ss_int64_t) as_int64_t; //!< 64-bit integer
  390. typedef stlsoft_ns_qual(ss_sint64_t) as_sint64_t; //!< 64-bit signed integer
  391. typedef stlsoft_ns_qual(ss_uint64_t) as_uint64_t; //!< 64-bit unsigned integer
  392. #endif /* STLSOFT_CF_64BIT_INT_SUPPORT */
  393. typedef stlsoft_ns_qual(ss_int_t) as_int_t; //!< integer
  394. typedef stlsoft_ns_qual(ss_sint_t) as_sint_t; //!< signed integer
  395. typedef stlsoft_ns_qual(ss_uint_t) as_uint_t; //!< unsigned integer
  396. typedef stlsoft_ns_qual(ss_long_t) as_long_t; //!< long
  397. typedef stlsoft_ns_qual(ss_bool_t) as_bool_t; //!< bool
  398. typedef DWORD as_dword_t; //!< dword
  399. typedef stlsoft_ns_qual(ss_size_t) as_size_t; //!< size
  400. typedef stlsoft_ns_qual(ss_ptrdiff_t) as_ptrdiff_t; //!< ptr diff
  401. typedef stlsoft_ns_qual(ss_streampos_t) as_streampos_t; //!< streampos
  402. typedef stlsoft_ns_qual(ss_streamoff_t) as_streamoff_t; //!< streamoff
  403. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  404. /* /////////////////////////////////////////////////////////////////////////
  405. * Values
  406. *
  407. * Since the boolean type may not be supported natively on all compilers, the
  408. * values of true and false may also not be provided. Hence the values of
  409. * as_true_v and as_false_v are defined, and are used in all code.
  410. */
  411. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  412. #define as_true_v ss_true_v
  413. #define as_false_v ss_false_v
  414. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  415. /* /////////////////////////////////////////////////////////////////////////
  416. * Code modification macros
  417. */
  418. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  419. /* Exception signatures. */
  420. #define atlstl_throw_0() stlsoft_throw_0()
  421. #define atlstl_throw_1(x1) stlsoft_throw_1(x1)
  422. #define atlstl_throw_2(x1, x2) stlsoft_throw_2(x1, x2)
  423. #define atlstl_throw_3(x1, x2, x3) stlsoft_throw_3(x1, x2, x3)
  424. #define atlstl_throw_4(x1, x2, x3, x4) stlsoft_throw_4(x1, x2, x3, x4)
  425. #define atlstl_throw_5(x1, x2, x3, x4, x5) stlsoft_throw_5(x1, x2, x3, x4, x5)
  426. #define atlstl_throw_6(x1, x2, x3, x4, x5, x6) stlsoft_throw_6(x1, x2, x3, x4, x5, x6)
  427. #define atlstl_throw_7(x1, x2, x3, x4, x5, x6, x7) stlsoft_throw_7(x1, x2, x3, x4, x5, x6, x7)
  428. #define atlstl_throw_8(x1, x2, x3, x4, x5, x6, x7, x8) stlsoft_throw_8(x1, x2, x3, x4, x5, x6, x7, x8)
  429. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  430. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  431. # define ATLSTL_NUM_ELEMENTS(ar) STLSOFT_NUM_ELEMENTS(ar)
  432. # define atlstl_num_elements(ar) ATLSTL_NUM_ELEMENTS(ar)
  433. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  434. /** \brief [DEPRECATED] Destroys the given instance \c p of the given type (\c t and \c _type)
  435. *
  436. * \deprecated This is <b>heavily</b> deprecated in favour of \ref STLSOFT_DESTROY_INSTANCE().
  437. */
  438. #define atlstl_destroy_instance(t, _type, p) STLSOFT_DESTROY_INSTANCE(t, _type, p)
  439. /** \brief [DEPRECATED] Generates an opaque type with the name \c _htype
  440. *
  441. * \deprecated This is <b>heavily</b> deprecated in favour of \ref STLSOFT_GEN_OPAQUE().
  442. */
  443. #define atlstl_gen_opaque(_htype) STLSOFT_GEN_OPAQUE(_htype)
  444. /* /////////////////////////////////////////////////////////////////////////
  445. * Functions
  446. */
  447. /** This function is needed since there are ambiguities between COM headers and
  448. * ATL headers
  449. */
  450. #if _ATL_VER < 0x0700
  451. inline as_bool_t InlineIsEqualGUID(REFGUID rguid1, REFGUID rguid2)
  452. {
  453. return ( ((as_int32_t*) &rguid1)[0] == ((as_int32_t*) &rguid2)[0] &&
  454. ((as_int32_t*) &rguid1)[1] == ((as_int32_t*) &rguid2)[1] &&
  455. ((as_int32_t*) &rguid1)[2] == ((as_int32_t*) &rguid2)[2] &&
  456. ((as_int32_t*) &rguid1)[3] == ((as_int32_t*) &rguid2)[3]);
  457. }
  458. #endif /* _ATL_VER < 0x0700 */
  459. /* /////////////////////////////////////////////////////////////////////////
  460. * Unit-testing
  461. */
  462. #ifdef STLSOFT_UNITTEST
  463. # include "./unittest/atlstl_unittest_.h"
  464. #endif /* STLSOFT_UNITTEST */
  465. /* ////////////////////////////////////////////////////////////////////// */
  466. #ifndef _ATLSTL_NO_NAMESPACE
  467. # if defined(_STLSOFT_NO_NAMESPACE) || \
  468. defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
  469. } // namespace atlstl
  470. # else
  471. } // namespace atlstl_project
  472. } // namespace stlsoft
  473. namespace atlstl = ::stlsoft::atlstl_project;
  474. # endif /* _STLSOFT_NO_NAMESPACE */
  475. #endif /* !_ATLSTL_NO_NAMESPACE */
  476. /* /////////////////////////////////////////////////////////////////////////
  477. * Inclusion
  478. */
  479. #ifdef STLSOFT_CF_PRAGMA_ONCE_SUPPORT
  480. # pragma once
  481. #endif /* STLSOFT_CF_PRAGMA_ONCE_SUPPORT */
  482. /* ////////////////////////////////////////////////////////////////////// */
  483. #endif /* ATLSTL_INCL_ATLSTL_HPP_ATLSTL */
  484. /* ///////////////////////////// end of file //////////////////////////// */