aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCharlie Root <root@dec05eba.my.domain>2018-09-30 23:44:13 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-06 07:39:33 +0200
commit0b09e97d0d6163b5a898f5642505ee12dd5ef30e (patch)
tree6464ce5279090cf99aa957aaca1faf68c50db095 /include
parent147188af8356d21fb9720308ef4912e1f3a22a15 (diff)
Add OpenBSD support
Diffstat (limited to 'include')
-rw-r--r--include/Conf.hpp31
-rw-r--r--include/env.hpp16
2 files changed, 39 insertions, 8 deletions
diff --git a/include/Conf.hpp b/include/Conf.hpp
index 7e5bf69..8fa3475 100644
--- a/include/Conf.hpp
+++ b/include/Conf.hpp
@@ -120,7 +120,10 @@ namespace sibs
PLATFORM_WIN64,
PLATFORM_MACOS32,
- PLATFORM_MACOS64
+ PLATFORM_MACOS64,
+
+ PLATFORM_OPENBSD32,
+ PLATFORM_OPENBSD64
};
enum class CVersion
@@ -174,7 +177,15 @@ namespace sibs
"config.macos64",
"config.macos64.static.debug",
- "config.macos64.static.release"
+ "config.macos64.static.release",
+
+ "config.openbsd32",
+ "config.openbsd32.static.debug",
+ "config.openbsd32.static.release",
+
+ "config.openbsd64",
+ "config.openbsd64.static.debug",
+ "config.openbsd64.static.release"
};
const int NUM_CONFIGS = 12;
@@ -226,6 +237,22 @@ namespace sibs
#endif
#define CONFIG_STATIC_LIB_FILE_EXTENSION "a"
#define CONFIG_DYNAMIC_LIB_FILE_EXTENSION "dylib"
+ #elif OS_TYPE == OS_TYPE_OPENBSD
+ #ifdef SIBS_ENV_32BIT
+ const Platform SYSTEM_PLATFORM = PLATFORM_OPENBSD32;
+ #define SYSTEM_PLATFORM_NAME "openbsd32"
+ #define CONFIG_SYSTEM_PLATFORM 18
+ #define CONFIG_STATIC_DEBUG_PLATFORM 19
+ #define CONFIG_STATIC_RELEASE_PLATFORM 20
+ #else
+ const Platform SYSTEM_PLATFORM = PLATFORM_OPENBSD64;
+ #define SYSTEM_PLATFORM_NAME "openbsd64"
+ #define CONFIG_SYSTEM_PLATFORM 21
+ #define CONFIG_STATIC_DEBUG_PLATFORM 22
+ #define CONFIG_STATIC_RELEASE_PLATFORM 23
+ #endif
+ #define CONFIG_STATIC_LIB_FILE_EXTENSION "a"
+ #define CONFIG_DYNAMIC_LIB_FILE_EXTENSION "so"
#endif
bool containsPlatform(const std::vector<Platform> &platforms, Platform platform);
diff --git a/include/env.hpp b/include/env.hpp
index fa9c860..33e8068 100644
--- a/include/env.hpp
+++ b/include/env.hpp
@@ -7,6 +7,7 @@
#define OS_TYPE_WINDOWS 0
#define OS_TYPE_LINUX 1
#define OS_TYPE_APPLE 2
+#define OS_TYPE_OPENBSD 2
#if defined(_WIN32) || defined(_WIN64)
#if defined(_WIN64)
@@ -32,18 +33,21 @@
#include <Windows.h>
#endif
-#if defined(__linux__) || defined(__unix__) || defined(__APPLE__) || defined(_POSIX_VERSION)
- #define OS_FAMILY OS_FAMILY_POSIX
-#endif
-
#ifdef __linux__
+ #define OS_FAMILY OS_FAMILY_POSIX
#define OS_TYPE OS_TYPE_LINUX
#endif
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__MACOSX__)
+ #define OS_FAMILY OS_FAMILY_POSIX
#define OS_TYPE OS_TYPE_APPLE
#endif
+#ifdef __OpenBSD__
+ #define OS_FAMILY OS_FAMILY_POSIX
+ #define OS_TYPE OS_TYPE_OPENBSD
+#endif
+
#if defined(__GNUC__)
#if defined(__x86_64__) || defined(__pc64__)
#define SIBS_ENV_64BIT
@@ -61,7 +65,7 @@
#endif
#if !defined(OS_TYPE)
- #error "System not supported. Only Windows and linux systems supported right now"
+ #error "System not supported. Only Windows, linux, macos and openbsd systems supported right now"
#endif
#if !defined(DEBUG) && !defined(NDEBUG)