From 1b703834481374f6cb49d5c86468a73470f0dcbd Mon Sep 17 00:00:00 2001 From: Karutoh Date: Sun, 21 Jul 2024 10:45:06 -0700 Subject: [PATCH] Started dynamic library support. --- include/ehs/Str.h | 6 +++--- include/ehs/system/OS.h | 13 +++++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/include/ehs/Str.h b/include/ehs/Str.h index b56485c..367d9c6 100644 --- a/include/ehs/Str.h +++ b/include/ehs/Str.h @@ -1892,9 +1892,9 @@ namespace ehs } }; - typedef Str Str_32; - typedef Str Str_16; - typedef Str Str_8; + EHS_LIB_IO typedef Str Str_32; + EHS_LIB_IO typedef Str Str_16; + EHS_LIB_IO typedef Str Str_8; } template diff --git a/include/ehs/system/OS.h b/include/ehs/system/OS.h index fe5db29..d5bc370 100644 --- a/include/ehs/system/OS.h +++ b/include/ehs/system/OS.h @@ -1,11 +1,19 @@ #pragma once #if defined(_WIN32) || defined(_WIN64) -#define EHS_OS_WINDOWS + #define EHS_OS_WINDOWS #define EHS_FILE __FILE__ #define EHS_FUNC __FUNCTION__ #define EHS_LINE __LINE__ + #if defined(EHS_EXPORT) + #define EHS_LIB_IO __declspec(dllexport) + #elif defined(EHS_IMPORT) + #define EHS_LIB_IO __declspec(dllimport) + #else + #define EHS_LIB_IO + #endif + #ifndef NOMINMAX #define NOMINMAX #endif @@ -22,6 +30,7 @@ #define EHS_FILE __FILE__ #define EHS_FUNC __FUNCTION__ #define EHS_LINE __LINE__ + #define EHS_LIB_IO -typedef int Handle; + typedef int Handle; #endif \ No newline at end of file