X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fio%2Fsocktest.cxx;h=9a4f0cfe7450ad666f2debbda90ac45c88bbcb8a;hb=72bb9f4d5d6d861902a5779381e4ebe977db1df1;hp=76ce67e5f765c533f88cd29ee6adccf2084bdf2b;hpb=1e6069805396dd487464ad6ca1178f033585eb6c;p=simgear.git diff --git a/simgear/io/socktest.cxx b/simgear/io/socktest.cxx index 76ce67e5..9a4f0cfe 100644 --- a/simgear/io/socktest.cxx +++ b/simgear/io/socktest.cxx @@ -1,9 +1,42 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#ifdef _WIN32 +#include +#define sleep(x) Sleep(x*1000) +#else #include +#endif +#include #include "sg_socket.hxx" +#include "lowlevel.hxx" + +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 ) { + cout << "this machine is little endian\n"; + } + + if ( sgIsBigEndian ) { + cout << "this machine is big endian\n"; + } + + cout << "short = " << sizeof(unsigned short) << endl; + cout << "int = " << sizeof(unsigned int) << endl; + cout << "long long = " << sizeof(long long) << endl; + SGSocket s( "", "5500", "tcp" ); if ( !s.open( SG_IO_BI ) ) {