AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
+AC_PROG_CXXCPP
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_LN_S
dnl CygWin under Windoze.
INCLUDES="$INCLUDES -I/usr/local/include/"
LIBS="$LIBS -L/usr/local/lib"
- AC_SEARCH_LIBS(alGenBuffers, [ openal32 openal ] )
+ AC_SEARCH_LIBS(alGenBuffers, [ openal32 openal 'openal -ldsound -lwinmm' ] )
AC_SEARCH_LIBS(alutInit, [ openal32 ALut alut ] )
LIBS="$LIBS -lwinmm -ldsound -ldxguid -lole32"
openal_LIBS="$LIBS"
>
</File>
</Filter>
+ <File
+ RelativePath="..\..\simgear\compiler.h"
+ >
+ </File>
<File
RelativePath="..\..\simgear\simgear_config.h-msvc90"
>
-if HAVE_THREADS
-SGTHREAD_DIR = threads
-else
-SGTHREAD_DIR =
-endif
-
# METAR_DIRS =
METAR_DIRS = environment
screen \
serial \
sound \
- $(SGTHREAD_DIR) \
+ threads \
timing
DIST_SUBDIRS = $(SUBDIRS) compatibility
# if _MSC_VER >= 1200 // msvc++ 6.0 or greater
# define isnan _isnan
# define snprintf _snprintf
+# if _MSC_VER < 1500
+# define vsnprintf _vsnprintf
+# endif
# define copysign _copysign
# pragma warning(disable: 4786) // identifier was truncated to '255' characters
# include <ieeefp.h> // isnan
#endif
-#if defined(__MINGW32__)
-# define isnan(x) _isnan(x)
-#endif
-
//
// No user modifiable definitions beyond here.
logstream *logstream::global_logstream = 0;
bool logbuf::logging_enabled = true;
-#ifdef _MSC_VER
+#ifdef _WIN32
bool logbuf::has_console = true;
#endif
sgDebugClass logbuf::logClass = SG_NONE;
#include <simgear/compiler.h>
-#ifdef _MSC_VER
+#ifdef _WIN32
# include <windows.h>
#endif
*/
void set_sb( std::streambuf* sb );
-#ifdef _MSC_VER
+#ifdef _WIN32
static void has_no_console() { has_console = false; }
#endif
static std::streambuf* sbuf;
static bool logging_enabled;
-#ifdef _MSC_VER
+#ifdef _WIN32
static bool has_console;
#endif
static sgDebugClass logClass;
inline logbuf::int_type
logbuf::overflow( int c )
{
-#ifdef _MSC_VER
+#ifdef _WIN32
if ( logging_enabled ) {
if ( !has_console ) {
AllocConsole();
{
struct tm now;
time_t now_sec = time(0);
-#if defined( _MSC_VER ) || defined ( __MINGW32__ )
+#ifdef _WIN32
now = *gmtime(&now_sec);
#else
gmtime_r(&now_sec, &now);
$(top_builddir)/simgear/debug/libsgdebug.a \
$(top_builddir)/simgear/bucket/libsgbucket.a \
$(top_builddir)/simgear/misc/libsgmisc.a \
- $(socktest_PLIB_LIBS) -lz
+ $(socktest_PLIB_LIBS) -lz \
$(network_LIBS) \
$(base_LIBS)
#include <string>
-#if defined(_MSC_VER) || defined(__MINGW32__)
+#ifdef _WIN32
# include <io.h>
#endif
set_dir( d );
if ( get_dir() == SG_IO_OUT ) {
-#if defined(_MSC_VER) || defined(__MINGW32__)
+#ifdef _WIN32
int mode = 00666;
#else
mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
#include <simgear/compiler.h>
+#ifdef _WIN32
+#include <windows.h>
+#define sleep(x) Sleep(x*1000)
+#else
#include <unistd.h>
+#endif
#include <iostream>
#include "sg_socket.hxx"
if ( s.readline( buf, 256 ) > 0 ) {
cout << "result = " << buf;
}
-#ifdef __MINGW32__
- Sleep(100);
-#else
sleep(1);
-#endif
}
}
#ifndef SGVec2_H
#define SGVec2_H
-#if defined ( __CYGWIN__ )
-#include <ieeefp.h>
-#endif
-
#ifndef NO_OPENSCENEGRAPH_INTERFACE
#include <osg/Vec2f>
#include <osg/Vec2d>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/stat.h>
-#if defined( _MSC_VER) || defined(__MINGW32__)
+#ifdef _WIN32
# include <direct.h>
#endif
#include "sg_path.hxx"
static const char sgDirPathSep = '/';
static const char sgDirPathSepBad = '\\';
-#if defined( WIN32 ) && !defined(__CYGWIN__)
+#ifdef _WIN32
static const char sgSearchPathSep = ';';
#else
static const char sgSearchPathSep = ':';
return true;
}
-#if defined( _MSC_VER) || defined(__MINGW32__)
+#ifdef _WIN32
# define sgMkDir(d,m) _mkdir(d)
#else
# define sgMkDir(d,m) mkdir(d,m)
unsigned int i = 1;
SGPath dir = absolute ? string( 1, sgDirPathSep ) : "";
dir.concat( path_elements[0] );
-#if defined( _MSC_VER) || defined(__MINGW32__)
+#ifdef _WIN32
if ( dir.str().find(':') != string::npos && path_elements.size() >= 2 ) {
dir.append( path_elements[1] );
i = 2;
void printStackDEBUG(naContext ctx);
////////////////////////////////////////////////////////////////////////
-#ifdef _MSC_VER
-#define vsnprintf _vsnprintf
-#endif
-
struct Globals* globals = 0;
static naRef bindFunction(naContext ctx, struct Frame* f, naRef code);
return result;
}
+#ifdef _WIN32
+#define S_ISLNK(m) 0
+#define S_ISSOCK(m) 0
+#endif
#ifdef _MSC_VER
#define S_ISREG(m) (((m)&_S_IFMT)==_S_IFREG)
#define S_ISDIR(m) (((m)&_S_IFMT)==_S_IFDIR)
#define S_ISCHR(m) (((m)&_S_IFMT)==_S_IFCHR)
#define S_ISFIFO(m) (((m)&_S_IFMT)==_S_IFIFO)
#define S_ISBLK(m) 0
-#define S_ISLNK(m) 0
-#define S_ISSOCK(m) 0
typedef unsigned short mode_t;
#endif
static naRef ftype(naContext ctx, mode_t m)
# include <simgear_config.h>
#endif
-#if defined ( __CYGWIN__ )
-#include <ieeefp.h>
-#endif
-
#include <simgear/compiler.h>
#include <simgear/constants.h>
#include <simgear/structure/exception.hxx>
// # endif
// #endif
-#if defined (__CYGWIN__)
-#include <ieeefp.h>
-#endif
-
static osg::ref_ptr<osg::StateSet> layer_states[SGCloudLayer::SG_MAX_CLOUD_COVERAGES];
static osg::ref_ptr<osg::StateSet> layer_states2[SGCloudLayer::SG_MAX_CLOUD_COVERAGES];
static osg::ref_ptr<osg::TextureCubeMap> cubeMap;
using namespace simgear;
-#if defined (__CYGWIN__)
-#include <ieeefp.h>
-#endif
-
float SGCloudField::fieldSize = 50000.0f;
double SGCloudField::timer_dt = 0.0;
float SGCloudField::view_distance = 20000.0f;
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
-#ifdef __CYGWIN__
-#include <ieeefp.h>
-#endif
-
#include <simgear/compiler.h>
#include <simgear/constants.h>
# include <simgear_config.h>
#endif
-#ifdef __CYGWIN__
-#include <ieeefp.h>
-#endif
-
#include <simgear/compiler.h>
#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
# include <simgear_config.h>
#endif
-#if defined(__CYGWIN__) /* && !defined(USING_X) */
-#define WIN32
-#endif
-
-#if defined(WIN32) /* MINGW and MSC predefine WIN32 */
+#ifdef WIN32
# include <windows.h>
#endif
* Implementation of class RenderTexture. A multi-format render to
* texture wrapper.
*/
-#ifdef _MSC_VER
-#pragma warning(disable:4786)
-#endif
/*
* Changelog:
char strBuffer[512];
va_list args;
va_start(args, strMsg);
-#if defined _WIN32 && !defined __CYGWIN__
- _vsnprintf( strBuffer, 512, strMsg, args );
-#else
vsnprintf( strBuffer, 512, strMsg, args );
-#endif
va_end(args);
SG_LOG(SG_GL, SG_ALERT, strMsg);
va_list args;
char strBuffer[256];
va_start(args,strMode);
-#if defined _WIN32 && !defined __CYGWIN__
- _vsnprintf( strBuffer, 256, strMode, args );
-#else
vsnprintf( strBuffer, 256, strMode, args );
-#endif
va_end(args);
_ParseModeString(strBuffer, _pixelFormatAttribs, _pbufferAttribs);
#ifndef __SG_EXTENSIONS_HXX
#define __SG_EXTENSIONS_HXX 1
-#if defined(__CYGWIN__) && !defined(WIN32) /* && !defined(USING_X) */
-#define WIN32
-#endif
-
-#if defined(WIN32) /* MINGW and MSC predefine WIN32 */
+#ifdef WIN32
# include <windows.h>
#endif
# include <simgear_config.h>
#endif
-#if defined(__CYGWIN__) /* && !defined(USING_X) */
-#define WIN32
-#endif
-
-#if defined(WIN32) /* MINGW and MSC predefine WIN32 */
+#ifdef WIN32
# include <windows.h>
#endif
#include <iostream>
#include <cerrno>
-#if !defined( WIN32 ) || defined( __CYGWIN__) || defined( __CYGWIN32__ )
+#ifndef _WIN32
# include <termios.h>
# include <sys/types.h>
# include <sys/stat.h>
bool SGSerialPort::open_port(const string& device) {
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
+#ifdef _WIN32
fd = CreateFile( device.c_str(),
GENERIC_READ | GENERIC_WRITE,
bool SGSerialPort::close_port() {
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
+#ifdef _WIN32
CloseHandle( fd );
#else
close(fd);
bool SGSerialPort::set_baud(int baud) {
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
+#ifdef _WIN32
DCB dcb;
if ( GetCommState( fd, &dcb ) ) {
char buffer[max_count+1];
string result;
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
+#ifdef _WIN32
DWORD count;
if ( ReadFile( fd, buffer, max_count, &count, 0 ) ) {
int SGSerialPort::read_port(char *buf, int len) {
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
+#ifdef _WIN32
DWORD count;
if ( ReadFile( fd, buf, len, &count, 0 ) ) {
int SGSerialPort::write_port(const string& value) {
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
+#ifdef _WIN32
LPCVOID lpBuffer = value.data();
DWORD nNumberOfBytesToWrite = value.length();
int SGSerialPort::write_port(const char* buf, int len) {
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
+#ifdef _WIN32
LPCVOID lpBuffer = buf;
DWORD nNumberOfBytesToWrite = len;
# error This library requires C++
#endif
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
+#ifdef _WIN32
# include <windows.h>
#endif
*/
class SGSerialPort
{
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
+#ifdef _WIN32
typedef HANDLE fd_type;
#else
typedef int fd_type;
#include <stdio.h>
-#ifdef __MINGW32__
-// This is broken, but allows the file to compile without a POSIX
-// environment.
-static unsigned int sleep(unsigned int secs) { return 0; }
+#ifdef _WIN32
+#include <windows.h>
+#define sleep(x) Sleep(x*1000)
#else
#include <unistd.h> // sleep()
#endif
#elif defined(__sgi) && defined(_COMPILER_VERSION) && (_COMPILER_VERSION>=730)
// No need to include something. Is a Compiler API ...
# define SGATOMIC_USE_MIPSPRO_BUILTINS
-#elif defined(WIN32) && !defined ( __CYGWIN__ )
+#elif defined(_WIN32)
# include <windows.h>
# define SGATOMIC_USE_WIN32_INTERLOCKED
#else
includedir = @includedir@/threads
+if HAVE_THREADS
lib_LIBRARIES = libsgthreads.a
include_HEADERS = \
SGThread.cxx
INCLUDES = -I$(top_srcdir)
+else
+include_HEADERS = SGQueue.hxx
+endif
#include "timestamp.hxx"
void SGTimeStamp::stamp() {
-#if defined( WIN32 ) && !defined(__CYGWIN__)
+#ifdef _WIN32
unsigned int t;
t = timeGetTime();
_sec = t / 1000;