From 0d766189500382edbfc5e62092f0b238dbc22fbe Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 14 Aug 2001 22:18:19 +0000 Subject: [PATCH] Various tweaks for mingwin32. --- src/Cockpit/radiostack.cxx | 2 +- src/GUI/Makefile.am | 8 +++++++- src/GUI/gui.cxx | 12 ++++++------ src/GUI/mouse.cxx | 5 ----- src/Input/fgjs.cxx | 3 +++ 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/Cockpit/radiostack.cxx b/src/Cockpit/radiostack.cxx index 9c1facff0..c07cc6f31 100644 --- a/src/Cockpit/radiostack.cxx +++ b/src/Cockpit/radiostack.cxx @@ -1072,7 +1072,7 @@ void FGRadioStack::search() if ( current_navlist->query( lon, lat, elev, adf_freq, &nav ) ) { char freq[128]; -#if defined( _MSC_VER ) +#if defined( _MSC_VER ) || defined(__MINGW32__) _snprintf( freq, 10, "%.0f", adf_freq ); #else snprintf( freq, 10, "%.0f", adf_freq ); diff --git a/src/GUI/Makefile.am b/src/GUI/Makefile.am index 7165a5654..6dfeae80c 100644 --- a/src/GUI/Makefile.am +++ b/src/GUI/Makefile.am @@ -1,11 +1,17 @@ noinst_LIBRARIES = libGUI.a +if ENABLE_NETWORK_OLK +NETWORK_SRCS = net_dlg.cxx net_dlg.hxx +else +NETWORK_SRCS = +endif + libGUI_a_SOURCES = \ apt_dlg.cxx apt_dlg.hxx \ gui.cxx gui.h \ gui_local.cxx gui_local.hxx \ mouse.cxx \ - net_dlg.cxx net_dlg.hxx \ + $(NETWORK_SRCS) \ sgVec3Slider.cxx sgVec3Slider.hxx \ trackball.c trackball.h diff --git a/src/GUI/gui.cxx b/src/GUI/gui.cxx index 853b9516d..58db573ce 100644 --- a/src/GUI/gui.cxx +++ b/src/GUI/gui.cxx @@ -75,7 +75,7 @@ #include #endif -#if defined( WIN32 ) && !defined( __CYGWIN__ ) +#if defined( WIN32 ) && !defined( __CYGWIN__ ) && !defined(__MINGW32__) # include # include #endif @@ -92,7 +92,7 @@ SG_USING_STD(string); SG_USING_STD(cout); #endif -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__MINGW32__) #define snprintf _snprintf #endif /* _MSC_VER */ @@ -672,7 +672,7 @@ void fgHiResDump() #endif // #if defined( TR_HIRES_SNAP) -#if defined( WIN32 ) && !defined( __CYGWIN__) +#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__) static void rotateView( double roll, double pitch, double yaw ) { @@ -711,7 +711,7 @@ GLubyte *hiResScreenCapture( int multiplier ) #endif -#if defined( WIN32 ) && !defined( __CYGWIN__) +#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__) // win32 print screen function void printScreen ( puObject *obj ) { bool show_pu_cursor = false; @@ -843,7 +843,7 @@ The menu stuff ---------------------------------------------------------------------*/ char *fileSubmenu [] = { "Exit", /* "Close", "---------", */ -#if defined( WIN32 ) && !defined( __CYGWIN__) +#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__) "Print", #endif "Snap Shot", @@ -856,7 +856,7 @@ char *fileSubmenu [] = { }; puCallback fileSubmenuCb [] = { MayBeGoodBye, /* hideMenuCb, NULL, */ -#if defined( WIN32 ) && !defined( __CYGWIN__) +#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__) printScreen, #endif /* NULL, notCb, */ diff --git a/src/GUI/mouse.cxx b/src/GUI/mouse.cxx index fd7311f76..8ecb10733 100644 --- a/src/GUI/mouse.cxx +++ b/src/GUI/mouse.cxx @@ -68,11 +68,6 @@ #include
#include
-#if defined( WIN32 ) && !defined( __CYGWIN__ ) -# include -# include -#endif - #include "gui.h" #include "gui_local.hxx" diff --git a/src/Input/fgjs.cxx b/src/Input/fgjs.cxx index 7631dd162..691c9df1a 100644 --- a/src/Input/fgjs.cxx +++ b/src/Input/fgjs.cxx @@ -36,6 +36,9 @@ SG_USING_STD(ios); #endif SG_USING_STD(string); +#if defined(_MSC_VER) || defined(__MINGW32__) +#define snprintf _snprintf +#endif string axes_humannames[8] = { "elevator", "ailerons", "rudder", "throttle", "mixture","propller pitch", "lateral view", -- 2.39.2