diff --git a/src/windows/FSNodeWINDOWS.cxx b/src/windows/FSNodeWINDOWS.cxx index 0fecc3e1c..c8676e542 100644 --- a/src/windows/FSNodeWINDOWS.cxx +++ b/src/windows/FSNodeWINDOWS.cxx @@ -18,16 +18,8 @@ #include #pragma warning( disable : 4091 ) #include - -#ifdef ARRAYSIZE - #undef ARRAYSIZE -#endif - #include #include -#include -// winnt.h defines ARRAYSIZE, but we want our own one... -#undef ARRAYSIZE // F_OK, R_OK and W_OK are not defined under MSVC, so we define them here // For more information on the modes used by MSVC, check: @@ -44,6 +36,7 @@ #define W_OK 2 #endif +#include "Windows.hxx" #include "FSNodeWINDOWS.hxx" /** diff --git a/src/windows/SerialPortWINDOWS.cxx b/src/windows/SerialPortWINDOWS.cxx index 8ec755091..a9b738c7c 100644 --- a/src/windows/SerialPortWINDOWS.cxx +++ b/src/windows/SerialPortWINDOWS.cxx @@ -15,8 +15,7 @@ // this file, and for a DISCLAIMER OF ALL WARRANTIES. //============================================================================ -#include - +#include "Windows.hxx" #include "SerialPortWINDOWS.hxx" // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/windows/SerialPortWINDOWS.hxx b/src/windows/SerialPortWINDOWS.hxx index 8c2215c51..1fcc2882e 100644 --- a/src/windows/SerialPortWINDOWS.hxx +++ b/src/windows/SerialPortWINDOWS.hxx @@ -18,8 +18,7 @@ #ifndef SERIALPORT_WINDOWS_HXX #define SERIALPORT_WINDOWS_HXX -#include - +#include "Windows.hxx" #include "SerialPort.hxx" /** diff --git a/src/windows/Windows.hxx b/src/windows/Windows.hxx new file mode 100644 index 000000000..3c45cfcf2 --- /dev/null +++ b/src/windows/Windows.hxx @@ -0,0 +1,33 @@ +//============================================================================ +// +// SSSS tt lll lll +// SS SS tt ll ll +// SS tttttt eeee ll ll aaaa +// SSSS tt ee ee ll ll aa +// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" +// SS SS tt ee ll ll aa aa +// SSSS ttt eeeee llll llll aaaaa +// +// Copyright (c) 1995-2020 by Bradford W. Mott, Stephen Anthony +// and the Stella Team +// +// See the file "License.txt" for information on usage and redistribution of +// this file, and for a DISCLAIMER OF ALL WARRANTIES. +//============================================================================ + +#ifndef WINDOWS_LIB_HXX +#define WINDOWS_LIB_HXX + +/* + Using window.h directly can cause problems, since it's a C library + that doesn't support namespacing, etc. + + Anyone needing 'windows.h' should include this file instead. +*/ + +#include + +#undef MessageBox +#undef ARRAYSIZE + +#endif // WINDOWS_LIB_HXX