Commit e967f0bd authored by Rob Richards's avatar Rob Richards

*use specified calling convention

  for xmlDllMain. Old SDKs (VC6) only support InterlockedCompareExchange.
  add xmlDllMain to header for win32 when building for static dll

svn path=/trunk/; revision=3624
parent b8769d6f
Fri Jun 8 21:37:46 CEST 2007 Rob Richards <rrichards@ctindustries.net>
* threads.c include/libxml/threads.h: use specified calling convention
for xmlDllMain. Old SDKs (VC6) only support InterlockedCompareExchange.
add xmlDllMain to header for win32 when building for static dll
Fri Jun 8 10:51:28 CEST 2007 Rob Richards <rrichards@ctindustries.net>
* xmlwriter.c: fixed problem with namespace declaration being
......
......@@ -72,6 +72,10 @@ XMLPUBFUN void XMLCALL
XMLPUBFUN xmlGlobalStatePtr XMLCALL
xmlGetGlobalState(void);
#if defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && defined(LIBXML_STATIC_FOR_DLL)
int XMLCALL xmlDllMain(void *hinstDLL, unsigned long fdwReason, void *lpvReserved);
#endif
#ifdef __cplusplus
}
#endif
......
......@@ -441,7 +441,11 @@ __xmlGlobalInitMutexLock(void)
InitializeCriticalSection(cs);
/* Swap it into the global_init_lock */
#ifdef InterlockedCompareExchangePointer
InterlockedCompareExchangePointer(&global_init_lock, cs, NULL);
#else /* Use older void* version */
InterlockedCompareExchange((void **)&global_init_lock, (void *)cs, NULL);
#endif /* InterlockedCompareExchangePointer */
/* If another thread successfully recorded its critical
* section in the global_init_lock then discard the one
......@@ -912,7 +916,7 @@ xmlOnceInit(void) {
*/
#if defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
#if defined(LIBXML_STATIC_FOR_DLL)
BOOL WINAPI xmlDllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
BOOL XMLCALL xmlDllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
#else
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment