From a41a82feabe0e7ab1579ca4b9ee6695a08aa0059 Mon Sep 17 00:00:00 2001
From: Sadie <zulc22db+oss@gmail.com>
Date: Tue, 29 Oct 2024 19:35:24 -0700
Subject: [PATCH 1/2] Fix building of libweaver under MSYS2

---
 lib/file.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/file.cpp b/lib/file.cpp
index a4ce05c..495c08c 100644
--- a/lib/file.cpp
+++ b/lib/file.cpp
@@ -1,11 +1,18 @@
 #include "file.h"
 
 #ifdef _WIN32
+
+#ifndef NOMINMAX
 #define NOMINMAX
+#endif
+
 #include <Windows.h>
+
 #else
+
 #include <fstream>
 #define FSTR(x) static_cast<std::fstream*>(x)
+
 #endif
 
 namespace si {

From ee1ff8b888b98fc60b3dfc5fd1a6cf01f225b3b5 Mon Sep 17 00:00:00 2001
From: Sadie <zulc22db+oss@gmail.com>
Date: Thu, 31 Oct 2024 08:11:34 -0700
Subject: [PATCH 2/2] Add arbitrary default case so that GCC doesn't fail with
 a warning-as-error that CMake won't let me ignore when I embed the library

---
 lib/file.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/file.cpp b/lib/file.cpp
index 495c08c..00c215b 100644
--- a/lib/file.cpp
+++ b/lib/file.cpp
@@ -106,6 +106,7 @@ void File::seek(File::pos_t p, SeekMode s)
 
   DWORD m;
   switch (s) {
+  default:
   case SeekStart:
     m = FILE_BEGIN;
     break;