#include "runtime_internal.h"

#ifdef BITS_64
#define WIN32API
#else
#define WIN32API __stdcall
#endif

extern "C" {

WIN32API void *LoadLibraryA(const char *);
WIN32API void *GetProcAddress(void *, const char *);

WEAK void *halide_get_symbol(const char *name) {
    return GetProcAddress(NULL, name);
}

WEAK void *halide_load_library(const char *name) {
    return LoadLibraryA(name);
}

WEAK void *halide_get_library_symbol(void *lib, const char *name) {
    return GetProcAddress(lib, name);
}

}

#include "runtime_internal.h"

#ifdef BITS_64
#define WIN32API
#else
#define WIN32API __stdcall
#endif

extern "C" {

WIN32API void *LoadLibrary(const char *);
WIN32API void *GetProcAddress(void *, const char *);

WEAK void *halide_get_symbol(const char *name) {
    return GetProcAddress(NULL, name);
}

WEAK void *halide_load_library(const char *name) {
    return LoadLibrary(name);
}

WEAK void *halide_get_library_symbol(void *lib, const char *name) {
    return GetProcAddress(lib, name);
}

}

--- 
+++ 
@@ -8,7 +8,7 @@
 
 extern "C" {
 
-WIN32API void *LoadLibrary(const char *);
+WIN32API void *LoadLibraryA(const char *);
 WIN32API void *GetProcAddress(void *, const char *);
 
 WEAK void *halide_get_symbol(const char *name) {
@@ -16,7 +16,7 @@
 }
 
 WEAK void *halide_load_library(const char *name) {
-    return LoadLibrary(name);
+    return LoadLibraryA(name);
 }
 
 WEAK void *halide_get_library_symbol(void *lib, const char *name) {
Fix missing LoadLibrary symbol on windows.
