mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
proper windows get process function name, fix batch file, add echoes back
This commit is contained in:
@@ -25,9 +25,9 @@ int main(int argc, char* argv[])
|
||||
|
||||
#ifdef WIN
|
||||
hndl = (void*) LoadLibrary((char const*)"./shared.dll");
|
||||
status = (pFunc)GetProcessAddress((HMODULE) hndl, (char const*)"status");
|
||||
count = (pFunc)GetProcessAddress((HMODULE) hndl, (char const*)"count");
|
||||
occupiedMem = (pFunc)GetProcessAddress((HMODULE) hndl, (char const*)"occupiedMem");
|
||||
status = (pFunc)GetProcAddress((HMODULE) hndl, (char const*)"status");
|
||||
count = (pFunc)GetProcAddress((HMODULE) hndl, (char const*)"count");
|
||||
occupiedMem = (pFunc)GetProcAddress((HMODULE) hndl, (char const*)"occupiedMem");
|
||||
#else /* OSX || NIX */
|
||||
hndl = (void*) dlopen((char const*)"./libshared.so", RTLD_LAZY);
|
||||
status = (pFunc) dlsym(hndl, (char const*)"status");
|
||||
|
||||
@@ -7,4 +7,4 @@ set INC=
|
||||
|
||||
nim c shared.nim
|
||||
nim c -o:nmain main.nim
|
||||
%CXX% %INC) %DEFS% %CFLAGS% -o cmain main.c %LNFLAGS% %LIBS%
|
||||
%CXX% %INC% %DEFS% %CFLAGS% -o cmain main.c %LNFLAGS% %LIBS%
|
||||
|
||||
@@ -57,4 +57,5 @@ proc count() {.exportc: "count", dynlib.} =
|
||||
|
||||
proc occupiedMem() {.exportc: "occupiedMem", dynlib.} =
|
||||
#echo("Occupied Memmory: ", getOccupiedMem())
|
||||
discard
|
||||
|
||||
|
||||
Reference in New Issue
Block a user