Clean up.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
#ifndef CORE_H
|
||||
#define CORE_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* ---- Switches ------------------------------------------------------- */
|
||||
|
||||
#ifndef BUILD_DEBUG
|
||||
@@ -18,7 +16,7 @@
|
||||
/* Architecture */
|
||||
|
||||
#ifndef ARCHITECTURE_X64
|
||||
#define ARCHITECTURE_X64 0
|
||||
#define ARCHITECTURE_X64 1
|
||||
#endif
|
||||
|
||||
#ifndef ARCHITECTURE_X86
|
||||
@@ -33,24 +31,12 @@
|
||||
#define ARCHITECTURE_ARM32 0
|
||||
#endif
|
||||
|
||||
#if defined(__x86_64__) || defined(__x86_64) || defined(__amd64__) || defined(__amd64) || defined(_M_AMD64)
|
||||
#undef ARCHITECTURE_X64
|
||||
#define ARCHITECTURE_X64 1
|
||||
#elif defined(i386) || defined(__i386) || defined(__i386__) || defined(_M_I86)
|
||||
#undef ARCHITECTURE_X86
|
||||
#define ARCHITECTURE_X86 1
|
||||
#elif defined(__aarch64__)
|
||||
#undef ARCHITECTURE_ARM64
|
||||
#define ARCHITECTURE_ARM64 1
|
||||
#elif defined(__arm__)
|
||||
#undef ARCHITECTURE_ARM32
|
||||
#define ARCHITECTURE_ARM32 1
|
||||
#else
|
||||
#error Unknown architecture . . .
|
||||
#endif
|
||||
|
||||
/* OS */
|
||||
|
||||
#ifndef OS_LINUX
|
||||
#define OS_LINUX 1
|
||||
#endif
|
||||
|
||||
#ifndef OS_WINDOWS
|
||||
#define OS_WINDOWS 0
|
||||
#endif
|
||||
@@ -59,81 +45,26 @@
|
||||
#define OS_MACOS 0
|
||||
#endif
|
||||
|
||||
#ifndef OS_LINUX
|
||||
#define OS_LINUX 0
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
#undef OS_WINDOWS
|
||||
#define OS_WINDOWS 1
|
||||
#elif defined(__APPLE__) && defined(__MACH__)
|
||||
#undef OS_MACOS
|
||||
#define OS_MACOS 1
|
||||
#elif defined(__linux__)
|
||||
#undef OS_LINUX
|
||||
#define OS_LINUX 1
|
||||
#else
|
||||
#error Unknown operating system . . .
|
||||
#endif
|
||||
|
||||
/* Compiler */
|
||||
|
||||
#ifndef COMPILER_CLANG
|
||||
#define COMPILER_CLANG 1
|
||||
#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
|
||||
|
||||
#if _MSC_VER
|
||||
#undef COMPILER_MSVC
|
||||
#define COMPILER_MSVC 1
|
||||
#elif __clang__
|
||||
#undef COMPILER_CLANG
|
||||
#define COMPILER_CLANG 1
|
||||
#elif __GNUC__
|
||||
#undef COMPILER_GCC
|
||||
#define COMPILER_GCC 1
|
||||
#else
|
||||
#error Unknown compiler . . .
|
||||
#endif
|
||||
|
||||
/* ---- Types ---------------------------------------------------------- */
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
typedef uint8_t U8;
|
||||
typedef uint16_t U16;
|
||||
typedef uint32_t U32;
|
||||
typedef uint64_t U64;
|
||||
typedef int8_t S8;
|
||||
typedef int16_t S16;
|
||||
typedef int32_t S32;
|
||||
typedef int64_t S64;
|
||||
typedef S8 B8;
|
||||
typedef S16 B16;
|
||||
typedef S32 B32;
|
||||
typedef S64 B64;
|
||||
typedef float F32;
|
||||
typedef double F64;
|
||||
|
||||
/* ---- Units ---------------------------------------------------------- */
|
||||
|
||||
#define KB(n) (((U64)(n)) << 10)
|
||||
#define MB(n) (((U64)(n)) << 20)
|
||||
#define GB(n) (((U64)(n)) << 30)
|
||||
#define TB(n) (((U64)(n)) << 40)
|
||||
#define KB(n) (((unsigned long long)(n)) << 10)
|
||||
#define MB(n) (((unsigned long long)(n)) << 20)
|
||||
#define GB(n) (((unsigned long long)(n)) << 30)
|
||||
#define TB(n) (((unsigned long long)(n)) << 40)
|
||||
|
||||
/* ---- Clamps, Min/Max ------------------------------------------------ */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user