]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/metar_main.cxx
Support for multiple data dirs.
[flightgear.git] / src / Main / metar_main.cxx
index 7b904d3a245f492f97246ca1a2613c766926557e..9158dc89a1ec891d2ec1112003f2c3f44fb76e4a 100644 (file)
@@ -26,6 +26,7 @@
 #include <string.h>
 #include <time.h>
 #include <cstdlib>
+#include <cstdio>
 
 #include <simgear/debug/logstream.hxx>
 #include <simgear/environment/metar.hxx>
@@ -33,6 +34,7 @@
 
 #include <simgear/io/HTTPClient.hxx>
 #include <simgear/io/HTTPRequest.hxx>
+#include <simgear/io/raw_socket.hxx>
 #include <simgear/timing/timestamp.hxx>
 
 using namespace std;
@@ -328,7 +330,7 @@ void printReport(SGMetar *m)
                        surface.push_back(buf);
                }
 
-               if (surface.size()) {
+               if (! surface.empty()) {
                        vector<string>::iterator rwysurf = surface.begin();
                        for (i = 0; rwysurf != surface.end(); rwysurf++, i++) {
                                if (i)
@@ -547,6 +549,8 @@ int main(int argc, char *argv[])
        string proxy_host, proxy_port;
        getproxy(proxy_host, proxy_port);
 
+  Socket::initSockets();
+  
     HTTP::Client http;
     http.setProxy(proxy_host, atoi(proxy_port.c_str()));