Permalink
Browse files

_WINSOCKAPI_ has to be defined before including <windows.h> to avoid …

…redefiniction errors.
  • Loading branch information...
1 parent 328e26c commit e43e15d0b47bc2dbf11fad364086e79f571babaf @cfis cfis committed Aug 18, 2011
Showing with 4 additions and 1 deletion.
  1. +1 −0 ext/ffi_c/ClosurePool.c
  2. +2 −1 ext/ffi_c/DynamicLibrary.c
  3. +1 −0 ext/ffi_c/Thread.c
View
@@ -28,6 +28,7 @@
#ifndef _WIN32
# include <unistd.h>
#else
+# define _WINSOCKAPI_
# include <windows.h>
#endif
#include <errno.h>
@@ -22,6 +22,7 @@
#include <stdio.h>
#include <stdint.h>
#if defined(_WIN32) || defined(__WIN32__)
+# define _WINSOCKAPI_
# include <windows.h>
#else
# include <dlfcn.h>
@@ -144,7 +145,7 @@ dl_open(const char* name, int flags)
if (name == NULL) {
return GetModuleHandle(NULL);
} else {
- return LoadLibraryEx(name, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
+ return LoadLibraryExA(name, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
}
}
View
@@ -25,6 +25,7 @@
# include <errno.h>
# include <signal.h>
#else
+# define _WINSOCKAPI_
# include <windows.h>
#endif
#include <fcntl.h>

0 comments on commit e43e15d

Please sign in to comment.