build/stlport/src/dll_main.cpp

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial