Init core

This commit is contained in:
Krzosa Karol
2023-12-31 07:44:32 +01:00
commit 11e6559a3c
22 changed files with 10489 additions and 0 deletions

90
preproc_env.h Normal file
View File

@@ -0,0 +1,90 @@
#ifndef PREPROC_ENV_HEADER
#define PREPROC_ENV_HEADER
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#if defined(__APPLE__) && defined(__MACH__)
#define OS_MAC 1
#elif defined(_WIN32)
#define OS_WINDOWS 1
#elif defined(__linux__)
#define OS_POSIX 1
#define OS_LINUX 1
#else
#error Unsupported platform
#endif
#if defined(__clang__)
#define COMPILER_CLANG 1
#elif defined(__GNUC__) || defined(__GNUG__)
#define COMPILER_GCC 1
#elif defined(_MSC_VER)
#define COMPILER_MSVC 1
#elif defined(__TINYC__)
#define COMPILER_TCC 1
#else
#error Unsupported compiler
#endif
#ifdef __cplusplus
#define LANG_CPP 1
#else
#define LANG_C 1
#endif
#ifndef OS_MAC
#define OS_MAC 0
#endif
#ifndef OS_WINDOWS
#define OS_WINDOWS 0
#endif
#ifndef OS_LINUX
#define OS_LINUX 0
#endif
#ifndef OS_POSIX
#define OS_POSIX 0
#endif
#ifndef COMPILER_MSVC
#define COMPILER_MSVC 0
#endif
#ifndef COMPILER_CLANG
#define COMPILER_CLANG 0
#endif
#ifndef COMPILER_GCC
#define COMPILER_GCC 0
#endif
#ifndef COMPILER_TCC
#define COMPILER_TCC 0
#endif
#ifndef LANG_CPP
#define LANG_CPP 0
#endif
#ifndef LANG_C
#define LANG_C 0
#endif
#if COMPILER_MSVC
#define FORCE_INLINE __forceinline
#elif COMPILER_GCC || COMPILER_CLANG
#define FORCE_INLINE __attribute__((always_inline)) inline
#else
#define FORCE_INLINE inline
#endif
// #if COMPILER_CLANG
// #pragma clang diagnostic push
// #pragma clang diagnostic ignored "-Wmicrosoft-enum-forward-reference"
// #endif
#endif // PREPROC_ENV_HEADER