kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #38056
[PATCH 3/3] Use _WIN32, not WIN32
The latter is non-standard and not guaranteed to be available
---
3d-viewer/3d_cache/3d_cache.cpp | 2 +-
3d-viewer/3d_cache/3d_plugin_manager.cpp | 2 +-
common/streamwrapper.cpp | 2 +-
include/kicad_curl/kicad_curl.h | 2 +-
include/streamwrapper.h | 8 ++++----
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/3d-viewer/3d_cache/3d_cache.cpp b/3d-viewer/3d_cache/3d_cache.cpp
index 63e21a7049..65f7cd40f5 100644
--- a/3d-viewer/3d_cache/3d_cache.cpp
+++ b/3d-viewer/3d_cache/3d_cache.cpp
@@ -369,7 +369,7 @@ bool S3D_CACHE::getSHA1( const wxString& aFileName, unsigned char* aSHA1Sum )
return false;
}
- #ifdef WIN32
+ #ifdef _WIN32
FILE* fp = _wfopen( aFileName.wc_str(), L"rb" );
#else
FILE* fp = fopen( aFileName.ToUTF8(), "rb" );
diff --git a/3d-viewer/3d_cache/3d_plugin_manager.cpp b/3d-viewer/3d_cache/3d_plugin_manager.cpp
index 52f2cef613..03270e960e 100644
--- a/3d-viewer/3d_cache/3d_plugin_manager.cpp
+++ b/3d-viewer/3d_cache/3d_plugin_manager.cpp
@@ -490,7 +490,7 @@ SCENEGRAPH* S3D_PLUGIN_MANAGER::Load3DModel( const wxString& aFileName, std::str
wxFileName raw( aFileName );
wxString ext = raw.GetExt();
- #ifdef WIN32
+ #ifdef _WIN32
// note: plugins only have a lowercase filter within Windows; including an uppercase
// filter will result in duplicate file entries and should be avoided.
ext.LowerCase();
diff --git a/common/streamwrapper.cpp b/common/streamwrapper.cpp
index 2e265f9ca9..9e0d1366e5 100644
--- a/common/streamwrapper.cpp
+++ b/common/streamwrapper.cpp
@@ -21,7 +21,7 @@
* @file streamwrapper.cpp
*/
-#if !defined( WIN32 ) || !defined( __GNUC__ )
+#if !defined( _WIN32 ) || !defined( __GNUC__ )
#error streamwrapper.cpp should not be included in this build
#endif
diff --git a/include/kicad_curl/kicad_curl.h b/include/kicad_curl/kicad_curl.h
index 51655a9cce..351eff7b20 100644
--- a/include/kicad_curl/kicad_curl.h
+++ b/include/kicad_curl/kicad_curl.h
@@ -31,7 +31,7 @@
* Because we are before wx, we must explicitly define we are building with unicode.
* wxWidgets defaults to supporting unicode now, so this should be safe.
*/
-#if defined(WIN32)
+#if defined(_WIN32)
#ifndef UNICODE
# define UNICODE
#endif
diff --git a/include/streamwrapper.h b/include/streamwrapper.h
index c35c2bf740..cc25a01bfb 100644
--- a/include/streamwrapper.h
+++ b/include/streamwrapper.h
@@ -27,7 +27,7 @@
#include <iostream>
-#if defined( WIN32 ) && defined( __GNUC__ )
+#if defined( _WIN32 ) && defined( __GNUC__ )
#include <ext/stdio_filebuf.h>
#define OSTREAM std::ostream
@@ -73,7 +73,7 @@
}
-#elif defined( _MSC_VER ) // defined( WIN32 ) && defined( __GNUC__ )
+#elif defined( _MSC_VER ) // defined( _WIN32 ) && defined( __GNUC__ )
#define OSTREAM std::ofstream
@@ -94,7 +94,7 @@
#define CLOSE_STREAM( var ) var.close()
-#else // defined( WIN32 ) && defined( __GNUC__ )
+#else // defined( _WIN32 ) && defined( __GNUC__ )
#define OSTREAM std::ofstream
@@ -112,6 +112,6 @@
#define CLOSE_STREAM( var ) var.close()
-#endif // defined( WIN32 ) && defined( __GNUC__ )
+#endif // defined( _WIN32 ) && defined( __GNUC__ )
#endif // STREAMWRAPPER_H
Follow ups
References