Index: simgear/compiler.h
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/compiler.h,v
retrieving revision 1.33
diff -u -r1.33 compiler.h
--- simgear/compiler.h	31 Oct 2009 08:46:46 -0000	1.33
+++ simgear/compiler.h	7 Jan 2010 17:50:12 -0000
@@ -63,6 +63,7 @@
 #  if _MSC_VER >= 1200  // msvc++ 6.0 or greater
 #    define isnan _isnan
 #    define snprintf _snprintf
+#    define vsnprintf _vsnprintf
 #    define copysign _copysign
 
 #    pragma warning(disable: 4786) // identifier was truncated to '255' characters
@@ -158,10 +159,6 @@
 #  include <ieeefp.h>		// isnan
 #endif
 
-#if defined(__MINGW32__)
-#  define isnan(x) _isnan(x)
-#endif
-
 
 //
 // No user modifiable definitions beyond here.
Index: simgear/debug/logstream.cxx
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/debug/logstream.cxx,v
retrieving revision 1.8
diff -u -r1.8 logstream.cxx
--- simgear/debug/logstream.cxx	29 Nov 2008 00:17:29 -0000	1.8
+++ simgear/debug/logstream.cxx	7 Jan 2010 17:50:12 -0000
@@ -27,7 +27,7 @@
 logstream *logstream::global_logstream = 0;
 
 bool            logbuf::logging_enabled = true;
-#ifdef _MSC_VER
+#ifdef _WIN32
    bool         logbuf::has_console = true;
 #endif
 sgDebugClass    logbuf::logClass        = SG_NONE;
Index: simgear/debug/logstream.hxx
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/debug/logstream.hxx,v
retrieving revision 1.18
diff -u -r1.18 logstream.hxx
--- simgear/debug/logstream.hxx	24 Mar 2009 08:09:16 -0000	1.18
+++ simgear/debug/logstream.hxx	7 Jan 2010 17:50:12 -0000
@@ -27,7 +27,7 @@
 
 #include <simgear/compiler.h>
 
-#ifdef _MSC_VER
+#ifdef _WIN32
 #  include <windows.h>
 #endif
 
@@ -123,7 +123,7 @@
      */
     void set_sb( std::streambuf* sb );
 
-#ifdef _MSC_VER
+#ifdef _WIN32
     static void has_no_console() { has_console = false; }
 #endif
 
@@ -142,7 +142,7 @@
     static std::streambuf* sbuf;
 
     static bool logging_enabled;
-#ifdef _MSC_VER
+#ifdef _WIN32
     static bool has_console;
 #endif
     static sgDebugClass logClass;
