MSVC++ tweaks contributed by Christian Mayer.
This commit is contained in:
parent
a940c7293e
commit
3b0cf518bc
7 changed files with 36 additions and 24 deletions
|
@ -38,11 +38,11 @@
|
|||
#include <plib/ssg.h>
|
||||
|
||||
#include <vector>
|
||||
#include <hash_map>
|
||||
#include <map>
|
||||
#include <plib/fnt.h>
|
||||
|
||||
FG_USING_STD(vector);
|
||||
FG_USING_STD(hash_map);
|
||||
FG_USING_STD(map);
|
||||
|
||||
class FGPanelInstrument;
|
||||
|
||||
|
@ -76,7 +76,7 @@ private:
|
|||
ssgTexture * _bg;
|
||||
|
||||
// Internalization table.
|
||||
hash_map<const char *,ssgTexture *> _textureMap;
|
||||
map<const char *,ssgTexture *> _textureMap;
|
||||
|
||||
// List of instruments in panel.
|
||||
instrument_list_type _instruments;
|
||||
|
|
|
@ -68,7 +68,7 @@ INCLUDES
|
|||
|
||||
#ifndef M_PI
|
||||
/* get a definition for pi */
|
||||
#include <Include/fg_constants.h>
|
||||
#include <simgear/constants.h>
|
||||
#define M_PI FG_PI
|
||||
#endif
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ INCLUDES
|
|||
|
||||
#ifndef M_PI_2
|
||||
/* get a definition for pi */
|
||||
#include <Include/fg_constants.h>
|
||||
#include <simgear/constants.h>
|
||||
#define M_PI_2 FG_PI_2
|
||||
#endif
|
||||
|
||||
|
@ -82,10 +82,12 @@ FGUtility::~FGUtility()
|
|||
|
||||
float FGUtility::ToGeodetic()
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
|
||||
float FGUtility:: FromGeodetic()
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
|
|
|
@ -70,8 +70,8 @@
|
|||
#include <Time/fg_time.hxx>
|
||||
|
||||
#if defined( WIN32 ) && !defined( __CYGWIN__ )
|
||||
# include <Screen/win32-printer.h>
|
||||
# include <Screen/GlBitmaps.h>
|
||||
# include <simgear/screen/win32-printer.h>
|
||||
# include <simgear/screen/GlBitmaps.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -864,7 +864,7 @@ static void rotateView( double roll, double pitch, double yaw )
|
|||
// rotate view
|
||||
}
|
||||
|
||||
static GLBitmap *b1 = NULL;
|
||||
static GlBitmap *b1 = NULL;
|
||||
extern FGInterface cur_view_fdm;
|
||||
GLubyte *hiResScreenCapture( int multiplier )
|
||||
{
|
||||
|
|
|
@ -36,7 +36,9 @@
|
|||
#include <sys/types.h> // for open(), read(), write(), close()
|
||||
#include <sys/stat.h> // for open(), read(), write(), close()
|
||||
#include <fcntl.h> // for open(), read(), write(), close()
|
||||
#include <unistd.h> // for open(), read(), write(), close()
|
||||
#if !defined( _MSC_VER )
|
||||
# include <unistd.h> // for open(), read(), write(), close()
|
||||
#endif
|
||||
|
||||
#include "iochannel.hxx"
|
||||
#include "protocol.hxx"
|
||||
|
|
|
@ -113,7 +113,7 @@ int FGSerial::readline( char *buf, int length ) {
|
|||
// copy to external buffer
|
||||
strncpy( buf, save_buf, result );
|
||||
buf[result] = '\0';
|
||||
cout << "fg_serial line = " << buf << endl;
|
||||
FG_LOG( FG_IO, FG_INFO, "fg_serial line = " << buf );
|
||||
|
||||
// shift save buffer
|
||||
for ( i = result; i < save_len; ++i ) {
|
||||
|
|
|
@ -23,12 +23,20 @@
|
|||
|
||||
#include <simgear/compiler.h>
|
||||
|
||||
#include <sys/time.h> // select()
|
||||
#include <sys/types.h> // socket(), bind(), select(), accept()
|
||||
#include <sys/socket.h> // socket(), bind(), listen(), accept()
|
||||
#include <netinet/in.h> // struct sockaddr_in
|
||||
#include <netdb.h> // gethostbyname()
|
||||
#include <unistd.h> // select(), fsync()/fdatasync()
|
||||
#if ! defined( _MSC_VER )
|
||||
# include <sys/time.h> // select()
|
||||
# include <sys/types.h> // socket(), bind(), select(), accept()
|
||||
# include <sys/socket.h> // socket(), bind(), listen(), accept()
|
||||
# include <netinet/in.h> // struct sockaddr_in
|
||||
# include <netdb.h> // gethostbyname()
|
||||
# include <unistd.h> // select(), fsync()/fdatasync()
|
||||
#else
|
||||
# include <sys/timeb.h> // select()
|
||||
# include <winsock2.h> // socket(), bind(), listen(), accept(),
|
||||
// struct sockaddr_in, gethostbyname()
|
||||
# include <windows.h>
|
||||
# include <io.h>
|
||||
#endif
|
||||
|
||||
#if defined( sgi )
|
||||
#include <strings.h>
|
||||
|
@ -56,7 +64,7 @@ FGSocket::~FGSocket() {
|
|||
int FGSocket::make_server_socket () {
|
||||
struct sockaddr_in name;
|
||||
|
||||
#if defined( __CYGWIN__ ) || defined( __CYGWIN32__ ) || defined( sgi )
|
||||
#if defined( __CYGWIN__ ) || defined( __CYGWIN32__ ) || defined( sgi ) || defined( _MSC_VER )
|
||||
int length;
|
||||
#else
|
||||
socklen_t length;
|
||||
|
@ -154,7 +162,7 @@ bool FGSocket::open( FGProtocol::fgProtocolDir dir ) {
|
|||
// call. A port of "0" indicates that we want to let the os
|
||||
// pick any available port.
|
||||
sock = make_server_socket();
|
||||
cout << "socket is connected to port = " << port << endl;
|
||||
FG_LOG( FG_IO, FG_INFO, "socket is connected to port = " << port );
|
||||
|
||||
// Specify the maximum length of the connection queue
|
||||
listen(sock, FG_MAX_SOCKET_QUEUE);
|
||||
|
@ -231,9 +239,9 @@ int FGSocket::readline( char *buf, int length ) {
|
|||
char *buf_ptr = save_buf + save_len;
|
||||
result = std::read( sock, buf_ptr, FG_MAX_MSG_SIZE - save_len );
|
||||
save_len += result;
|
||||
cout << "current read = " << buf_ptr << endl;
|
||||
cout << "current save_buf = " << save_buf << endl;
|
||||
cout << "save_len = " << save_len << endl;
|
||||
// cout << "current read = " << buf_ptr << endl;
|
||||
// cout << "current save_buf = " << save_buf << endl;
|
||||
// cout << "save_len = " << save_len << endl;
|
||||
}
|
||||
|
||||
// look for the end of line in save_buf
|
||||
|
@ -243,17 +251,17 @@ int FGSocket::readline( char *buf, int length ) {
|
|||
result = i + 1;
|
||||
} else {
|
||||
// no end of line yet
|
||||
cout << "no eol found" << endl;
|
||||
// cout << "no eol found" << endl;
|
||||
return 0;
|
||||
}
|
||||
cout << "line length = " << result << endl;
|
||||
// cout << "line length = " << result << endl;
|
||||
|
||||
// we found an end of line
|
||||
|
||||
// copy to external buffer
|
||||
strncpy( buf, save_buf, result );
|
||||
buf[result] = '\0';
|
||||
cout << "fg_socket line = " << buf << endl;
|
||||
// cout << "fg_socket line = " << buf << endl;
|
||||
|
||||
// shift save buffer
|
||||
for ( i = result; i < save_len; ++i ) {
|
||||
|
|
Loading…
Add table
Reference in a new issue