diff --git a/src/GUI/gui_funcs.cxx b/src/GUI/gui_funcs.cxx index 0428f7304..6b4e86933 100644 --- a/src/GUI/gui_funcs.cxx +++ b/src/GUI/gui_funcs.cxx @@ -54,7 +54,9 @@ # include # include #endif - +#ifdef __MINGW32__ +#include +#endif #include "gui.h" using std::string; diff --git a/src/Input/fgjs.cxx b/src/Input/fgjs.cxx index 918d9df5d..73eed92a9 100644 --- a/src/Input/fgjs.cxx +++ b/src/Input/fgjs.cxx @@ -28,8 +28,8 @@ #include -#ifdef _MSC_VER -#include +#if defined( _MSC_VER ) || defined( __MINGW32__ ) +# include #endif #include diff --git a/src/Main/bootstrap.cxx b/src/Main/bootstrap.cxx index d0871fb0a..734f998c0 100644 --- a/src/Main/bootstrap.cxx +++ b/src/Main/bootstrap.cxx @@ -141,7 +141,7 @@ int main ( int argc, char **argv ) { // Ignore floating-point exceptions on FreeBSD signal(SIGFPE, SIG_IGN); #endif -#ifndef _MSC_VER +#if !defined( _MSC_VER ) && !defined( __MINGW32__ ) signal(SIGPIPE, SIG_IGN); #endif diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 26a942502..08f315a42 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -581,7 +581,7 @@ bool fgInitConfig ( int argc, char **argv ) { } SGPropertyNode autosave; -#ifdef _MSC_VER +#if defined( _MSC_VER ) || defined( __MINGW32__ ) char *envp = ::getenv( "APPDATA" ); if (envp != NULL ) { SGPath config( envp ); diff --git a/src/Network/native_ctrls.cxx b/src/Network/native_ctrls.cxx index b79d711fb..a5816052c 100644 --- a/src/Network/native_ctrls.cxx +++ b/src/Network/native_ctrls.cxx @@ -36,8 +36,10 @@ #include "native_ctrls.hxx" // FreeBSD works better with this included last ... (?) -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined( _MSC_VER ) # include +#elif defined( __MINGW32__ ) +# include #else # include // htonl() ntohl() #endif diff --git a/src/Network/native_fdm.cxx b/src/Network/native_fdm.cxx index 0d499b4e9..16b57d062 100644 --- a/src/Network/native_fdm.cxx +++ b/src/Network/native_fdm.cxx @@ -39,8 +39,10 @@ #include "native_fdm.hxx" // FreeBSD works better with this included last ... (?) -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined( _MSC_VER ) # include +#elif defined( __MINGW32__ ) +# include #else # include // htonl() ntohl() #endif diff --git a/utils/GPSsmooth/UGear_main.cxx b/utils/GPSsmooth/UGear_main.cxx index 66c6cad42..697d17a6c 100644 --- a/utils/GPSsmooth/UGear_main.cxx +++ b/utils/GPSsmooth/UGear_main.cxx @@ -2,7 +2,7 @@ # include #endif -#ifndef _MSC_VER +#if !defined( _MSC_VER ) && !defined( __MINGW32__ ) # include // for bzero() #else # define bzero(a,b) memset(a,0,b)