diff --git a/projects/VC90/GPSsmooth/GPSsmooth.vcproj b/projects/VC90/GPSsmooth/GPSsmooth.vcproj index b1b37fc75..d804c8d6a 100644 --- a/projects/VC90/GPSsmooth/GPSsmooth.vcproj +++ b/projects/VC90/GPSsmooth/GPSsmooth.vcproj @@ -46,7 +46,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90\OpenSceneGraph\include;..\..\..\..\3rdParty\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -126,7 +126,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90-64\OpenSceneGraph\include;..\..\..\..\3rdParty.x64\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -204,7 +204,7 @@ #endif +#ifdef HAVE_WINDOWS_H +# include +#endif + #include #include -#include #include #include #include // endian tests #include #include +#include #include #include @@ -27,7 +31,7 @@ using std::string; // Network channels -static netSocket fdm_sock, ctrls_sock; +static simgear::Socket fdm_sock, ctrls_sock; // midg data MIDGTrack track; @@ -394,7 +398,7 @@ int main( int argc, char **argv ) { // Setup up outgoing network connections - netInit( &argc,argv ); // We must call this before any other net stuff + simgear::Socket::initSockets(); // We must call this before any other net stuff if ( ! fdm_sock.open( false ) ) { // open a UDP socket cout << "error opening fdm output socket" << endl; diff --git a/utils/GPSsmooth/UGear_main.cxx b/utils/GPSsmooth/UGear_main.cxx index e814c2e07..faf5d725f 100644 --- a/utils/GPSsmooth/UGear_main.cxx +++ b/utils/GPSsmooth/UGear_main.cxx @@ -2,6 +2,10 @@ # include #endif +#ifdef HAVE_WINDOWS_H +# include +#endif + #ifndef _WIN32 # include // for bzero() #else @@ -10,12 +14,12 @@ #include #include -#include #include #include #include // endian tests #include +#include #include #include #include @@ -35,7 +39,7 @@ using std::string; // Network channels -static netSocket fdm_sock, ctrls_sock, opengc_sock; +static simgear::Socket fdm_sock, ctrls_sock, opengc_sock; // ugear data UGTrack track; @@ -658,7 +662,7 @@ int main( int argc, char **argv ) { // Setup up outgoing network connections - netInit( &argc,argv ); // We must call this before any other net stuff + simgear::Socket::initSockets(); // We must call this before any other net stuff if ( ! opengc_sock.open( false ) ) { // open a UDP socket cout << "error opening opengc output socket" << endl; diff --git a/utils/GPSsmooth/UGear_telnet.cxx b/utils/GPSsmooth/UGear_telnet.cxx index 602a6a9d8..be5b02e9f 100644 --- a/utils/GPSsmooth/UGear_telnet.cxx +++ b/utils/GPSsmooth/UGear_telnet.cxx @@ -23,14 +23,13 @@ // $Id$ +#include #include #include #include #include -#include - #include "UGear_command.hxx" #include "UGear_telnet.hxx" @@ -41,9 +40,9 @@ using std::ends; * Props connection class. * This class represents a connection to props client. */ -class PropsChannel : public netChat +class PropsChannel : public simgear::NetChat { - netBuffer buffer; + simgear::NetBuffer buffer; /** * Current property node name. @@ -188,9 +187,9 @@ UGTelnet::open() return false; } - netChannel::open(); - netChannel::bind( "", port ); - netChannel::listen( 5 ); + simgear::NetChannel::open(); + simgear::NetChannel::bind( "", port ); + simgear::NetChannel::listen( 5 ); printf("Telnet server started on port %d\n", port ); enabled = true; @@ -214,7 +213,7 @@ UGTelnet::close() bool UGTelnet::process() { - netChannel::poll(); + simgear::NetChannel::poll(); return true; } @@ -224,8 +223,8 @@ UGTelnet::process() void UGTelnet::handleAccept() { - netAddress addr; - int handle = netChannel::accept( &addr ); + simgear::IPAddress addr; + int handle = simgear::NetChannel::accept( &addr ); printf("Telent server accepted connection from %s:%d\n", addr.getHost(), addr.getPort() ); PropsChannel* channel = new PropsChannel(); diff --git a/utils/GPSsmooth/UGear_telnet.hxx b/utils/GPSsmooth/UGear_telnet.hxx index 34500a5c9..15e88633e 100644 --- a/utils/GPSsmooth/UGear_telnet.hxx +++ b/utils/GPSsmooth/UGear_telnet.hxx @@ -33,7 +33,7 @@ using std::string; using std::vector; -#include +#include /** @@ -41,7 +41,7 @@ using std::vector; * This class provides a telnet-like server for remote access to * FlightGear properties. */ -class UGTelnet: netChannel +class UGTelnet: simgear::NetChannel { private: diff --git a/utils/GPSsmooth/gps_main.cxx b/utils/GPSsmooth/gps_main.cxx index f5a10d7ac..1b98b04a3 100644 --- a/utils/GPSsmooth/gps_main.cxx +++ b/utils/GPSsmooth/gps_main.cxx @@ -2,13 +2,17 @@ # include #endif +#ifdef HAVE_WINDOWS_H +# include +#endif + #include #include -#include #include #include // endian tests +#include #include #include @@ -23,7 +27,7 @@ using std::string; // Network channels -static netSocket fdm_sock, ctrls_sock; +static simgear::Socket fdm_sock, ctrls_sock; // gps data GPSTrack track; @@ -369,7 +373,7 @@ int main( int argc, char **argv ) { // Setup up outgoing network connections - netInit( &argc,argv ); // We must call this before any other net stuff + simgear::Socket::initSockets(); // We must call this before any other net stuff if ( ! fdm_sock.open( false ) ) { // open a UDP socket cout << "error opening fdm output socket" << endl;