6#elif defined(__WINNT__)
16#if __DCL_HAVE_ALLOC_DEBUG
17#undef __DCL_ALLOC_LEVEL
18#define __DCL_ALLOC_LEVEL __DCL_ALLOC_INTERNAL
21#if __DCL_HAVE_THIS_FILE__
35static pthread_mutex_t __mutex = PTHREAD_MUTEX_INITIALIZER;
37inline long __incrementAndGet(
volatile long& _n)
39 pthread_mutex_lock(&__mutex);
41 pthread_mutex_unlock(&__mutex);
45inline long __decrementAndGet(
volatile long& _n)
47 pthread_mutex_lock(&__mutex);
49 pthread_mutex_unlock(&__mutex);
52#elif defined(__WINNT__)
53inline long __incrementAndGet(
volatile long& _n)
55 return InterlockedIncrement(&_n);
58inline long __decrementAndGet(
volatile long& _n)
60 return InterlockedDecrement(&_n);
65static long __initializeCount__ = 0;
71static int __DCLInitialize()
73 long initCount =__incrementAndGet(__initializeCount__);
83#if __DCL_HAVE_ALLOC_DEBUG
93#if __DCL_HAVE_ALLOC_DEBUG
94#define new __DCL_DEBUG_NEW
101static void __DCLCleanup()
103 if (__decrementAndGet(__initializeCount__) == 0) {
108#ifndef __DCL_HAVE_ALLOC_DEBUG
133 __DCL_NAMESPACE
Writer* _newOutput
137 Writer* oldOutput = __pGlobalDebugOut;
138 __pGlobalDebugOut = _newOutput;
146 __DCL_NAMESPACE
Writer* _newOutput
155 node->
value = _newOutput;
158 __LibState__->mapThreadOutput[(
const void*)(
size_t) _threadId] = _newOutput;
174 throw new AssertError(_filename, _line, _expr, _message);
196 output = __pGlobalDebugOut;
202 sw.printf(
__T(
"%ls:%u "), _filename, _line);
205 va_start(arglist, _format);
206 sw.vprintf(_format, arglist);
213 if (output == __pGlobalDebugOut) {
224 if (output == __pGlobalDebugOut) {
232#if __DCL_HAVE_MANUAL_INITIALIZE
235 return __DCLInitialize();
242#elif defined(__DCL_CORE_EXPORTS)
252 case DLL_PROCESS_ATTACH:
255 case DLL_PROCESS_DETACH:
258 case DLL_THREAD_ATTACH:
261 case DLL_THREAD_DETACH:
268__attribute__((constructor))
274__attribute__((destructor))
285#pragma optimize ("", off)
304#pragma optimize ("", off)
void __cleanupThreadEnvironment()
__DCL_BEGIN_NAMESPACE LibState * __LibState__
void __initializeThreadEnvironment()
#define __DCL_TRACE0(psz)
#define __DCL_TRACE1(fmt, arg1)
DCLCVAR const struct __endl endl
String toStringAll() const
virtual String toString() const