]> git.mxchange.org Git - simgear.git/blobdiff - simgear/io/socktest.cxx
MINGW patch from BenoƮt Laniel
[simgear.git] / simgear / io / socktest.cxx
index 358c32e08bde391bdc55392ba61b589747d480eb..9a4f0cfe7450ad666f2debbda90ac45c88bbcb8a 100644 (file)
@@ -1,20 +1,28 @@
+#ifdef HAVE_CONFIG_H
+#  include <simgear_config.h>
+#endif
+
 #include <simgear/compiler.h>
 
+#ifdef _WIN32
+#include <windows.h>
+#define sleep(x) Sleep(x*1000)
+#else
 #include <unistd.h>
-#include STL_IOSTREAM
+#endif
+#include <iostream>
 
 #include "sg_socket.hxx"
 #include "lowlevel.hxx"
 
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
-SG_USING_STD(cout);
-SG_USING_STD(endl);
-#endif
-
 static const int sgEndianTest = 1;
 #define sgIsLittleEndian (*((char *) &sgEndianTest ) != 0)
 #define sgIsBigEndian    (*((char *) &sgEndianTest ) == 0)
 
+using std::cout;
+using std::endl;
+
+
 int main() {
 
     if ( sgIsLittleEndian ) {
@@ -41,10 +49,6 @@ int main() {
        if ( s.readline( buf, 256 ) > 0 ) {
            cout << "result = " << buf;
        }
-#ifdef __MINGW32__
-       Sleep(100);
-#else
        sleep(1);
-#endif
     }
 }