00001 /* ///////////////////////////////////////////////////////////////////////// 00002 * File: platformstl/synch/atomic_types.h 00003 * 00004 * Purpose: Definition of the atomic types. 00005 * 00006 * Created: 22nd March 2005 00007 * Updated: 7th June 2010 00008 * 00009 * Home: http://stlsoft.org/ 00010 * 00011 * Copyright (c) 2005-2010, Matthew Wilson and Synesis Software 00012 * All rights reserved. 00013 * 00014 * Redistribution and use in source and binary forms, with or without 00015 * modification, are permitted provided that the following conditions are met: 00016 * 00017 * - Redistributions of source code must retain the above copyright notice, this 00018 * list of conditions and the following disclaimer. 00019 * - Redistributions in binary form must reproduce the above copyright notice, 00020 * this list of conditions and the following disclaimer in the documentation 00021 * and/or other materials provided with the distribution. 00022 * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of 00023 * any contributors may be used to endorse or promote products derived from 00024 * this software without specific prior written permission. 00025 * 00026 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00027 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00028 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00029 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00030 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00031 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00032 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00033 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00034 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00035 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00036 * POSSIBILITY OF SUCH DAMAGE. 00037 * 00038 * ////////////////////////////////////////////////////////////////////// */ 00039 00040 00047 #ifndef PLATFORMSTL_INCL_PLATFORMSTL_SYNCH_H_ATOMIC_TYPES 00048 #define PLATFORMSTL_INCL_PLATFORMSTL_SYNCH_H_ATOMIC_TYPES 00049 00050 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION 00051 # define PLATFORMSTL_VER_PLATFORMSTL_SYNCH_H_ATOMIC_TYPES_MAJOR 3 00052 # define PLATFORMSTL_VER_PLATFORMSTL_SYNCH_H_ATOMIC_TYPES_MINOR 0 00053 # define PLATFORMSTL_VER_PLATFORMSTL_SYNCH_H_ATOMIC_TYPES_REVISION 2 00054 # define PLATFORMSTL_VER_PLATFORMSTL_SYNCH_H_ATOMIC_TYPES_EDIT 28 00055 #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */ 00056 00057 /* ///////////////////////////////////////////////////////////////////////// 00058 * Compatibility 00059 */ 00060 00061 /* 00062 [<[STLSOFT-AUTO:NO-UNITTEST]>] 00063 [Incompatibilies-start] 00064 [Incompatibilies-end] 00065 */ 00066 00067 /* ///////////////////////////////////////////////////////////////////////// 00068 * Includes 00069 */ 00070 00071 #ifndef PLATFORMSTL_INCL_PLATFORMSTL_H_PLATFORMSTL 00072 # include <platformstl/platformstl.h> 00073 #endif /* !PLATFORMSTL_INCL_PLATFORMSTL_H_PLATFORMSTL */ 00074 00075 #if defined(PLATFORMSTL_OS_IS_UNIX) 00076 # ifndef UNIXSTL_INCL_UNIXSTL_SYNCH_H_ATOMIC_TYPES 00077 # include <unixstl/synch/atomic_types.h> 00078 # endif /* !UNIXSTL_INCL_UNIXSTL_SYNCH_H_ATOMIC_TYPES */ 00079 #elif defined(PLATFORMSTL_OS_IS_WINDOWS) 00080 # ifndef WINSTL_INCL_WINSTL_SYNCH_H_ATOMIC_TYPES 00081 # include <winstl/synch/atomic_types.h> 00082 # endif /* !WINSTL_INCL_WINSTL_SYNCH_H_ATOMIC_TYPES */ 00083 #else /* ? operating system */ 00084 # error Operating system not discriminated 00085 #endif /* operating system */ 00086 00087 /* ///////////////////////////////////////////////////////////////////////// 00088 * Namespace 00089 */ 00090 00091 #if !defined(__cplusplus) 00092 /* Nothing defined in C */ 00093 #elif defined(_STLSOFT_NO_NAMESPACE) || \ 00094 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION) 00095 /* There is no stlsoft namespace, so must define ::platformstl */ 00096 namespace platformstl 00097 { 00098 #else 00099 /* Define stlsoft::platformstl_project */ 00100 00101 namespace stlsoft 00102 { 00103 00104 namespace platformstl_project 00105 { 00106 #endif /* _STLSOFT_NO_NAMESPACE */ 00107 00108 /* ////////////////////////////////////////////////////////////////////// */ 00109 00110 #if defined(__cplusplus) 00111 00112 # ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION 00113 namespace implementation 00114 { 00115 # endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */ 00116 # if defined(PLATFORMSTL_OS_IS_UNIX) 00117 00118 # ifndef PLATFORSL_DEFINED_platform_stl_ 00119 # define PLATFORSL_DEFINED_platform_stl_ 00120 namespace platform_stl_ = ::unixstl; 00121 # endif /* !PLATFORSL_DEFINED_platform_stl_ */ 00122 00123 # elif defined(PLATFORMSTL_OS_IS_WINDOWS) 00124 00125 # ifndef PLATFORSL_DEFINED_platform_stl_ 00126 # define PLATFORSL_DEFINED_platform_stl_ 00127 namespace platform_stl_ = ::winstl; 00128 # endif /* !PLATFORSL_DEFINED_platform_stl_ */ 00129 00130 # else /* ? operating system */ 00131 # error Operating system not discriminated 00132 # endif /* operating system */ 00133 # ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION 00134 } 00135 # endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */ 00136 00137 # if ( defined(PLATFORMSTL_OS_IS_UNIX) && \ 00138 defined(_UNIXSTL_NO_NAMESPACE)) || \ 00139 ( defined(PLATFORMSTL_OS_IS_WINDOWS) && \ 00140 defined(_WINSTL_NO_NAMESPACE)) 00141 /* Source atomic functions are defined within a namespace, either unixstl or winstl. */ 00142 00143 using atomic_int_t; 00144 00145 # else /* ? global */ 00146 /* Source atomic functions are defined within the global namespace. */ 00147 00148 using implementation::platform_stl_::atomic_int_t; 00149 00150 # endif /* global */ 00151 #endif /* __cplusplus */ 00152 00153 /* ////////////////////////////////////////////////////////////////////// */ 00154 00155 #if !defined(__cplusplus) 00156 /* Nothing defined in C */ 00157 #elif defined(_STLSOFT_NO_NAMESPACE) || \ 00158 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION) 00159 } /* namespace platformstl */ 00160 #else 00161 } /* namespace platformstl_project */ 00162 } /* namespace stlsoft */ 00163 #endif /* _STLSOFT_NO_NAMESPACE */ 00164 00165 /* ////////////////////////////////////////////////////////////////////// */ 00166 00167 #endif /* !PLATFORMSTL_INCL_PLATFORMSTL_SYNCH_H_ATOMIC_TYPES */ 00168 00169 /* ///////////////////////////// end of file //////////////////////////// */