aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymaekers Luca <luca@spacehb.net>2025-11-15 15:45:16 +0100
committerRaymaekers Luca <luca@spacehb.net>2025-11-15 15:52:55 +0100
commit87746741590ba49daaf400961778e4cbee38a2e3 (patch)
tree2952544b8117808eb02db8425209cc1fe675340e
parentc7cc8bfc22fa34f44e3db61f136bf75ae4dd6aa5 (diff)
checkpoint
-rw-r--r--handmade_platform.h49
-rw-r--r--linux_handmade.cpp1
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 <stdint.h>
#include <stddef.h>
+ // 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;
}