| 1 |
/* |
| 2 |
* |
| 3 |
* Copyright (c) 1994 |
| 4 |
* Hewlett-Packard Company |
| 5 |
* |
| 6 |
* Copyright (c) 1996,1997 |
| 7 |
* Silicon Graphics Computer Systems, Inc. |
| 8 |
* |
| 9 |
* Copyright (c) 1997 |
| 10 |
* Moscow Center for SPARC Technology |
| 11 |
* |
| 12 |
* Copyright (c) 1999 |
| 13 |
* Boris Fomitchev |
| 14 |
* |
| 15 |
* This material is provided "as is", with absolutely no warranty expressed |
| 16 |
* or implied. Any use is at your own risk. |
| 17 |
* |
| 18 |
* Permission to use or copy this software for any purpose is hereby granted |
| 19 |
* without fee, provided the above notices are retained on all copies. |
| 20 |
* Permission to modify the code and to distribute modified code is granted, |
| 21 |
* provided the above notices are retained, and a notice that the code was |
| 22 |
* modified is included with the above copyright notice. |
| 23 |
* |
| 24 |
*/ |
| 25 |
|
| 26 |
#define _STLP_EXPOSE_GLOBALS_IMPLEMENTATION |
| 27 |
|
| 28 |
#include "stlport_prefix.h" |
| 29 |
|
| 30 |
#if !defined (_STLP_DEBUG) && ! defined (_STLP_ASSERTIONS) |
| 31 |
# if !defined (__APPLE__) || !defined (__GNUC__) || (__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ < 3)) |
| 32 |
/* dums: Please if the following code was being uncommented please explain why |
| 33 |
* as for the moment it only looks like a source of inconsistency in the way |
| 34 |
* STLport different translation units are compiled. |
| 35 |
*/ |
| 36 |
//# define _STLP_ASSERTIONS 1 |
| 37 |
# endif |
| 38 |
#endif |
| 39 |
|
| 40 |
#include <utility> |
| 41 |
#include <memory> |
| 42 |
#include <vector> |
| 43 |
#include <set> |
| 44 |
#include <list> |
| 45 |
#include <forward_list> |
| 46 |
#include <deque> |
| 47 |
#include <limits> |
| 48 |
#include <string> |
| 49 |
#include <stdexcept> |
| 50 |
#include <bitset> |
| 51 |
#include <locale> |
| 52 |
|
| 53 |
#if defined (__DMC__) |
| 54 |
// for rope static members |
| 55 |
# include <rope> |
| 56 |
#endif |
| 57 |
|
| 58 |
#include <stl/_range_errors.c> |
| 59 |
|
| 60 |
_STLP_BEGIN_NAMESPACE |
| 61 |
|
| 62 |
#if defined (_STLP_NO_EXCEPTION_HEADER) |
| 63 |
exception::exception() _STLP_NOTHROW {} |
| 64 |
exception::~exception() _STLP_NOTHROW {} |
| 65 |
bad_exception::bad_exception() _STLP_NOTHROW {} |
| 66 |
bad_exception::~bad_exception() _STLP_NOTHROW {} |
| 67 |
const char* exception::what() const _STLP_NOTHROW { return "class exception"; } |
| 68 |
const char* bad_exception::what() const _STLP_NOTHROW { return "class bad_exception"; } |
| 69 |
#endif |
| 70 |
|
| 71 |
#if defined (_STLP_OWN_STDEXCEPT) |
| 72 |
# include <stl/_stdexcept_base.c> |
| 73 |
|
| 74 |
// boris : those are needed to force typeinfo nodes to be created in here only |
| 75 |
logic_error::~logic_error() _STLP_NOTHROW_INHERENTLY {} |
| 76 |
runtime_error::~runtime_error() _STLP_NOTHROW_INHERENTLY {} |
| 77 |
domain_error::~domain_error() _STLP_NOTHROW_INHERENTLY {} |
| 78 |
invalid_argument::~invalid_argument() _STLP_NOTHROW_INHERENTLY {} |
| 79 |
length_error::~length_error() _STLP_NOTHROW_INHERENTLY {} |
| 80 |
out_of_range::~out_of_range() _STLP_NOTHROW_INHERENTLY {} |
| 81 |
range_error::~range_error() _STLP_NOTHROW_INHERENTLY {} |
| 82 |
overflow_error::~overflow_error() _STLP_NOTHROW_INHERENTLY {} |
| 83 |
underflow_error::~underflow_error() _STLP_NOTHROW_INHERENTLY {} |
| 84 |
|
| 85 |
#endif |
| 86 |
|
| 87 |
#if !defined (_STLP_NO_FORCE_INSTANTIATE) |
| 88 |
|
| 89 |
# if defined (_STLP_DEBUG) || defined (_STLP_ASSERTIONS) |
| 90 |
_STLP_MOVE_TO_PRIV_NAMESPACE |
| 91 |
template class _STLP_CLASS_DECLSPEC __stl_debug_engine<bool>; |
| 92 |
_STLP_MOVE_TO_STD_NAMESPACE |
| 93 |
# endif |
| 94 |
|
| 95 |
template class _STLP_CLASS_DECLSPEC __debug_alloc<__node_alloc>; |
| 96 |
template class _STLP_CLASS_DECLSPEC __debug_alloc<__new_alloc>; |
| 97 |
|
| 98 |
//Export of the types used to represent buckets in the hashtable implementation. |
| 99 |
/* |
| 100 |
* For the vector class we do not use any MSVC6 workaround even if we export it from |
| 101 |
* the STLport dynamic libraries because we know what methods are called and none is |
| 102 |
* a template method. Moreover the exported class is an instanciation of vector with |
| 103 |
* _Slist_node_base struct that is an internal STLport class that no user should ever |
| 104 |
* use. |
| 105 |
*/ |
| 106 |
# if !defined (_STLP_USE_PTR_SPECIALIZATIONS) |
| 107 |
template class _STLP_CLASS_DECLSPEC allocator<_STLP_PRIV _Slist_node_base*>; |
| 108 |
|
| 109 |
_STLP_MOVE_TO_PRIV_NAMESPACE |
| 110 |
template class _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<_Slist_node_base**, |
| 111 |
allocator<_Slist_node_base*> >; |
| 112 |
template class _STLP_CLASS_DECLSPEC _Vector_base<_Slist_node_base*, |
| 113 |
allocator<_Slist_node_base*> >; |
| 114 |
_STLP_MOVE_TO_STD_NAMESPACE |
| 115 |
# endif |
| 116 |
|
| 117 |
# if defined (_STLP_DEBUG) |
| 118 |
_STLP_MOVE_TO_PRIV_NAMESPACE |
| 119 |
template class _STLP_CLASS_DECLSPEC _STLP_NON_DBG_NAME(vector)<_Slist_node_base*, |
| 120 |
allocator<_Slist_node_base*> >; |
| 121 |
_STLP_MOVE_TO_STD_NAMESPACE |
| 122 |
# endif |
| 123 |
|
| 124 |
template class _STLP_CLASS_DECLSPEC vector<_STLP_PRIV _Slist_node_base*, |
| 125 |
allocator<_STLP_PRIV _Slist_node_base*> >; |
| 126 |
//End of hashtable bucket types export. |
| 127 |
|
| 128 |
//Export of _Locale_impl facets container: |
| 129 |
# if !defined (_STLP_USE_PTR_SPECIALIZATIONS) |
| 130 |
template class _STLP_CLASS_DECLSPEC allocator<locale::facet*>; |
| 131 |
|
| 132 |
_STLP_MOVE_TO_PRIV_NAMESPACE |
| 133 |
template class _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<locale::facet**, allocator<locale::facet*> >; |
| 134 |
template class _STLP_CLASS_DECLSPEC _Vector_base<locale::facet*, allocator<locale::facet*> >; |
| 135 |
_STLP_MOVE_TO_STD_NAMESPACE |
| 136 |
|
| 137 |
# endif |
| 138 |
# if defined (_STLP_DEBUG) |
| 139 |
_STLP_MOVE_TO_PRIV_NAMESPACE |
| 140 |
# define _STLP_NON_DBG_VECTOR _STLP_NON_DBG_NAME(vector) |
| 141 |
template class _STLP_CLASS_DECLSPEC __construct_checker<_STLP_PRIV _STLP_NON_DBG_VECTOR<locale::facet*, allocator<locale::facet*> > >; |
| 142 |
template class _STLP_CLASS_DECLSPEC _STLP_NON_DBG_VECTOR<locale::facet*, allocator<locale::facet*> >; |
| 143 |
# undef _STLP_NON_DBG_VECTOR |
| 144 |
_STLP_MOVE_TO_STD_NAMESPACE |
| 145 |
# endif |
| 146 |
|
| 147 |
template class _STLP_CLASS_DECLSPEC vector<locale::facet*, allocator<locale::facet*> >; |
| 148 |
//End of export of _Locale_impl facets container. |
| 149 |
|
| 150 |
# if defined (_STLP_USE_PTR_SPECIALIZATIONS) |
| 151 |
template class _STLP_CLASS_DECLSPEC allocator<void*>; |
| 152 |
|
| 153 |
typedef _STLP_PRIV _List_node<void*> _VoidPtr_Node; |
| 154 |
template class _STLP_CLASS_DECLSPEC allocator<_VoidPtr_Node>; |
| 155 |
|
| 156 |
_STLP_MOVE_TO_PRIV_NAMESPACE |
| 157 |
|
| 158 |
template class _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<void**, allocator<void*> >; |
| 159 |
template class _STLP_CLASS_DECLSPEC _Vector_base<void*, allocator<void*> >; |
| 160 |
template class _STLP_CLASS_DECLSPEC _STLP_PTR_IMPL_NAME(vector)<void*, allocator<void*> >; |
| 161 |
|
| 162 |
template class _STLP_CLASS_DECLSPEC _List_node<void*>; |
| 163 |
template class _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<_List_node_base, allocator<_VoidPtr_Node> >; |
| 164 |
template class _STLP_CLASS_DECLSPEC _List_base<void*, allocator<void*> >; |
| 165 |
template class _STLP_CLASS_DECLSPEC _STLP_PTR_IMPL_NAME(list)<void*, allocator<void*> >; |
| 166 |
|
| 167 |
template class _STLP_CLASS_DECLSPEC _Slist_node<void*>; |
| 168 |
template class _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<_Slist_node_base, allocator<_Slist_node<void*> > >; |
| 169 |
template class _STLP_CLASS_DECLSPEC _STLP_PTR_IMPL_NAME(forward_list)<void*, allocator<void*> >; |
| 170 |
|
| 171 |
template class _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<size_t, allocator<void*> >; |
| 172 |
template class _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<void***, allocator<void**> >; |
| 173 |
template struct _STLP_CLASS_DECLSPEC _Deque_iterator<void*, _Nonconst_traits<void*> >; |
| 174 |
template class _STLP_CLASS_DECLSPEC _STLP_PTR_IMPL_NAME(deque)<void*, allocator<void*> >; |
| 175 |
|
| 176 |
_STLP_MOVE_TO_STD_NAMESPACE |
| 177 |
|
| 178 |
# endif /* _STLP_USE_PTR_SPECIALIZATIONS */ |
| 179 |
|
| 180 |
_STLP_MOVE_TO_PRIV_NAMESPACE |
| 181 |
|
| 182 |
template class _STLP_CLASS_DECLSPEC _Rb_global<bool>; |
| 183 |
template class _STLP_CLASS_DECLSPEC _List_global<bool>; |
| 184 |
|
| 185 |
template class _STLP_CLASS_DECLSPEC _Sl_global<bool>; |
| 186 |
template class _STLP_CLASS_DECLSPEC _Stl_prime<bool>; |
| 187 |
|
| 188 |
template class _STLP_CLASS_DECLSPEC _LimG<bool>; |
| 189 |
|
| 190 |
_STLP_MOVE_TO_STD_NAMESPACE |
| 191 |
|
| 192 |
#endif /* _STLP_NO_FORCE_INSTANTIATE */ |
| 193 |
|
| 194 |
_STLP_END_NAMESPACE |
| 195 |
|
| 196 |
#if defined (_STLP_SIGNAL_RUNTIME_COMPATIBILITY) |
| 197 |
extern "C" void _STLP_DECLSPEC _STLP_CALL _STLP_SIGNAL_RUNTIME_COMPATIBILITY() {} |
| 198 |
#endif |
| 199 |
|
| 200 |
#define FORCE_SYMBOL extern |
| 201 |
|
| 202 |
#if defined (_WIN32) && defined (_STLP_USE_DECLSPEC) && !defined (_STLP_USE_STATIC_LIB) |
| 203 |
// stlportmt.cpp : Defines the entry point for the DLL application. |
| 204 |
// |
| 205 |
# undef FORCE_SYMBOL |
| 206 |
# define FORCE_SYMBOL APIENTRY |
| 207 |
|
| 208 |
extern "C" { |
| 209 |
|
| 210 |
BOOL APIENTRY DllMain( HANDLE hModule, |
| 211 |
DWORD ul_reason_for_call, |
| 212 |
LPVOID) { |
| 213 |
switch (ul_reason_for_call) { |
| 214 |
case DLL_PROCESS_ATTACH: |
| 215 |
DisableThreadLibraryCalls((HINSTANCE)hModule); |
| 216 |
case DLL_THREAD_ATTACH: |
| 217 |
case DLL_THREAD_DETACH: |
| 218 |
case DLL_PROCESS_DETACH: |
| 219 |
break; |
| 220 |
} |
| 221 |
return TRUE; |
| 222 |
} |
| 223 |
|
| 224 |
} /* extern "C" */ |
| 225 |
|
| 226 |
#if !defined (_STLP_MSVC) && !defined (__MINGW32__) |
| 227 |
_STLP_BEGIN_NAMESPACE |
| 228 |
|
| 229 |
static void FORCE_SYMBOL |
| 230 |
force_link() { |
| 231 |
set<int>::iterator iter; |
| 232 |
// _M_increment; _M_decrement instantiation |
| 233 |
++iter; |
| 234 |
--iter; |
| 235 |
} |
| 236 |
|
| 237 |
_STLP_END_NAMESPACE |
| 238 |
#endif |
| 239 |
|
| 240 |
#endif /* _WIN32 */ |
| 241 |
|
| 242 |
#if defined (__ICL) && (__ICL >= 900) && (_STLP_MSVC_LIB < 1300) |
| 243 |
# undef std |
| 244 |
|
| 245 |
namespace std |
| 246 |
{ |
| 247 |
void _STLP_CALL unexpected() { |
| 248 |
unexpected_handler hdl; |
| 249 |
set_unexpected(hdl = set_unexpected((unexpected_handler)0)); |
| 250 |
hdl(); |
| 251 |
} |
| 252 |
} |
| 253 |
#endif |