2 # include <simgear_config.h>
5 #include <simgear/compiler.h>
10 #include "sg_socket.hxx"
11 #include "lowlevel.hxx"
13 static const int sgEndianTest = 1;
14 #define sgIsLittleEndian (*((char *) &sgEndianTest ) != 0)
15 #define sgIsBigEndian (*((char *) &sgEndianTest ) == 0)
23 if ( sgIsLittleEndian ) {
24 cout << "this machine is little endian\n";
27 if ( sgIsBigEndian ) {
28 cout << "this machine is big endian\n";
31 cout << "short = " << sizeof(unsigned short) << endl;
32 cout << "int = " << sizeof(unsigned int) << endl;
33 cout << "long long = " << sizeof(long long) << endl;
35 SGSocket s( "", "5500", "tcp" );
37 if ( !s.open( SG_IO_BI ) ) {
38 cout << "error can't open socket\n";
44 if ( s.readline( buf, 256 ) > 0 ) {
45 cout << "result = " << buf;