Amazed from the ongoing process of using newLISP in other enviroments come this next option to my mind:
Is it possible to get a optional makefile for compiling newLISP.dll with cdecl-calling convention so that 'newlispEvalStr' can be directly called from C-programs?
Background: Existing apps written in C often offers plugin interfaces with cdecl-calling convention. So it would be nice to use newLISP.dll there without any wrapper DLL's.
Since newLISP allow 'cdecl-calling' on import it would be nice when we could do it on export.
newLISP.dll with cdecl-option?
newLISP.dll with cdecl-option?
Hans-Peter
Why shoudn't it be possible to call newlisp.dll from 'C' programs right now?
The code shows you how to import either way on Win32. When importing into 'C' the difference is only, how you declare the function. newLISP can import newlisp.dll this way.
Lutz
Code: Select all
#ifdef STDCALL
int _stdcall (*function)();
#else /* cdecl */
int (*function)();
#endif
if((hLibrary = LoadLibrary(libName)) < 32)
printf("cannot import library");
if((function = GetProcAddress(hLibrary, (LPCSTR)funcName)) == NULL)
printf("don't know this function");
/* call the function */
result = (*function)();
Lutz