Updates for Cygwin port, from Norman Vine.
This commit is contained in:
@@ -5,14 +5,14 @@
|
||||
#ifndef OSG_EXPORT
|
||||
#define OSG_EXPORT 1
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||
#pragma warning( disable : 4244 )
|
||||
#pragma warning( disable : 4251 )
|
||||
#pragma warning( disable : 4275 )
|
||||
#pragma warning( disable : 4786 )
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
|
||||
# ifdef SG_LIBRARY
|
||||
# define SG_EXPORT __declspec(dllexport)
|
||||
# else
|
||||
|
||||
@@ -24,6 +24,18 @@
|
||||
|
||||
#else
|
||||
|
||||
#if defined(__CYGWIN__) || defined(__MINGW32__)
|
||||
# ifndef APIENTRY
|
||||
# define GLUT_APIENTRY_DEFINED
|
||||
# define APIENTRY __stdcall
|
||||
# endif
|
||||
// XXX This is from Win32's <winnt.h>
|
||||
# ifndef CALLBACK
|
||||
# define CALLBACK __stdcall
|
||||
# endif
|
||||
|
||||
#else // ! __CYGWIN__
|
||||
|
||||
// Under windows avoid including <windows.h>
|
||||
// to avoid name space pollution, but Win32's <GL/gl.h>
|
||||
// needs APIENTRY and WINGDIAPI defined properly.
|
||||
@@ -49,17 +61,20 @@
|
||||
# define CALLBACK
|
||||
# endif
|
||||
# endif
|
||||
// XXX This is from Win32's <wingdi.h> and <winnt.h>
|
||||
# ifndef WINGDIAPI
|
||||
# define GLUT_WINGDIAPI_DEFINED
|
||||
# define WINGDIAPI __declspec(dllimport)
|
||||
# endif
|
||||
// XXX This is from Win32's <ctype.h>
|
||||
# ifndef _WCHAR_T_DEFINED
|
||||
typedef unsigned short wchar_t;
|
||||
# define _WCHAR_T_DEFINED
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#endif // __CYGWIN__
|
||||
|
||||
// XXX This is from Win32's <wingdi.h> and <winnt.h>
|
||||
# ifndef WINGDIAPI
|
||||
# define GLUT_WINGDIAPI_DEFINED
|
||||
# define WINGDIAPI __declspec(dllimport)
|
||||
# endif
|
||||
// XXX This is from Win32's <ctype.h>
|
||||
# ifndef _WCHAR_T_DEFINED
|
||||
typedef unsigned short wchar_t;
|
||||
# define _WCHAR_T_DEFINED
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#ifndef __gl_h_
|
||||
#include <GL/gl.h>
|
||||
|
||||
@@ -7,13 +7,9 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#if defined(WIN32)
|
||||
// needed for _isnan & _finite used below.
|
||||
#include <float.h>
|
||||
#endif
|
||||
|
||||
#if defined(WIN32) || defined (macintosh)
|
||||
#include <float.h>
|
||||
#if !defined(__CYGWIN__)
|
||||
#define M_E 2.7182818284590452354
|
||||
#define M_LOG2E 1.4426950408889634074
|
||||
#define M_LOG10E 0.43429448190325182765
|
||||
@@ -27,6 +23,7 @@
|
||||
#define M_2_SQRTPI 1.12837916709551257390
|
||||
#define M_SQRT2 1.41421356237309504880
|
||||
#define M_SQRT1_2 0.70710678118654752440
|
||||
#endif // __CYGWIN__
|
||||
#endif
|
||||
|
||||
// PJA MAC OSX
|
||||
@@ -75,7 +72,7 @@ inline double inRadians(double angle) { return angle; }
|
||||
inline double DegreesToRadians(double angle) { return angle*M_PI/180.0; }
|
||||
inline double RadiansToDegrees(double angle) { return angle*180.0/M_PI; }
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||
inline bool isNaN(float v) { return ::_isnan(v)!=0; }
|
||||
inline bool isNaN(double v) { return ::_isnan(v)!=0; }
|
||||
inline bool isInfinite(float v) { return !::_finite(v); }
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
|
||||
namespace osg {
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(WIN32 ) && !defined(__CYGWIN__)
|
||||
typedef __int64 Timer_t;
|
||||
#elif defined(__linux) || defined(__FreeBSD__)
|
||||
#elif defined(__linux) || defined(__FreeBSD__) || defined(__CYGWIN__)
|
||||
typedef unsigned long long Timer_t;
|
||||
#elif defined(__sgi)
|
||||
typedef unsigned long long Timer_t;
|
||||
@@ -61,7 +61,7 @@ class SG_EXPORT Timer {
|
||||
|
||||
};
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||
#include <time.h>
|
||||
#pragma optimize("",off)
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace osg{
|
||||
};
|
||||
#pragma optimize("",on)
|
||||
|
||||
#elif defined(__linux) || defined(__FreeBSD__)
|
||||
#elif defined(__linux) || defined(__FreeBSD__) || defined(__CYGWIN__) || defined(__MINGW32__)
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
#ifndef OSGDB_EXPORT_
|
||||
#define OSGDB_EXPORT_ 1
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma warning( disable : 4244 )
|
||||
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||
#pragma warning( disable : 4244 )
|
||||
#pragma warning( disable : 4251 )
|
||||
#pragma warning( disable : 4275 )
|
||||
#pragma warning( disable : 4786 )
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
|
||||
# ifdef OSGDB_LIBRARY
|
||||
# define OSGDB_EXPORT __declspec(dllexport)
|
||||
# else
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
#ifndef OSGGLUT_EXPORT_
|
||||
#define OSGGLUT_EXPORT_ 1
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma warning( disable : 4244 )
|
||||
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||
#pragma warning( disable : 4244 )
|
||||
#pragma warning( disable : 4251 )
|
||||
#pragma warning( disable : 4275 )
|
||||
#pragma warning( disable : 4786 )
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
|
||||
# ifdef OSGGLUT_LIBRARY
|
||||
# define OSGGLUT_EXPORT __declspec(dllexport)
|
||||
# else
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#ifndef OSGTEXT_EXPORT_
|
||||
#define OSGTEXT_EXPORT_ 1
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||
#pragma warning( disable : 4244 )
|
||||
#pragma warning( disable : 4251 )
|
||||
#pragma warning( disable : 4275 )
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
|
||||
# ifdef OSGTEXT_LIBRARY
|
||||
# define OSGTEXT_EXPORT __declspec(dllexport)
|
||||
# else
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
#ifndef OSGUTIL_EXPORT_
|
||||
#define OSGUTIL_EXPORT_ 1
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma warning( disable : 4244 )
|
||||
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||
#pragma warning( disable : 4244 )
|
||||
#pragma warning( disable : 4251 )
|
||||
#pragma warning( disable : 4275 )
|
||||
#pragma warning( disable : 4786 )
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
|
||||
# ifdef OSGUTIL_LIBRARY
|
||||
# define OSGUTIL_EXPORT __declspec(dllexport)
|
||||
# else
|
||||
|
||||
Reference in New Issue
Block a user