Ticket #8817: wince.patch
File wince.patch, 3.8 KB (added by , 9 years ago) |
---|
-
boost/config/compiler/visualc.hpp
108 108 # define BOOST_NO_CXX11_VARIADIC_MACROS 109 109 #endif 110 110 111 #if defined(UNDER_CE)112 // Windows CE does not have a conforming signature for swprintf113 # define BOOST_NO_SWPRINTF114 #endif115 116 111 #if _MSC_VER < 1500 // 140X == VC++ 8.0 117 112 # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS 118 113 #endif … … 142 137 # define BOOST_NO_INTRINSIC_WCHAR_T 143 138 #endif 144 139 145 #if defined(_WIN32_WCE) || defined(UNDER_CE)146 # define BOOST_NO_SWPRINTF147 #endif148 149 // we have ThreadEx or GetSystemTimeAsFileTime unless we're running WindowsCE150 #if !defined(_WIN32_WCE) && !defined(UNDER_CE)151 # define BOOST_HAS_THREADEX152 # define BOOST_HAS_GETSYSTEMTIMEASFILETIME153 #endif154 155 140 // 156 141 // check for exception handling support: 157 142 #if !defined(_CPPUNWIND) && !defined(BOOST_NO_EXCEPTIONS) -
boost/config/platform/win32.hpp
61 61 # define BOOST_HAS_GETSYSTEMTIMEASFILETIME 62 62 #endif 63 63 64 #if defined(_WIN32_WCE) || defined(UNDER_CE) 65 // Windows CE does not have a conforming signature for swprintf 66 # define BOOST_NO_SWPRINTF 67 #endif 68 69 // we have ThreadEx or GetSystemTimeAsFileTime unless we're running WindowsCE 70 #if !defined(_WIN32_WCE) && !defined(UNDER_CE) 71 # define BOOST_HAS_THREADEX 72 # define BOOST_HAS_GETSYSTEMTIMEASFILETIME 73 #endif 74 64 75 #ifndef BOOST_HAS_PTHREADS 65 76 # define BOOST_HAS_WINTHREADS 66 77 #endif -
libs/thread/src/win32/thread.cpp
111 111 namespace 112 112 { 113 113 #ifndef BOOST_HAS_THREADEX 114 // Windows CE doesn't define _beginthreadex 115 116 struct ThreadProxyData 117 { 118 typedef unsigned (__stdcall* func)(void*); 119 func start_address_; 120 void* arglist_; 121 ThreadProxyData(func start_address,void* arglist) : start_address_(start_address), arglist_(arglist) {} 122 }; 123 124 DWORD WINAPI ThreadProxy(LPVOID args) 125 { 126 std::auto_ptr<ThreadProxyData> data(reinterpret_cast<ThreadProxyData*>(args)); 127 DWORD ret=data->start_address_(data->arglist_); 128 return ret; 129 } 130 131 typedef void* uintptr_t; 132 133 inline uintptr_t _beginthreadex(void* security, unsigned stack_size, unsigned (__stdcall* start_address)(void*), 134 void* arglist, unsigned initflag, unsigned* thrdaddr) 135 { 136 DWORD threadID; 137 ThreadProxyData* data = new ThreadProxyData(start_address,arglist); 138 HANDLE hthread=CreateThread(static_cast<LPSECURITY_ATTRIBUTES>(security),stack_size,ThreadProxy, 139 data,initflag,&threadID); 140 if (hthread==0) { 141 delete data; 142 return 0; 143 } 144 *thrdaddr=threadID; 145 return reinterpret_cast<uintptr_t const>(hthread); 146 } 147 148 #endif 149 114 #define _beginthreadex(security, \ 115 stack_size, \ 116 start_proc, \ 117 arg, \ 118 flags, \ 119 pid) \ 120 CreateThread(security, \ 121 stack_size, \ 122 (LPTHREAD_START_ROUTINE) start_proc, \ 123 arg, \ 124 flags, \ 125 pid) 126 #endif // !BOOST_HAS_THREADEX 150 127 } 151 128 152 129 namespace detail