From 8740647c588a23cb77794dc4021a669443839367 Mon Sep 17 00:00:00 2001 From: jason Date: Tue, 6 Oct 2020 11:26:45 +0900 Subject: [PATCH] Update LoadLibrary.c --- samples/NativeLibrary/LoadLibrary.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/samples/NativeLibrary/LoadLibrary.c b/samples/NativeLibrary/LoadLibrary.c index 72727915649..d8cdbcbe746 100644 --- a/samples/NativeLibrary/LoadLibrary.c +++ b/samples/NativeLibrary/LoadLibrary.c @@ -9,15 +9,20 @@ #ifdef _WIN32 #include "windows.h" -#define symLoad GetProcAddress GetProcAddress +#define symLoad GetProcAddress #else #include "dlfcn.h" +#include #define symLoad dlsym #endif -#include + #include #include +#ifndef F_OK +#define F_OK 0 +#endif + int callSumFunc(char *path, char *funcName, int a, int b); char *callSumStringFunc(char *path, char *funcName, char *a, char *b); @@ -46,7 +51,7 @@ int callSumFunc(char *path, char *funcName, int firstInt, int secondInt) { // Call sum function defined in C# shared library #ifdef _WIN32 - HINSTANCE handle = LoadLibrary(path); + HINSTANCE handle = LoadLibraryA(path); #else void *handle = dlopen(path, RTLD_LAZY); #endif @@ -65,7 +70,7 @@ char *callSumStringFunc(char *path, char *funcName, char *firstString, char *sec { // Library loading #ifdef _WIN32 - HINSTANCE handle = LoadLibrary(path); + HINSTANCE handle = LoadLibraryA(path); #else void *handle = dlopen(path, RTLD_LAZY); #endif