1 #include <simgear/compiler.h>
6 #include "sg_socket.hxx"
7 #include "lowlevel.hxx"
9 #if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
14 static const int sgEndianTest = 1;
15 #define sgIsLittleEndian (*((char *) &sgEndianTest ) != 0)
16 #define sgIsBigEndian (*((char *) &sgEndianTest ) == 0)
20 if ( sgIsLittleEndian ) {
21 cout << "this machine is little endian\n";
24 if ( sgIsBigEndian ) {
25 cout << "this machine is big endian\n";
28 cout << "short = " << sizeof(unsigned short) << endl;
29 cout << "int = " << sizeof(unsigned int) << endl;
30 cout << "long long = " << sizeof(long long) << endl;
32 SGSocket s( "", "5500", "tcp" );
34 if ( !s.open( SG_IO_BI ) ) {
35 cout << "error can't open socket\n";
41 if ( s.readline( buf, 256 ) > 0 ) {
42 cout << "result = " << buf;