summaryrefslogtreecommitdiff
path: root/dll.c
diff options
context:
space:
mode:
Diffstat (limited to 'dll.c')
-rw-r--r--dll.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/dll.c b/dll.c
index 7ebfd5e..b440500 100644
--- a/dll.c
+++ b/dll.c
@@ -29,6 +29,20 @@ static HINSTANCE _pthread_h_kernel32;
#pragma warning( disable : 4100 )
#endif
+#ifdef __cplusplus
+/*
+ * Dear c++: Please don't mangle this name. -thanks
+ */
+extern "C"
+{
+#endif /* __cplusplus */
+
+ BOOL WINAPI DllMain( HINSTANCE, DWORD, LPVOID);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
BOOL WINAPI
DllMain (
HINSTANCE hinstDll,
@@ -50,6 +64,7 @@ DllMain (
/* Load KERNEL32 and try to get address of TryEnterCriticalSection */
_pthread_h_kernel32 = LoadLibrary(TEXT("KERNEL32.DLL"));
_pthread_try_enter_critical_section =
+ (BOOL (PT_STDCALL *)(LPCRITICAL_SECTION))
GetProcAddress(_pthread_h_kernel32,
(LPCSTR) "TryEnterCriticalSection");
break;