From 7cc3ffb30fe6e36d679b40d4373a5e4b7bc4fc32 Mon Sep 17 00:00:00 2001
From: Frederic Bouvier <fredfgfs01@free.fr>
Date: Fri, 8 Feb 2013 08:46:34 +0100
Subject: [PATCH] Fix build for windows after logstream changes

---
 src/GUI/gui_funcs.cxx      | 4 ++++
 src/Main/bootstrap.cxx     | 1 -
 src/Main/locale.cxx        | 4 ++++
 src/Scripting/NasalSys.cxx | 6 +++++-
 4 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/GUI/gui_funcs.cxx b/src/GUI/gui_funcs.cxx
index fa4488c42..a68ce578a 100644
--- a/src/GUI/gui_funcs.cxx
+++ b/src/GUI/gui_funcs.cxx
@@ -30,6 +30,10 @@
 #  include <config.h>
 #endif
 
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+
 #include <simgear/compiler.h>
 
 #include <fstream>
diff --git a/src/Main/bootstrap.cxx b/src/Main/bootstrap.cxx
index 399f83540..4eff67b5b 100644
--- a/src/Main/bootstrap.cxx
+++ b/src/Main/bootstrap.cxx
@@ -125,7 +125,6 @@ int main ( int argc, char **argv );
 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
                              LPSTR lpCmdLine, int nCmdShow) {
 
-  logbuf::has_no_console();
   main( __argc, __argv );
 }
 #endif
diff --git a/src/Main/locale.cxx b/src/Main/locale.cxx
index 43ff26ef3..680ee68bd 100644
--- a/src/Main/locale.cxx
+++ b/src/Main/locale.cxx
@@ -18,6 +18,10 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA.
 
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
 #ifdef HAVE_WINDOWS_H
 #include <windows.h>
 #endif
diff --git a/src/Scripting/NasalSys.cxx b/src/Scripting/NasalSys.cxx
index 2c98f6369..6ae142a75 100644
--- a/src/Scripting/NasalSys.cxx
+++ b/src/Scripting/NasalSys.cxx
@@ -3,6 +3,10 @@
 #  include "config.h"
 #endif
 
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+
 #ifdef HAVE_SYS_TIME_H
 #  include <sys/time.h>  // gettimeofday
 #endif
@@ -330,7 +334,7 @@ static naRef f_logprint(naContext c, naRef me, int argc, naRef* args)
     if(naIsNil(s)) continue;
     buf += naStr_data(s);
   }
-  SG_LOG(SG_NASAL, (sgDebugPriority) priority.num, buf);
+  SG_LOG(SG_NASAL, (sgDebugPriority)(int) priority.num, buf);
   return naNum(buf.length());
 }