From 87746741590ba49daaf400961778e4cbee38a2e3 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sat, 15 Nov 2025 15:45:16 +0100 Subject: checkpoint --- handmade_platform.h | 49 ++++++++++++++++++++++++++++++++++++------------- linux_handmade.cpp | 1 + 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/handmade_platform.h b/handmade_platform.h index bc3f84a..4e7dc60 100644 --- a/handmade_platform.h +++ b/handmade_platform.h @@ -22,29 +22,52 @@ extern "C" { #include #include + // Zero #if !defined(COMPILER_MSVC) -#define COMPILER_MSVC 0 +# define COMPILER_MSVC 0 #endif - #if !defined(COMPILER_LLVM) -#define COMPILER_LLVM 0 +# define COMPILER_LLVM 0 #endif - #if !defined(COMPILER_GNU) -#define COMPILER_GNU 0 +# define COMPILER_GNU 0 #endif -#if !COMPILER_MSVC && !COMPILER_LLVM && !COMPILER_GNU -#if _MSC_VER -#undef COMPILER_MSVC -#define COMPILER_MSVC 1 + // Detect compiler +#if __clang__ +# undef COMPILER_CLANG +# define COMPILER_CLANG 1 +#elif _MSC_VER +# undef COMPILER_MSVC +# define COMPILER_MSVC 1 #elif __GNUC__ -#undef COMPILER_GNU -#define COMPILER_GNU 1 +# undef COMPILER_GNU +# define COMPILER_GNU 1 +#else +# error "Could not detect compiler." +#endif + +#if __MINGW32__ +# define COMPILER_MINGW 1 +#endif + + // Push/Pop warnings +#if defined(COMPILER_GNU) +# define PUSH_WARNINGS \ +_Pragma("GCC diagnostic push") \ +_Pragma("GCC diagnostic ignored \"-Weverything\"") \ +_Pragma("GCC diagnostic ignored \"-Wconversion\"") +# define POP_WARNINGS _Pragma("GCC diagnostic pop") + +#elif defined(COMPILER_CLANG) +# define PUSH_WARNINGS \ +_Pragma("clang diagnostic push") \ +_Pragma("clang diagnostic ignored \"-Weverything\"") +# define POP_WARNINGS _Pragma("clang diagnostic pop") + #else - // TODO(casey): More compilerz!!! +# error "No compatible compiler found" #endif -#endif #define internal static #define local_persist static diff --git a/linux_handmade.cpp b/linux_handmade.cpp index 7340efc..f4784e9 100644 --- a/linux_handmade.cpp +++ b/linux_handmade.cpp @@ -1842,5 +1842,6 @@ TODO { // TODO: Log could not get x connection } + return 0; } -- cgit v1.2.3-70-g09d2