Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Commit

Permalink
Update LoadLibrary.c (#8358)
Browse files Browse the repository at this point in the history
  • Loading branch information
drvoss authored Oct 9, 2020
1 parent 4ce1c21 commit b06c72e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions samples/NativeLibrary/LoadLibrary.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@

#ifdef _WIN32
#include "windows.h"
#define symLoad GetProcAddress GetProcAddress
#define symLoad GetProcAddress
#else
#include "dlfcn.h"
#include <unistd.h>
#define symLoad dlsym
#endif
#include <unistd.h>

#include <stdlib.h>
#include <stdio.h>

#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);

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit b06c72e

Please sign in to comment.