From 520fe69372381aa171bfdc77b4410bfa2fcd1a82 Mon Sep 17 00:00:00 2001
From: Tim Stahlhut <stahta01@gmail.com>
Date: Wed, 27 Apr 2022 16:52:13 -0400
Subject: code fixes for GNUC CLANG

---
 common/streamwrapper.cpp | 2 +-
 include/streamwrapper.h  | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/common/streamwrapper.cpp b/common/streamwrapper.cpp
index 29cbed7201..e73d48d598 100644
--- a/common/streamwrapper.cpp
+++ b/common/streamwrapper.cpp
@@ -22,7 +22,7 @@
  * @file streamwrapper.cpp
  */
 
-#if !defined( _WIN32 ) || !defined( __GNUC__ )
+#if !defined( _WIN32 ) || !defined( __GNUC__ ) || defined( __clang__ )
     #error streamwrapper.cpp should not be included in this build
 #endif
 
diff --git a/include/streamwrapper.h b/include/streamwrapper.h
index 4fc36f7ff7..dbb350fecf 100644
--- a/include/streamwrapper.h
+++ b/include/streamwrapper.h
@@ -28,7 +28,7 @@
 #include <iostream>
 
 
-#if defined( _WIN32 ) && defined( __GNUC__ )
+#if defined( _WIN32 ) && defined( __GNUC__ ) && !defined( __clang__ )
 #include <ext/stdio_filebuf.h>
 
 #define OSTREAM std::ostream
@@ -75,7 +75,7 @@ public:
 } // namespace kicad
 
 
-#elif defined( _MSC_VER ) // defined( _WIN32 ) && defined( __GNUC__ )
+#elif defined( _MSC_VER ) // defined( _WIN32 ) && defined( __GNUC__ ) && !defined( __clang__ )
 
 #define OSTREAM std::ofstream
 
@@ -96,7 +96,7 @@ public:
 
 #define CLOSE_STREAM( var ) var.close()
 
-#else // defined( _WIN32 ) && defined( __GNUC__ )
+#else // defined( _WIN32 ) && defined( __GNUC__ ) && !defined( __clang__ )
 
 #define OSTREAM std::ofstream
 
@@ -114,6 +114,6 @@ public:
 
 #define CLOSE_STREAM( var ) var.close()
 
-#endif // defined( _WIN32 ) && defined( __GNUC__ )
+#endif // defined( _WIN32 ) && defined( __GNUC__ ) && !defined( __clang__ )
 
 #endif  // STREAMWRAPPER_H
-- 
