mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-28 05:17:49 +00:00
72d801e0cd
In QB64, when linking with an external static library `nm.exe` is used to determine whether the symbol being used is either a C or C++ symbol, which determines how the function should be declared in the C++ code. Unfortunately on Windows the `SHELL` command for `nm.exe` is missing the `cmd /c`, which means the redirection does not work and consequently we're unable to find the function declaration via `nm.exe`, which causes the compilation to fail. In addition to fixing this, I added tests for `DECLARE STATIC LIBRARY` for all supported platforms. Fixes: #112
12 lines
244 B
C
12 lines
244 B
C
|
|
#ifdef WIN32
|
|
# define __export __declspec(dllexport)
|
|
#else
|
|
# define __export __attribute__((visibility("default")))
|
|
#endif
|
|
|
|
/* Simple code to put in a dll, has no dependencies */
|
|
__export int add_values(int v1, int v2)
|
|
{
|
|
return v1 + v2;
|
|
}
|