1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/build/stlport/src/dll_main.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,262 @@ 1.4 + /* 1.5 + * 1.6 + * Copyright (c) 1994 1.7 + * Hewlett-Packard Company 1.8 + * 1.9 + * Copyright (c) 1996,1997 1.10 + * Silicon Graphics Computer Systems, Inc. 1.11 + * 1.12 + * Copyright (c) 1997 1.13 + * Moscow Center for SPARC Technology 1.14 + * 1.15 + * Copyright (c) 1999 1.16 + * Boris Fomitchev 1.17 + * 1.18 + * This material is provided "as is", with absolutely no warranty expressed 1.19 + * or implied. Any use is at your own risk. 1.20 + * 1.21 + * Permission to use or copy this software for any purpose is hereby granted 1.22 + * without fee, provided the above notices are retained on all copies. 1.23 + * Permission to modify the code and to distribute modified code is granted, 1.24 + * provided the above notices are retained, and a notice that the code was 1.25 + * modified is included with the above copyright notice. 1.26 + * 1.27 + */ 1.28 + 1.29 +#define _STLP_EXPOSE_GLOBALS_IMPLEMENTATION 1.30 + 1.31 +#include "stlport_prefix.h" 1.32 + 1.33 +#if !defined (_STLP_DEBUG) && ! defined (_STLP_ASSERTIONS) 1.34 +# if !defined (__APPLE__) || !defined (__GNUC__) || (__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ < 3)) 1.35 +/* dums: Please if the following code was being uncommented please explain why 1.36 + * as for the moment it only looks like a source of inconsistency in the way 1.37 + * STLport different translation units are compiled. 1.38 + */ 1.39 +//# define _STLP_ASSERTIONS 1 1.40 +# endif 1.41 +#endif 1.42 + 1.43 +#include <utility> 1.44 +#include <memory> 1.45 +#include <vector> 1.46 +#include <set> 1.47 +#include <list> 1.48 +#include <slist> 1.49 +#include <deque> 1.50 +#include <hash_map> 1.51 +#include <limits> 1.52 +#include <string> 1.53 +#include <stdexcept> 1.54 +#include <bitset> 1.55 +#include <locale> 1.56 + 1.57 +#if defined (__DMC__) 1.58 +// for rope static members 1.59 +# include <rope> 1.60 +#endif 1.61 + 1.62 +#include <stl/_range_errors.c> 1.63 + 1.64 +_STLP_BEGIN_NAMESPACE 1.65 + 1.66 +#if defined (_STLP_NO_EXCEPTION_HEADER) || defined (_STLP_BROKEN_EXCEPTION_CLASS) 1.67 +exception::exception() _STLP_NOTHROW {} 1.68 +exception::~exception() _STLP_NOTHROW {} 1.69 +bad_exception::bad_exception() _STLP_NOTHROW {} 1.70 +bad_exception::~bad_exception() _STLP_NOTHROW {} 1.71 +const char* exception::what() const _STLP_NOTHROW { return "class exception"; } 1.72 +const char* bad_exception::what() const _STLP_NOTHROW { return "class bad_exception"; } 1.73 +#endif 1.74 + 1.75 +#if defined (_STLP_OWN_STDEXCEPT) 1.76 +# include <stl/_stdexcept_base.c> 1.77 + 1.78 +// boris : those are needed to force typeinfo nodes to be created in here only 1.79 +logic_error::~logic_error() _STLP_NOTHROW_INHERENTLY {} 1.80 +runtime_error::~runtime_error() _STLP_NOTHROW_INHERENTLY {} 1.81 +domain_error::~domain_error() _STLP_NOTHROW_INHERENTLY {} 1.82 +invalid_argument::~invalid_argument() _STLP_NOTHROW_INHERENTLY {} 1.83 +length_error::~length_error() _STLP_NOTHROW_INHERENTLY {} 1.84 +out_of_range::~out_of_range() _STLP_NOTHROW_INHERENTLY {} 1.85 +range_error::~range_error() _STLP_NOTHROW_INHERENTLY {} 1.86 +overflow_error::~overflow_error() _STLP_NOTHROW_INHERENTLY {} 1.87 +underflow_error::~underflow_error() _STLP_NOTHROW_INHERENTLY {} 1.88 + 1.89 +#endif 1.90 + 1.91 +#if !defined(_STLP_WCE_EVC3) 1.92 +# if defined (_STLP_NO_BAD_ALLOC) 1.93 +const nothrow_t nothrow /* = {} */; 1.94 +# endif 1.95 +#endif 1.96 + 1.97 +#if !defined (_STLP_NO_FORCE_INSTANTIATE) 1.98 + 1.99 +# if defined (_STLP_DEBUG) || defined (_STLP_ASSERTIONS) 1.100 +_STLP_MOVE_TO_PRIV_NAMESPACE 1.101 +template class _STLP_CLASS_DECLSPEC __stl_debug_engine<bool>; 1.102 +_STLP_MOVE_TO_STD_NAMESPACE 1.103 +# endif 1.104 + 1.105 +template class _STLP_CLASS_DECLSPEC __debug_alloc<__node_alloc>; 1.106 +template class _STLP_CLASS_DECLSPEC __debug_alloc<__new_alloc>; 1.107 + 1.108 +//Export of the types used to represent buckets in the hashtable implementation. 1.109 +/* 1.110 + * For the vector class we do not use any MSVC6 workaround even if we export it from 1.111 + * the STLport dynamic libraries because we know what methods are called and none is 1.112 + * a template method. Moreover the exported class is an instanciation of vector with 1.113 + * _Slist_node_base struct that is an internal STLport class that no user should ever 1.114 + * use. 1.115 + */ 1.116 +# if !defined (_STLP_USE_PTR_SPECIALIZATIONS) 1.117 +template class _STLP_CLASS_DECLSPEC allocator<_STLP_PRIV _Slist_node_base*>; 1.118 + 1.119 +_STLP_MOVE_TO_PRIV_NAMESPACE 1.120 +template class _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<_Slist_node_base**, _Slist_node_base*, 1.121 + allocator<_Slist_node_base*> >; 1.122 +template class _STLP_CLASS_DECLSPEC _Vector_base<_Slist_node_base*, 1.123 + allocator<_Slist_node_base*> >; 1.124 +_STLP_MOVE_TO_STD_NAMESPACE 1.125 +# endif 1.126 + 1.127 +# if defined (_STLP_DEBUG) 1.128 +_STLP_MOVE_TO_PRIV_NAMESPACE 1.129 +template class _STLP_CLASS_DECLSPEC _STLP_NON_DBG_NAME(vector)<_Slist_node_base*, 1.130 + allocator<_Slist_node_base*> >; 1.131 +_STLP_MOVE_TO_STD_NAMESPACE 1.132 +# endif 1.133 + 1.134 +template class _STLP_CLASS_DECLSPEC vector<_STLP_PRIV _Slist_node_base*, 1.135 + allocator<_STLP_PRIV _Slist_node_base*> >; 1.136 +//End of hashtable bucket types export. 1.137 + 1.138 +//Export of _Locale_impl facets container: 1.139 +# if !defined (_STLP_USE_PTR_SPECIALIZATIONS) 1.140 +template class _STLP_CLASS_DECLSPEC allocator<locale::facet*>; 1.141 + 1.142 +_STLP_MOVE_TO_PRIV_NAMESPACE 1.143 +template class _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<locale::facet**, locale::facet*, allocator<locale::facet*> >; 1.144 +template class _STLP_CLASS_DECLSPEC _Vector_base<locale::facet*, allocator<locale::facet*> >; 1.145 +_STLP_MOVE_TO_STD_NAMESPACE 1.146 + 1.147 +# endif 1.148 +# if defined (_STLP_DEBUG) 1.149 +_STLP_MOVE_TO_PRIV_NAMESPACE 1.150 +# define _STLP_NON_DBG_VECTOR _STLP_NON_DBG_NAME(vector) 1.151 +template class _STLP_CLASS_DECLSPEC __construct_checker<_STLP_PRIV _STLP_NON_DBG_VECTOR<locale::facet*, allocator<locale::facet*> > >; 1.152 +template class _STLP_CLASS_DECLSPEC _STLP_NON_DBG_VECTOR<locale::facet*, allocator<locale::facet*> >; 1.153 +# undef _STLP_NON_DBG_VECTOR 1.154 +_STLP_MOVE_TO_STD_NAMESPACE 1.155 +# endif 1.156 + 1.157 +template class _STLP_CLASS_DECLSPEC vector<locale::facet*, allocator<locale::facet*> >; 1.158 +//End of export of _Locale_impl facets container. 1.159 + 1.160 +# if defined (_STLP_USE_PTR_SPECIALIZATIONS) 1.161 +template class _STLP_CLASS_DECLSPEC allocator<void*>; 1.162 + 1.163 +typedef _STLP_PRIV _List_node<void*> _VoidPtr_Node; 1.164 +template class _STLP_CLASS_DECLSPEC allocator<_VoidPtr_Node>; 1.165 + 1.166 +_STLP_MOVE_TO_PRIV_NAMESPACE 1.167 + 1.168 +template class _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<void**, void*, allocator<void*> >; 1.169 +template class _STLP_CLASS_DECLSPEC _Vector_base<void*, allocator<void*> >; 1.170 +template class _STLP_CLASS_DECLSPEC _STLP_PTR_IMPL_NAME(vector)<void*, allocator<void*> >; 1.171 + 1.172 +template class _STLP_CLASS_DECLSPEC _List_node<void*>; 1.173 +template class _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<_List_node_base, _VoidPtr_Node, allocator<_VoidPtr_Node> >; 1.174 +template class _STLP_CLASS_DECLSPEC _List_base<void*, allocator<void*> >; 1.175 +template class _STLP_CLASS_DECLSPEC _STLP_PTR_IMPL_NAME(list)<void*, allocator<void*> >; 1.176 + 1.177 +template class _STLP_CLASS_DECLSPEC _Slist_node<void*>; 1.178 +template class _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<_Slist_node_base, _Slist_node<void*>, allocator<_Slist_node<void*> > >; 1.179 +template class _STLP_CLASS_DECLSPEC _Slist_base<void*, allocator<void*> >; 1.180 +template class _STLP_CLASS_DECLSPEC _STLP_PTR_IMPL_NAME(slist)<void*, allocator<void*> >; 1.181 + 1.182 +template class _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<size_t, void*, allocator<void*> >; 1.183 +template class _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<void***, void**, allocator<void**> >; 1.184 +template struct _STLP_CLASS_DECLSPEC _Deque_iterator<void*, _Nonconst_traits<void*> >; 1.185 +template class _STLP_CLASS_DECLSPEC _Deque_base<void*, allocator<void*> >; 1.186 +template class _STLP_CLASS_DECLSPEC _STLP_PTR_IMPL_NAME(deque)<void*, allocator<void*> >; 1.187 + 1.188 +_STLP_MOVE_TO_STD_NAMESPACE 1.189 + 1.190 +# endif /* _STLP_USE_PTR_SPECIALIZATIONS */ 1.191 + 1.192 +_STLP_MOVE_TO_PRIV_NAMESPACE 1.193 + 1.194 +template class _STLP_CLASS_DECLSPEC _Rb_global<bool>; 1.195 +template class _STLP_CLASS_DECLSPEC _List_global<bool>; 1.196 + 1.197 +template class _STLP_CLASS_DECLSPEC _Sl_global<bool>; 1.198 +template class _STLP_CLASS_DECLSPEC _Stl_prime<bool>; 1.199 + 1.200 +template class _STLP_CLASS_DECLSPEC _LimG<bool>; 1.201 + 1.202 +_STLP_MOVE_TO_STD_NAMESPACE 1.203 + 1.204 +#endif /* _STLP_NO_FORCE_INSTANTIATE */ 1.205 + 1.206 +_STLP_END_NAMESPACE 1.207 + 1.208 +#if defined (_STLP_SIGNAL_RUNTIME_COMPATIBILITY) 1.209 +extern "C" void _STLP_DECLSPEC _STLP_CALL _STLP_SIGNAL_RUNTIME_COMPATIBILITY() {} 1.210 +#endif 1.211 + 1.212 +#define FORCE_SYMBOL extern 1.213 + 1.214 +#if defined (_WIN32) && defined (_STLP_USE_DECLSPEC) && !defined (_STLP_USE_STATIC_LIB) 1.215 +// stlportmt.cpp : Defines the entry point for the DLL application. 1.216 +// 1.217 +# undef FORCE_SYMBOL 1.218 +# define FORCE_SYMBOL APIENTRY 1.219 + 1.220 +extern "C" { 1.221 + 1.222 +BOOL APIENTRY DllMain( HANDLE hModule, 1.223 + DWORD ul_reason_for_call, 1.224 + LPVOID) { 1.225 + switch (ul_reason_for_call) { 1.226 + case DLL_PROCESS_ATTACH: 1.227 + DisableThreadLibraryCalls((HINSTANCE)hModule); 1.228 + case DLL_THREAD_ATTACH: 1.229 + case DLL_THREAD_DETACH: 1.230 + case DLL_PROCESS_DETACH: 1.231 + break; 1.232 + } 1.233 + return TRUE; 1.234 +} 1.235 + 1.236 +} /* extern "C" */ 1.237 + 1.238 +#if !defined (_STLP_MSVC) && !defined (__MINGW32__) 1.239 +_STLP_BEGIN_NAMESPACE 1.240 + 1.241 +static void FORCE_SYMBOL 1.242 +force_link() { 1.243 + set<int>::iterator iter; 1.244 + // _M_increment; _M_decrement instantiation 1.245 + ++iter; 1.246 + --iter; 1.247 +} 1.248 + 1.249 +_STLP_END_NAMESPACE 1.250 +#endif 1.251 + 1.252 +#endif /* _WIN32 */ 1.253 + 1.254 +#if defined (__ICL) && (__ICL >= 900) && (_STLP_MSVC_LIB < 1300) 1.255 +# undef std 1.256 + 1.257 +namespace std 1.258 +{ 1.259 + void _STLP_CALL unexpected() { 1.260 + unexpected_handler hdl; 1.261 + set_unexpected(hdl = set_unexpected((unexpected_handler)0)); 1.262 + hdl(); 1.263 + } 1.264 +} 1.265 +#endif