From b10aaceab07963a4123747b87fd669c24f275166 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Wed, 20 Sep 2023 17:34:42 -0700 Subject: [PATCH] Work on dllimport option for janet. --- build_win.bat | 3 ++- src/include/janet.h | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/build_win.bat b/build_win.bat index aae50a6c..d6c56e97 100644 --- a/build_win.bat +++ b/build_win.bat @@ -64,7 +64,7 @@ rc /nologo /fobuild\janet_win.res janet_win.rc %JANET_LINK% /out:janet.exe build\janet.obj build\shell.obj build\janet_win.res @if errorlevel 1 goto :BUILDFAIL -@rem Build static library (libjanet.a) +@rem Build static library (libjanet.lib) %JANET_LINK_STATIC% /out:build\libjanet.lib build\janet.obj @if errorlevel 1 goto :BUILDFAIL @@ -117,6 +117,7 @@ copy README.md dist\README.md copy janet.lib dist\janet.lib copy janet.exp dist\janet.exp +copy janet.def dist\janet.def janet.exe tools\patch-header.janet src\include\janet.h src\conf\janetconf.h build\janet.h copy build\janet.h dist\janet.h diff --git a/src/include/janet.h b/src/include/janet.h index 37717351..c4e1c8d5 100644 --- a/src/include/janet.h +++ b/src/include/janet.h @@ -237,7 +237,11 @@ extern "C" { /* How to export symbols */ #ifndef JANET_API #ifdef JANET_WINDOWS +#ifdef JANET_DLL_IMPORT +#define JANET_API __declspec(dllimport) +#else #define JANET_API __declspec(dllexport) +#endif #else #define JANET_API __attribute__((visibility ("default"))) #endif