@@ -176,7 +176,7 @@
 inline logbuf::int_type
 logbuf::overflow( int c )
 {
-#ifdef _MSC_VER
+#ifdef _WIN32
     if ( logging_enabled ) {
         if ( !has_console ) {
             AllocConsole();
Index: simgear/environment/metar.cxx
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/environment/metar.cxx,v
retrieving revision 1.17
diff -u -r1.17 metar.cxx
--- simgear/environment/metar.cxx	7 Jun 2008 14:45:22 -0000	1.17
+++ simgear/environment/metar.cxx	7 Jan 2010 17:50:12 -0000
@@ -159,7 +159,7 @@
 {
 	struct tm now;
 	time_t now_sec = time(0);
-#if defined( _MSC_VER ) || defined ( __MINGW32__ )
+#ifdef _WIN32
 	now = *gmtime(&now_sec);
 #else
 	gmtime_r(&now_sec, &now);
Index: simgear/io/Makefile.am
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/io/Makefile.am,v
retrieving revision 1.7
diff -u -r1.7 Makefile.am
--- simgear/io/Makefile.am	16 Sep 2009 17:01:58 -0000	1.7
+++ simgear/io/Makefile.am	7 Jan 2010 17:50:12 -0000
@@ -71,7 +71,7 @@
 	$(top_builddir)/simgear/debug/libsgdebug.a \
 	$(top_builddir)/simgear/bucket/libsgbucket.a \
 	$(top_builddir)/simgear/misc/libsgmisc.a \
-        $(socktest_PLIB_LIBS) -lz
+        $(socktest_PLIB_LIBS) -lz \
 	$(network_LIBS) \
 	$(base_LIBS) 
 
Index: simgear/io/sg_file.cxx
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/io/sg_file.cxx,v
retrieving revision 1.13
diff -u -r1.13 sg_file.cxx
--- simgear/io/sg_file.cxx	7 Aug 2008 22:24:01 -0000	1.13
+++ simgear/io/sg_file.cxx	7 Jan 2010 17:50:12 -0000
@@ -25,7 +25,7 @@
 
 #include <string>
 
-#if defined(_MSC_VER) || defined(__MINGW32__)
+#ifdef _WIN32
 #  include <io.h>
 #endif
 
@@ -55,7 +55,7 @@
     set_dir( d );
 
     if ( get_dir() == SG_IO_OUT ) {
-#if defined(_MSC_VER) || defined(__MINGW32__)
+#ifdef _WIN32
         int mode = 00666;
 #else
         mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
Index: simgear/io/socktest.cxx
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/io/socktest.cxx,v
retrieving revision 1.5
diff -u -r1.5 socktest.cxx
--- simgear/io/socktest.cxx	28 Jul 2008 07:52:14 -0000	1.5
+++ simgear/io/socktest.cxx	7 Jan 2010 17:50:12 -0000
@@ -2,6 +2,13 @@
 #  include <simgear_config.h>
 #endif
 
+#ifdef _WIN32
+#include <windows.h>
+#define sleep(x) Sleep(x*1000)
+#else
+#include <unistd.h>
+#endif
+
 #include <simgear/compiler.h>
 
 #include <unistd.h>
@@ -44,10 +51,6 @@
 	if ( s.readline( buf, 256 ) > 0 ) {
 	    cout << "result = " << buf;
 	}
-#ifdef __MINGW32__
-	Sleep(100);
-#else
 	sleep(1);
-#endif
     }
 }
Index: simgear/misc/sg_path.cxx
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/misc/sg_path.cxx,v
retrieving revision 1.24
diff -u -r1.24 sg_path.cxx
--- simgear/misc/sg_path.cxx	24 Jul 2008 19:16:51 -0000	1.24
+++ simgear/misc/sg_path.cxx	7 Jan 2010 17:50:12 -0000
@@ -29,7 +29,7 @@
 #include <stdio.h>
 #include <sys/stat.h>
 #include <sys/stat.h>
-#if defined( _MSC_VER) || defined(__MINGW32__)
+#ifdef _WIN32
 #  include <direct.h>
 #endif
 #include "sg_path.hxx"
@@ -42,7 +42,7 @@
 static const char sgDirPathSep = '/';
 static const char sgDirPathSepBad = '\\';
 
-#if defined( WIN32 ) && !defined(__CYGWIN__)
+#ifdef _WIN32
 static const char sgSearchPathSep = ';';
 #else
 static const char sgSearchPathSep = ':';
@@ -181,7 +181,7 @@
     return true;
 }
 
-#if defined( _MSC_VER) || defined(__MINGW32__)
+#ifdef _WIN32
 #  define sgMkDir(d,m)       _mkdir(d)
 #else
 #  define sgMkDir(d,m)       mkdir(d,m)
@@ -199,7 +199,7 @@
     unsigned int i = 1;
     SGPath dir = absolute ? string( 1, sgDirPathSep ) : "";
     dir.concat( path_elements[0] );
-#if defined( _MSC_VER) || defined(__MINGW32__)
+#ifdef _WIN32
     if ( dir.str().find(':') != string::npos && path_elements.size() >= 2 ) {
         dir.append( path_elements[1] );
         i = 2;
Index: simgear/nasal/code.c
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/nasal/code.c,v
retrieving revision 1.22
diff -u -r1.22 code.c
--- simgear/nasal/code.c	30 Sep 2008 16:48:36 -0000	1.22
+++ simgear/nasal/code.c	7 Jan 2010 17:50:12 -0000
@@ -20,10 +20,6 @@
 void printStackDEBUG(naContext ctx);
 ////////////////////////////////////////////////////////////////////////
 
-#ifdef _MSC_VER
-#define vsnprintf _vsnprintf
-#endif
-
 struct Globals* globals = 0;
 
 static naRef bindFunction(naContext ctx, struct Frame* f, naRef code);
Index: simgear/nasal/iolib.c
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/nasal/iolib.c,v
retrieving revision 1.9
diff -u -r1.9 iolib.c
--- simgear/nasal/iolib.c	19 Feb 2009 20:41:36 -0000	1.9
+++ simgear/nasal/iolib.c	7 Jan 2010 17:50:12 -0000
@@ -195,14 +195,16 @@
     return result;
 }
 
+#ifdef _WIN32
+#define S_ISLNK(m) 0
+#define S_ISSOCK(m) 0
+#endif
 #ifdef _MSC_VER
 #define S_ISREG(m) (((m)&_S_IFMT)==_S_IFREG)
 #define S_ISDIR(m) (((m)&_S_IFMT)==_S_IFDIR)
 #define S_ISCHR(m) (((m)&_S_IFMT)==_S_IFCHR)
 #define S_ISFIFO(m) (((m)&_S_IFMT)==_S_IFIFO)
 #define S_ISBLK(m) 0
-#define S_ISLNK(m) 0
-#define S_ISSOCK(m) 0
 typedef unsigned short mode_t;
 #endif
 static naRef ftype(naContext ctx, mode_t m)
Index: simgear/nasal/lib.c
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/nasal/lib.c,v
retrieving revision 1.25
diff -u -r1.25 lib.c
--- simgear/nasal/lib.c	26 Sep 2008 18:22:12 -0000	1.25
+++ simgear/nasal/lib.c	7 Jan 2010 17:50:13 -0000
@@ -4,11 +4,6 @@
 #include <stdarg.h>
 #include <string.h>
 
-#ifdef _MSC_VER // sigh...
-#define snprintf _snprintf
-#define vsnprintf _vsnprintf
-#endif
-
 #include "nasal.h"
 #include "code.h"
 
Index: simgear/screen/GLBitmaps.cxx
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/screen/GLBitmaps.cxx,v
retrieving revision 1.6
diff -u -r1.6 GLBitmaps.cxx
--- simgear/screen/GLBitmaps.cxx	17 Apr 2006 11:29:02 -0000	1.6
+++ simgear/screen/GLBitmaps.cxx	7 Jan 2010 17:50:13 -0000
@@ -2,11 +2,7 @@
 #  include <simgear_config.h>
 #endif
 
-#if defined(__CYGWIN__)  /* && !defined(USING_X) */
-#define WIN32
-#endif
-
-#if defined(WIN32)  /* MINGW and MSC predefine WIN32 */
+#ifdef WIN32
 # include <windows.h>
 #endif
 
Index: simgear/screen/RenderTexture.cpp
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/screen/RenderTexture.cpp,v
retrieving revision 1.28
diff -u -r1.28 RenderTexture.cpp
--- simgear/screen/RenderTexture.cpp	20 Aug 2009 15:24:32 -0000	1.28
+++ simgear/screen/RenderTexture.cpp	7 Jan 2010 17:50:14 -0000
@@ -39,9 +39,6 @@
 * Implementation of class RenderTexture.  A multi-format render to 
 * texture wrapper.
 */
-#ifdef _MSC_VER
-#pragma warning(disable:4786)
-#endif
 
 /*
  * Changelog:
@@ -339,11 +336,7 @@
     char strBuffer[512];
     va_list args;
     va_start(args, strMsg);
-#if defined _WIN32 && !defined __CYGWIN__
-    _vsnprintf( strBuffer, 512, strMsg, args );
-#else
     vsnprintf( strBuffer, 512, strMsg, args );
-#endif
     va_end(args);
     
     SG_LOG(SG_GL, SG_ALERT, strMsg);
@@ -1055,11 +1048,7 @@
     va_list args;
     char strBuffer[256];
     va_start(args,strMode);
-#if defined _WIN32 && !defined __CYGWIN__
-    _vsnprintf( strBuffer, 256, strMode, args );
-#else
     vsnprintf( strBuffer, 256, strMode, args );
-#endif
     va_end(args);
 
     _ParseModeString(strBuffer, _pixelFormatAttribs, _pbufferAttribs);
Index: simgear/screen/extensions.hxx
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/screen/extensions.hxx,v
retrieving revision 1.34
diff -u -r1.34 extensions.hxx
--- simgear/screen/extensions.hxx	27 Jul 2008 18:04:13 -0000	1.34
+++ simgear/screen/extensions.hxx	7 Jan 2010 17:50:14 -0000
@@ -24,11 +24,7 @@
 #ifndef __SG_EXTENSIONS_HXX
 #define __SG_EXTENSIONS_HXX 1
 
-#if defined(__CYGWIN__) && !defined(WIN32) /* && !defined(USING_X) */
-#define WIN32
-#endif
-
-#if defined(WIN32)  /* MINGW and MSC predefine WIN32 */
+#ifdef WIN32
 # include <windows.h>
 #endif
 
Index: simgear/screen/screen-dump.cxx
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/screen/screen-dump.cxx,v
retrieving revision 1.11
diff -u -r1.11 screen-dump.cxx
--- simgear/screen/screen-dump.cxx	6 Oct 2009 20:05:46 -0000	1.11
+++ simgear/screen/screen-dump.cxx	7 Jan 2010 17:50:14 -0000
@@ -23,11 +23,7 @@
 #  include <simgear_config.h>
 #endif
 
-#if defined(__CYGWIN__)  /* && !defined(USING_X) */
-#define WIN32
-#endif
-
-#if defined(WIN32)  /* MINGW and MSC predefine WIN32 */
+#ifdef WIN32
 # include <windows.h>
 #endif
 
Index: simgear/serial/serial.cxx
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/serial/serial.cxx,v
retrieving revision 1.12
diff -u -r1.12 serial.cxx
--- simgear/serial/serial.cxx	25 Jul 2008 18:35:42 -0000	1.12
+++ simgear/serial/serial.cxx	7 Jan 2010 17:50:15 -0000
@@ -26,7 +26,7 @@
 #include <iostream>
 #include <cerrno>
 
-#if !defined( WIN32 ) || defined( __CYGWIN__) || defined( __CYGWIN32__ )
+#ifndef _WIN32
 #  include <termios.h>
 #  include <sys/types.h>
 #  include <sys/stat.h>
@@ -60,7 +60,7 @@
 
 bool SGSerialPort::open_port(const string& device) {
 
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
+#ifdef _WIN32
 
     fd = CreateFile( device.c_str(),
         GENERIC_READ | GENERIC_WRITE,
@@ -147,7 +147,7 @@
 
 
 bool SGSerialPort::close_port() {
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
+#ifdef _WIN32
     CloseHandle( fd );
 #else
     close(fd);
@@ -161,7 +161,7 @@
 
 bool SGSerialPort::set_baud(int baud) {
 
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
+#ifdef _WIN32
 
     DCB dcb;
     if ( GetCommState( fd, &dcb ) ) {
@@ -274,7 +274,7 @@
     char buffer[max_count+1];
     string result;
 
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
+#ifdef _WIN32
 
     DWORD count;
     if ( ReadFile( fd, buffer, max_count, &count, 0 ) ) {
@@ -326,7 +326,7 @@
 
 int SGSerialPort::read_port(char *buf, int len) {
 
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
+#ifdef _WIN32
 
     DWORD count;
     if ( ReadFile( fd, buf, len, &count, 0 ) ) {
@@ -383,7 +383,7 @@
 
 int SGSerialPort::write_port(const string& value) {
 
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
+#ifdef _WIN32
 
     LPCVOID lpBuffer = value.data();
     DWORD nNumberOfBytesToWrite = value.length();
@@ -457,7 +457,7 @@
 
 
 int SGSerialPort::write_port(const char* buf, int len) {
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
+#ifdef _WIN32
 
     LPCVOID lpBuffer = buf;
     DWORD nNumberOfBytesToWrite = len;
Index: simgear/serial/serial.hxx
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/serial/serial.hxx,v
retrieving revision 1.7
diff -u -r1.7 serial.hxx
--- simgear/serial/serial.hxx	28 Jul 2008 07:52:15 -0000	1.7
+++ simgear/serial/serial.hxx	7 Jan 2010 17:50:15 -0000
@@ -32,7 +32,7 @@
 # error This library requires C++
 #endif
 
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
+#ifdef _WIN32
 #  include <windows.h>
 #endif
 
@@ -49,7 +49,7 @@
  */
 class SGSerialPort
 {
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
+#ifdef  _WIN32
     typedef HANDLE fd_type;
 #else
     typedef int fd_type;
Index: simgear/sound/openal_test1.cxx
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/sound/openal_test1.cxx,v
retrieving revision 1.13
diff -u -r1.13 openal_test1.cxx
--- simgear/sound/openal_test1.cxx	22 Oct 2009 08:32:04 -0000	1.13
+++ simgear/sound/openal_test1.cxx	7 Jan 2010 17:50:15 -0000
@@ -1,11 +1,10 @@
 #include <stdio.h>
 
-#ifdef __MINGW32__
-// This is broken, but allows the file to compile without a POSIX
-// environment.
-static unsigned int sleep(unsigned int secs) { return 0; }
+#ifdef _WIN32
+#include <windows.h>
+#define sleep(x) Sleep(x*1000)
 #else
-#include <unistd.h>	// sleep()
+#include <unistd.h>
 #endif
 
 #if defined( __APPLE__ )
Index: simgear/structure/SGAtomic.hxx
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/structure/SGAtomic.hxx,v
retrieving revision 1.6
diff -u -r1.6 SGAtomic.hxx
--- simgear/structure/SGAtomic.hxx	17 Jul 2009 10:11:34 -0000	1.6
+++ simgear/structure/SGAtomic.hxx	7 Jan 2010 17:50:15 -0000
@@ -28,7 +28,7 @@
 #elif defined(__sgi) && defined(_COMPILER_VERSION) && (_COMPILER_VERSION>=730)
 // No need to include something. Is a Compiler API ...
 # define SGATOMIC_USE_MIPSPRO_BUILTINS
-#elif defined(WIN32)  && !defined ( __CYGWIN__ )
+#elif defined(_WIN32)
 # include <windows.h>
 # define SGATOMIC_USE_WIN32_INTERLOCKED
 #else
Index: simgear/timing/timestamp.cxx
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/timing/timestamp.cxx,v
retrieving revision 1.11
diff -u -r1.11 timestamp.cxx
--- simgear/timing/timestamp.cxx	13 Mar 2009 07:33:38 -0000	1.11
+++ simgear/timing/timestamp.cxx	7 Jan 2010 17:50:15 -0000
@@ -59,7 +59,7 @@
 #include "timestamp.hxx"
 
 void SGTimeStamp::stamp() {
-#if defined( WIN32 ) && !defined(__CYGWIN__)
+#ifdef _WIN32
     unsigned int t;
     t = timeGetTime();
     _sec = t / 1000;
