diff options
| author | Fabrice <fabrice@schaub-dev.xyz> | 2026-04-16 17:01:13 +0200 |
|---|---|---|
| committer | Fabrice <fabrice@schaub-dev.xyz> | 2026-04-16 17:01:13 +0200 |
| commit | 4748386b4e22a5bfe0c4d3f0d65c43f37e09536e (patch) | |
| tree | 5fc64c585470ea15f93b4168ef846a447e2e0538 /omni/platform.h | |
| parent | 70dfff41ce5d50264ca419724c038e8acc8df753 (diff) | |
progress on the allocator
Diffstat (limited to 'omni/platform.h')
| -rw-r--r-- | omni/platform.h | 147 |
1 files changed, 66 insertions, 81 deletions
diff --git a/omni/platform.h b/omni/platform.h index 5410f6d..b762791 100644 --- a/omni/platform.h +++ b/omni/platform.h @@ -1,5 +1,5 @@ #ifndef OMNI_PLATFORM_H -# define OMNI_PLATFORM_H +#define OMNI_PLATFORM_H /* * @@ -7,20 +7,17 @@ * */ -# undef OMNI_CC_MSVC -# undef OMNI_CC_GNU +#if defined(_MSC_VER) +# define OMNI_CC_MSVC +#endif -# if defined(_MSC_VER) -# define OMNI_CC_MSVC -# endif +#if defined(__GNUC__) || defined(__clang__) +# define OMNI_CC_GNU +#endif -# if defined(__GNUC__) || defined(__clang__) -# define OMNI_CC_GNU -# endif - -# if !defined(OMNI_CC_GNU) && !defined(OMNI_CC_MSVC) -# error "compiler not supported" -# endif +#if !defined(OMNI_CC_GNU) && !defined(OMNI_CC_MSVC) +# error "compiler not supported" +#endif /* * @@ -28,34 +25,29 @@ * */ -# undef OMNI_ARCH_X86 -# undef OMNI_ARCH_ARM -# undef OMNI_ARCH_64BIT -# undef OMNI_ARCH_32BIT - -# if defined(__i386__) || defined(_M_IX86) -# define OMNI_ARCH_X86 -# define OMNI_ARCH_32BIT -# endif +#if defined(__i386__) || defined(_M_IX86) +# define OMNI_ARCH_X86 +# define OMNI_ARCH_32BIT +#endif -# if defined(__x86_64__) || defined(_M_X64) -# define OMNI_ARCH_X86 -# define OMNI_ARCH_64BIT -# endif +#if defined(__x86_64__) || defined(_M_X64) +# define OMNI_ARCH_X86 +# define OMNI_ARCH_64BIT +#endif -# if defined(__arm__) || defined(_M_ARM) -# define OMNI_ARCH_ARM -# define OMNI_ARCH_32BIT -# endif +#if defined(__arm__) || defined(_M_ARM) +# define OMNI_ARCH_ARM +# define OMNI_ARCH_32BIT +#endif -# if defined(__aarch64__) || defined(_M_ARM64) || defined(__arm64__) -# define OMNI_ARCH_ARM -# define OMNI_ARCH_64BIT -# endif +#if defined(__aarch64__) || defined(_M_ARM64) || defined(__arm64__) +# define OMNI_ARCH_ARM +# define OMNI_ARCH_64BIT +#endif -# if !defined(OMNI_ARCH_X86) && !defined(OMNI_ARCH_ARM) -# error "target architecture is not supported" -# endif +#if !defined(OMNI_ARCH_X86) && !defined(OMNI_ARCH_ARM) +# error "target architecture is not supported" +#endif /* * @@ -63,33 +55,28 @@ * */ -# undef OMNI_OS_WIN -# undef OMNI_OS_LINUX -# undef OMNI_OS_FREEBSD -# undef OMNI_OS_OSX +#if defined(_WIN32) || defined(_WIN64) +# define OMNI_OS_WIN +#endif -# if defined(_WIN32) || defined(_WIN64) -# define OMNI_OS_WIN -# endif +#if defined(__linux__) +# define OMNI_OS_LINUX +# define OMNI_OS_UNIX +#endif -# if defined(__linux__) -# define OMNI_OS_LINUX -# define OMNI_OS_UNIX -# endif +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +# define OMNI_OS_FREEBSD +# define OMNI_OS_UNIX +#endif -# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) -# define OMNI_OS_FREEBSD -# define OMNI_OS_UNIX -# endif +#if defined(__APPLE__) && defined(__MACH__) +# define OMNI_OS_OSX +# define OMNI_OS_UNIX +#endif -# if defined(__APPLE__) && defined(__MACH__) -# define OMNI_OS_OSX -# define OMNI_OS_UNIX -# endif - -# if !defined(OMNI_OS_UNIX) && !defined(OMNI_OS_WIN) -# error "target os not supported" -# endif +#if !defined(OMNI_OS_UNIX) && !defined(OMNI_OS_WIN) +# error "target os not supported" +#endif /* * @@ -98,29 +85,27 @@ * */ -# undef OMNI_CXX_VER_MIN -# undef OMNI_CXX_VER -# undef OMNI_CC_VER - -# define OMNI_CC_VER __STDC_VERSION__ +#define OMNI_CC_VER __STDC_VERSION__ -# if defined(OMNI_CC_MSVC) -# if defined(_MSVC_LANG) -# define OMNI_CXX_VER _MSVC_LANG -# else -# define OMNI_CXX_VER 0 -# endif +#if defined(OMNI_CC_MSVC) +# if defined(_MSVC_LANG) +# define OMNI_CXX_VER _MSVC_LANG +# else +# define OMNI_CXX_VER 0 # endif +#endif -# if defined(OMNI_CC_GNU) -# if defined(__cplusplus) -# define OMNI_CXX_VER __cplusplus -# else -# define OMNI_CXX_VER 0 -# endif +#if defined(OMNI_CC_GNU) +# if defined(__cplusplus) +# define OMNI_CXX_VER __cplusplus +# else +# define OMNI_CXX_VER 0 # endif +#endif -# define OMNI_CXX_VER_MIN 201103L -# if OMNI_CXX_VER_MIN > OMNI_CXX_VER -# error "atleast C++11 is required" -# endif +#define OMNI_CXX_VER_MIN 201103L +#if OMNI_CXX_VER_MIN > OMNI_CXX_VER +# error "atleast C++11 is required" +#endif + +#endif |
