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.

163 lines
5.9 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: platformstl/synch/tss_index.hpp
  3. *
  4. * Purpose: Definition of the tss_index type.
  5. *
  6. * Created: 20th March 2005
  7. * Updated: 10th August 2009
  8. *
  9. * Home: http://stlsoft.org/
  10. *
  11. * Copyright (c) 2005-2009, 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 PLATFORMSTL_INCL_PLATFORMSTL_SYNCH_HPP_TSS_INDEX
  40. #define PLATFORMSTL_INCL_PLATFORMSTL_SYNCH_HPP_TSS_INDEX
  41. /* File version */
  42. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  43. # define PLATFORMSTL_VER_PLATFORMSTL_SYNCH_HPP_TSS_INDEX_MAJOR 2
  44. # define PLATFORMSTL_VER_PLATFORMSTL_SYNCH_HPP_TSS_INDEX_MINOR 1
  45. # define PLATFORMSTL_VER_PLATFORMSTL_SYNCH_HPP_TSS_INDEX_REVISION 1
  46. # define PLATFORMSTL_VER_PLATFORMSTL_SYNCH_HPP_TSS_INDEX_EDIT 18
  47. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  48. /** \file platformstl/synch/tss_index.hpp
  49. *
  50. * \brief [C++ only] Definition of the platformstl::tss_index type
  51. * (\ref group__library__synch "Synchronisation" Library).
  52. */
  53. /* /////////////////////////////////////////////////////////////////////////
  54. * Includes
  55. */
  56. #ifndef PLATFORMSTL_INCL_PLATFORMSTL_HPP_PLATFORMSTL
  57. # include <platformstl/platformstl.hpp>
  58. #endif /* !PLATFORMSTL_INCL_PLATFORMSTL_HPP_PLATFORMSTL */
  59. #if defined(PLATFORMSTL_OS_IS_UNIX)
  60. # ifndef UNIXSTL_INCL_UNIXSTL_HPP_TSS_INDEX
  61. # include <unixstl/synch/tss_index.hpp>
  62. # endif /* !UNIXSTL_INCL_UNIXSTL_HPP_TSS_INDEX */
  63. #elif defined(PLATFORMSTL_OS_IS_WINDOWS)
  64. # ifndef WINSTL_INCL_WINSTL_SYNCH_HPP_TSS_INDEX
  65. # include <winstl/synch/tss_index.hpp>
  66. # endif /* !WINSTL_INCL_WINSTL_SYNCH_HPP_TSS_INDEX */
  67. #else /* ? operating system */
  68. # error Operating system not discriminated
  69. #endif /* operating system */
  70. /* /////////////////////////////////////////////////////////////////////////
  71. * Namespace
  72. */
  73. #if defined(_STLSOFT_NO_NAMESPACE) || \
  74. defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
  75. /* There is no stlsoft namespace, so must define ::platformstl */
  76. namespace platformstl
  77. {
  78. #else
  79. /* Define stlsoft::platformstl_project */
  80. namespace stlsoft
  81. {
  82. namespace platformstl_project
  83. {
  84. #endif /* _STLSOFT_NO_NAMESPACE */
  85. /* ////////////////////////////////////////////////////////////////////// */
  86. #if defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
  87. /** \brief A thread key class
  88. *
  89. * The class is not actually defined in the
  90. * \link ::platformstl platformstl\endlink namespace. Rather, it
  91. * resolves to the appropriate type for the given platform, relying on
  92. * \ref section__principle__conformance__intersecting_conformance "Intersecting Conformance"
  93. * of the resolved platform-specific types.
  94. *
  95. * When compiling on UNIX platforms, the platformstl::tss_index
  96. * type resolves to the unixstl::tss_index class. On Windows platforms
  97. * it resolves to the winstl::tss_index class. It is not defined
  98. * for other platforms.
  99. */
  100. class tss_index
  101. {};
  102. #elif defined(PLATFORMSTL_OS_IS_UNIX)
  103. # ifdef _UNIXSTL_NO_NAMESPACE
  104. using ::tss_index;
  105. # ifdef STLSOFT_CF_EXCEPTION_SUPPORT
  106. using ::tss_exception;
  107. # endif /* STLSOFT_CF_EXCEPTION_SUPPORT */
  108. # else /* ? _UNIXSTL_NO_NAMESPACE */
  109. using ::unixstl::tss_index;
  110. # ifdef STLSOFT_CF_EXCEPTION_SUPPORT
  111. using ::unixstl::tss_exception;
  112. # endif /* STLSOFT_CF_EXCEPTION_SUPPORT */
  113. # endif /* _UNIXSTL_NO_NAMESPACE */
  114. #elif defined(PLATFORMSTL_OS_IS_WINDOWS)
  115. # ifdef _WINSTL_NO_NAMESPACE
  116. using ::tss_index;
  117. # ifdef STLSOFT_CF_EXCEPTION_SUPPORT
  118. using ::tss_exception;
  119. # endif /* STLSOFT_CF_EXCEPTION_SUPPORT */
  120. # else /* ? _WINSTL_NO_NAMESPACE */
  121. using ::winstl::tss_index;
  122. # ifdef STLSOFT_CF_EXCEPTION_SUPPORT
  123. using ::winstl::tss_exception;
  124. # endif /* STLSOFT_CF_EXCEPTION_SUPPORT */
  125. # endif /* _WINSTL_NO_NAMESPACE */
  126. #else /* ? operating system */
  127. # error Operating system not discriminated
  128. #endif /* operating system */
  129. /* ////////////////////////////////////////////////////////////////////// */
  130. #if defined(_STLSOFT_NO_NAMESPACE) || \
  131. defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
  132. } // namespace platformstl
  133. #else
  134. } // namespace platformstl_project
  135. } // namespace stlsoft
  136. #endif /* _STLSOFT_NO_NAMESPACE */
  137. /* ////////////////////////////////////////////////////////////////////// */
  138. #endif /* !PLATFORMSTL_INCL_PLATFORMSTL_SYNCH_HPP_TSS_INDEX */
  139. /* ///////////////////////////// end of file //////////////////////////// */