From 124b739bde37d95b0fa26ae24d0bf7b5fe001a54 Mon Sep 17 00:00:00 2001 From: folling Date: Sun, 5 Jan 2025 14:26:55 +0100 Subject: [PATCH] fixup IKA_API os detection Signed-off-by: Folling --- include/ikarus/macros.h | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/include/ikarus/macros.h b/include/ikarus/macros.h index e7714dc..a54809b 100644 --- a/include/ikarus/macros.h +++ b/include/ikarus/macros.h @@ -1,23 +1,28 @@ #pragma once -#define IKA_API +#if defined(_WIN32) + #define IKA_OS_FAMILY_WINDOWS + #define IKA_OS_WIN + #define IKA_API __declspec(dllexport) +#else + #define IKA_OS_FAMILY_UNIX + #define IKA_API __attribute__((visibility("default"))) -#if defined(__unix__) - #define IKA_OS_FAMILY_UNIX - #define IKA_API __attribute__((visibility("default"))) + #if defined(linux) + #define IKA_OS_LINUX + #elif defined(__APPLE__) + #define IKA_OS_MAC + #endif +#endif - #if defined(linux) - #define IKA_OS_LINUX - #endif -#elif defined(_WIN32) - #define IKA_OS_WIN - #define IKA_API __declspec(dllexport) +#ifndef IKA_API + #define IKA_API #endif #ifdef __cplusplus - #define IKARUS_BEGIN_HEADER extern "C" { - #define IKARUS_END_HEADER } + #define IKARUS_BEGIN_HEADER extern "C" { + #define IKARUS_END_HEADER } #else - #define IKARUS_BEGIN_HEADER - #define IKARUS_END_HEADER + #define IKARUS_BEGIN_HEADER + #define IKARUS_END_HEADER #endif