1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-05-16 10:54:53 +03:00

0026823: Configuration - use EGL on another platform without GLX

This commit is contained in:
ibs 2015-10-28 18:24:34 +03:00 committed by bugmaster
parent c85385c0e2
commit d8d01f6ed6
31 changed files with 134 additions and 78 deletions

View File

@ -1109,12 +1109,19 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
set aFrmsMap(CSF_TclLibs) "Tcl" set aFrmsMap(CSF_TclLibs) "Tcl"
set aFrmsMap(CSF_TclTkLibs) "Tk" set aFrmsMap(CSF_TclTkLibs) "Tk"
} else { } else {
set aLibsMap(CSF_ThreadLibs) "pthread rt" if { "$theOS" == "qnx" } {
set aLibsMap(CSF_OpenGlLibs) "GL" # CSF_ThreadLibs - pthread API is part og libc on QNX
set aLibsMap(CSF_TclLibs) "tcl8.6" set aLibsMap(CSF_OpenGlLibs) "EGL GLESv2"
set aLibsMap(CSF_TclTkLibs) "X11 tk8.6" set aLibsMap(CSF_TclLibs) "tcl8.6"
set aLibsMap(CSF_XwLibs) "X11 Xext Xmu Xi" set aLibsMap(CSF_TclTkLibs) "tk8.6"
set aLibsMap(CSF_MotifLibs) "X11" } else {
set aLibsMap(CSF_ThreadLibs) "pthread rt"
set aLibsMap(CSF_OpenGlLibs) "GL"
set aLibsMap(CSF_TclLibs) "tcl8.6"
set aLibsMap(CSF_TclTkLibs) "X11 tk8.6"
set aLibsMap(CSF_XwLibs) "X11 Xext Xmu Xi"
set aLibsMap(CSF_MotifLibs) "X11"
}
} }
# optional 3rd-parties # optional 3rd-parties
@ -2054,13 +2061,13 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
# Release target configuration # Release target configuration
puts $aFile "\t\t\t<Target title=\"Release\">" puts $aFile "\t\t\t<Target title=\"Release\">"
if { "$theIsExe" == "true" } { if { "$theIsExe" == "true" } {
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/bin/${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />" puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/bin/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
puts $aFile "\t\t\t\t<Option type=\"1\" />" puts $aFile "\t\t\t\t<Option type=\"1\" />"
} else { } else {
if { "$aWokStation" == "wnt" } { if { "$aWokStation" == "wnt" } {
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/lib/${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />" puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/lib/${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />"
} else { } else {
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/lib/lib${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />" puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/lib/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
} }
puts $aFile "\t\t\t\t<Option type=\"3\" />" puts $aFile "\t\t\t\t<Option type=\"3\" />"
} }
@ -2070,8 +2077,8 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
} else { } else {
puts $aFile "\t\t\t\t<Option compiler=\"gcc\" />" puts $aFile "\t\t\t\t<Option compiler=\"gcc\" />"
} }
puts $aFile "\t\t\t\t<Option createDefFile=\"1\" />" puts $aFile "\t\t\t\t<Option createDefFile=\"0\" />"
puts $aFile "\t\t\t\t<Option createStaticLib=\"1\" />" puts $aFile "\t\t\t\t<Option createStaticLib=\"0\" />"
# compiler options per TARGET (including defines) # compiler options per TARGET (including defines)
puts $aFile "\t\t\t\t<Compiler>" puts $aFile "\t\t\t\t<Compiler>"
@ -2085,15 +2092,20 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
} else { } else {
puts $aFile "\t\t\t\t\t<Add option=\"-O2\" />" puts $aFile "\t\t\t\t\t<Add option=\"-O2\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-std=c++0x\" />" puts $aFile "\t\t\t\t\t<Add option=\"-std=c++0x\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-mmmx\" />" if { "$aWokStation" != "qnx" } {
puts $aFile "\t\t\t\t\t<Add option=\"-msse\" />" puts $aFile "\t\t\t\t\t<Add option=\"-mmmx\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-msse2\" />" puts $aFile "\t\t\t\t\t<Add option=\"-msse\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-mfpmath=sse\" />" puts $aFile "\t\t\t\t\t<Add option=\"-msse2\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-mfpmath=sse\" />"
}
} }
foreach aMacro $theDefines { foreach aMacro $theDefines {
puts $aFile "\t\t\t\t\t<Add option=\"-D${aMacro}\" />" puts $aFile "\t\t\t\t\t<Add option=\"-D${aMacro}\" />"
} }
puts $aFile "\t\t\t\t\t<Add option=\"-DNDEBUG\" />" puts $aFile "\t\t\t\t\t<Add option=\"-DNDEBUG\" />"
if { "$aWokStation" == "qnx" } {
puts $aFile "\t\t\t\t\t<Add option=\"-D_QNX_SOURCE\" />"
}
puts $aFile "\t\t\t\t\t<Add option=\"-DNo_Exception\" />" puts $aFile "\t\t\t\t\t<Add option=\"-DNo_Exception\" />"
puts $aFile "\t\t\t\t</Compiler>" puts $aFile "\t\t\t\t</Compiler>"
@ -2111,13 +2123,13 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
# Debug target configuration # Debug target configuration
puts $aFile "\t\t\t<Target title=\"Debug\">" puts $aFile "\t\t\t<Target title=\"Debug\">"
if { "$theIsExe" == "true" } { if { "$theIsExe" == "true" } {
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/bind/${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />" puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/bind/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
puts $aFile "\t\t\t\t<Option type=\"1\" />" puts $aFile "\t\t\t\t<Option type=\"1\" />"
} else { } else {
if { "$aWokStation" == "wnt" } { if { "$aWokStation" == "wnt" } {
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/libd/${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />" puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/libd/${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />"
} else { } else {
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/libd/lib${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />" puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/libd/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
} }
puts $aFile "\t\t\t\t<Option type=\"3\" />" puts $aFile "\t\t\t\t<Option type=\"3\" />"
} }
@ -2127,8 +2139,8 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
} else { } else {
puts $aFile "\t\t\t\t<Option compiler=\"gcc\" />" puts $aFile "\t\t\t\t<Option compiler=\"gcc\" />"
} }
puts $aFile "\t\t\t\t<Option createDefFile=\"1\" />" puts $aFile "\t\t\t\t<Option createDefFile=\"0\" />"
puts $aFile "\t\t\t\t<Option createStaticLib=\"1\" />" puts $aFile "\t\t\t\t<Option createStaticLib=\"0\" />"
# compiler options per TARGET (including defines) # compiler options per TARGET (including defines)
puts $aFile "\t\t\t\t<Compiler>" puts $aFile "\t\t\t\t<Compiler>"
@ -2144,15 +2156,20 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
puts $aFile "\t\t\t\t\t<Add option=\"-O0\" />" puts $aFile "\t\t\t\t\t<Add option=\"-O0\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-std=c++0x\" />" puts $aFile "\t\t\t\t\t<Add option=\"-std=c++0x\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-g\" />" puts $aFile "\t\t\t\t\t<Add option=\"-g\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-mmmx\" />" if { "$aWokStation" != "qnx" } {
puts $aFile "\t\t\t\t\t<Add option=\"-msse\" />" puts $aFile "\t\t\t\t\t<Add option=\"-mmmx\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-msse2\" />" puts $aFile "\t\t\t\t\t<Add option=\"-msse\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-mfpmath=sse\" />" puts $aFile "\t\t\t\t\t<Add option=\"-msse2\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-mfpmath=sse\" />"
}
} }
foreach aMacro $theDefines { foreach aMacro $theDefines {
puts $aFile "\t\t\t\t\t<Add option=\"-D${aMacro}\" />" puts $aFile "\t\t\t\t\t<Add option=\"-D${aMacro}\" />"
} }
puts $aFile "\t\t\t\t\t<Add option=\"-D_DEBUG\" />" puts $aFile "\t\t\t\t\t<Add option=\"-D_DEBUG\" />"
if { "$aWokStation" == "qnx" } {
puts $aFile "\t\t\t\t\t<Add option=\"-D_QNX_SOURCE\" />"
}
puts $aFile "\t\t\t\t\t<Add option=\"-DDEB\" />" puts $aFile "\t\t\t\t\t<Add option=\"-DDEB\" />"
puts $aFile "\t\t\t\t</Compiler>" puts $aFile "\t\t\t\t</Compiler>"

View File

@ -11,14 +11,13 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
// AdvApp2Var_ApproxF2var.cxx
#include <math.h>
#include <AdvApp2Var_SysBase.hxx> #include <AdvApp2Var_SysBase.hxx>
#include <AdvApp2Var_MathBase.hxx> #include <AdvApp2Var_MathBase.hxx>
#include <AdvApp2Var_Data_f2c.hxx> #include <AdvApp2Var_Data_f2c.hxx>
#include <AdvApp2Var_Data.hxx> #include <AdvApp2Var_Data.hxx>
#include <AdvApp2Var_ApproxF2var.hxx> #include <AdvApp2Var_ApproxF2var.hxx>
#include <cmath>
static static
int mmjacpt_(const integer *ndimen, int mmjacpt_(const integer *ndimen,

View File

@ -13,7 +13,7 @@
// AdvApp2Var_SysBase.cxx // AdvApp2Var_SysBase.cxx
#include <assert.h> #include <assert.h>
#include <math.h> #include <cmath>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <AdvApp2Var_Data_f2c.hxx> #include <AdvApp2Var_Data_f2c.hxx>

View File

@ -23,7 +23,7 @@
// ======================================================================= // =======================================================================
Aspect_DisplayConnection::Aspect_DisplayConnection() Aspect_DisplayConnection::Aspect_DisplayConnection()
{ {
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) #if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
OSD_Environment anEnv ("DISPLAY"); OSD_Environment anEnv ("DISPLAY");
myDisplayName = anEnv.Value(); myDisplayName = anEnv.Value();
Init(); Init();
@ -36,7 +36,7 @@ Aspect_DisplayConnection::Aspect_DisplayConnection()
// ======================================================================= // =======================================================================
Aspect_DisplayConnection::~Aspect_DisplayConnection() Aspect_DisplayConnection::~Aspect_DisplayConnection()
{ {
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) #if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
if (myDisplay != NULL) if (myDisplay != NULL)
{ {
XCloseDisplay (myDisplay); XCloseDisplay (myDisplay);
@ -44,7 +44,7 @@ Aspect_DisplayConnection::~Aspect_DisplayConnection()
#endif #endif
} }
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) #if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
// ======================================================================= // =======================================================================
// function : Aspect_DisplayConnection // function : Aspect_DisplayConnection
// purpose : // purpose :

View File

@ -20,7 +20,7 @@
#include <TCollection_AsciiString.hxx> #include <TCollection_AsciiString.hxx>
#include <NCollection_DataMap.hxx> #include <NCollection_DataMap.hxx>
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) #if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
#include <InterfaceGraphic.hxx> #include <InterfaceGraphic.hxx>
#endif #endif
@ -39,7 +39,7 @@ public:
//! Destructor. Close opened connection. //! Destructor. Close opened connection.
Standard_EXPORT ~Aspect_DisplayConnection(); Standard_EXPORT ~Aspect_DisplayConnection();
#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) #if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
//! Constructor. Creates connection with display specified in theDisplayName. //! Constructor. Creates connection with display specified in theDisplayName.
//! Display name should be in format "hostname:number" or "hostname:number.screen_number", where: //! Display name should be in format "hostname:number" or "hostname:number.screen_number", where:
//! hostname - Specifies the name of the host machine on which the display is physically attached. //! hostname - Specifies the name of the host machine on which the display is physically attached.

View File

@ -14,7 +14,7 @@
#ifndef _Aspect_FBConfig_HeaderFile #ifndef _Aspect_FBConfig_HeaderFile
#define _Aspect_FBConfig_HeaderFile #define _Aspect_FBConfig_HeaderFile
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) #if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
typedef struct __GLXFBConfigRec* GLXFBConfig; typedef struct __GLXFBConfigRec* GLXFBConfig;
typedef GLXFBConfig Aspect_FBConfig; // GLXFBConfig* under UNIX typedef GLXFBConfig Aspect_FBConfig; // GLXFBConfig* under UNIX
#else #else

View File

@ -14,7 +14,7 @@
#ifndef __Aspect_WNTXWD_HXX #ifndef __Aspect_WNTXWD_HXX
# define __Aspect_WNTXWD_HXX # define __Aspect_WNTXWD_HXX
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) #if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
# include <X11/XWDFile.h> # include <X11/XWDFile.h>
# else # else

View File

@ -362,6 +362,10 @@ static Standard_Integer dversion(Draw_Interpretor& di, Standard_Integer, const c
#elif defined(__ANDROID__) /* must be before Linux */ #elif defined(__ANDROID__) /* must be before Linux */
#include <android/api-level.h> #include <android/api-level.h>
di << "OS: Android (__ANDROID_API__ = " << __ANDROID_API__ << ")\n"; di << "OS: Android (__ANDROID_API__ = " << __ANDROID_API__ << ")\n";
#elif defined(__QNXNTO__)
di << "OS: QNX Neutrino\n";
#elif defined(__QNX__)
di << "OS: QNX\n";
#elif defined(__linux__) #elif defined(__linux__)
di << "OS: Linux\n"; di << "OS: Linux\n";
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) #elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)

View File

@ -1342,7 +1342,12 @@ Standard_Real ElCLib::HyperbolaParameter (const gp_Ax2& Pos,
Standard_Real sht = Standard_Real sht =
gp_Vec(Pos.Location (), P).Dot gp_Vec(Pos.Location (), P).Dot
(gp_Vec (Pos.YDirection())) / MinorRadius; (gp_Vec (Pos.YDirection())) / MinorRadius;
#if __cplusplus >= 201103L
return std::asinh(sht);
#else
return asinh(sht); return asinh(sht);
#endif
} }
//======================================================================= //=======================================================================
@ -1421,7 +1426,11 @@ Standard_Real ElCLib::HyperbolaParameter (const gp_Ax22d& Pos,
{ {
gp_Vec2d V (Pos.YDirection().XY()); gp_Vec2d V (Pos.YDirection().XY());
Standard_Real sht = gp_Vec2d(Pos.Location(),P).Dot(V) /MinorRadius; Standard_Real sht = gp_Vec2d(Pos.Location(),P).Dot(V) /MinorRadius;
return asinh(sht); #if __cplusplus >= 201103L
return std::asinh(sht);
#else
return asinh(sht);
#endif
} }
//======================================================================= //=======================================================================

View File

@ -23,7 +23,7 @@
#undef DrawText #undef DrawText
#endif #endif
#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) #elif !defined(__ANDROID__) && !defined(__QNX__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
#include <stdio.h> #include <stdio.h>

View File

@ -22,6 +22,10 @@
#include <TCollection_AsciiString.hxx> #include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx> #include <TCollection_ExtendedString.hxx>
#ifndef _WIN32
#include <strings.h>
#endif
//======================================================================= //=======================================================================
//function : Constructor //function : Constructor
//purpose : Empty constructor, defaulting to cerr //purpose : Empty constructor, defaulting to cerr

View File

@ -16,7 +16,7 @@
#include <OSD.hxx> #include <OSD.hxx>
#include <Standard_Stream.hxx> #include <Standard_Stream.hxx>
#include <math.h> #include <cmath>
#include <stdio.h> #include <stdio.h>
#if defined(isfinite) #if defined(isfinite)
# define finite isfinite # define finite isfinite
@ -125,6 +125,10 @@ void OSD::MilliSecSleep(const Standard_Integer aDelay)
Standard_Boolean OSD::IsDivisible(const Standard_Real theDividend,const Standard_Real theDivisor) Standard_Boolean OSD::IsDivisible(const Standard_Real theDividend,const Standard_Real theDivisor)
{ {
#ifdef __QNX__
using std::finite;
#endif
if ( theDivisor == 0. || ! finite(theDividend) ) return Standard_False; if ( theDivisor == 0. || ! finite(theDividend) ) return Standard_False;
// //
// you may divide by infinity // you may divide by infinity

View File

@ -57,7 +57,7 @@
//======================================================================= //=======================================================================
void OSD_Chronometer::GetProcessCPU (Standard_Real& UserSeconds, Standard_Real& SystemSeconds) void OSD_Chronometer::GetProcessCPU (Standard_Real& UserSeconds, Standard_Real& SystemSeconds)
{ {
#if defined(__linux__) || defined(linux) || defined(__FreeBSD__) || defined(__ANDROID__) #if defined(__linux__) || defined(linux) || defined(__FreeBSD__) || defined(__ANDROID__) || defined(__QNX__)
static const long aCLK_TCK = sysconf(_SC_CLK_TCK); static const long aCLK_TCK = sysconf(_SC_CLK_TCK);
#else #else
static const long aCLK_TCK = CLK_TCK; static const long aCLK_TCK = CLK_TCK;
@ -87,7 +87,7 @@ void OSD_Chronometer::GetThreadCPU (Standard_Real& theUserSeconds,
theUserSeconds = Standard_Real(aTaskInfo.user_time.seconds) + 0.000001 * aTaskInfo.user_time.microseconds; theUserSeconds = Standard_Real(aTaskInfo.user_time.seconds) + 0.000001 * aTaskInfo.user_time.microseconds;
theSystemSeconds = Standard_Real(aTaskInfo.system_time.seconds) + 0.000001 * aTaskInfo.system_time.microseconds; theSystemSeconds = Standard_Real(aTaskInfo.system_time.seconds) + 0.000001 * aTaskInfo.system_time.microseconds;
} }
#elif (defined(_POSIX_TIMERS) && defined(_POSIX_THREAD_CPUTIME)) || defined(__ANDROID__) #elif (defined(_POSIX_TIMERS) && defined(_POSIX_THREAD_CPUTIME)) || defined(__ANDROID__) || defined(__QNX__)
// on Linux, only user times are available for threads via clock_gettime() // on Linux, only user times are available for threads via clock_gettime()
struct timespec t; struct timespec t;
if (!clock_gettime (CLOCK_THREAD_CPUTIME_ID, &t)) if (!clock_gettime (CLOCK_THREAD_CPUTIME_ID, &t))

View File

@ -21,8 +21,8 @@
#include <Standard_ProgramError.hxx> #include <Standard_ProgramError.hxx>
#include <TCollection_AsciiString.hxx> #include <TCollection_AsciiString.hxx>
static OSD_SysType whereAmI(){ static OSD_SysType whereAmI() {
#if defined(__digital__) || defined(__FreeBSD__) || defined(SUNOS) || defined(__APPLE__) #if defined(__digital__) || defined(__FreeBSD__) || defined(SUNOS) || defined(__APPLE__) || defined(__QNX__)
return OSD_UnixBSD; return OSD_UnixBSD;
} }
#elif defined(sgi) || defined(IRIX) || defined(__sun) || defined(SOLARIS) || defined(__sco__) || defined(__hpux) || defined(HPUX) #elif defined(sgi) || defined(IRIX) || defined(__sun) || defined(SOLARIS) || defined(__sco__) || defined(__hpux) || defined(HPUX)

View File

@ -70,7 +70,7 @@ typedef void (* SIG_PFV) (int);
#include <signal.h> #include <signal.h>
#if !defined(__ANDROID__) #if !defined(__ANDROID__) && !defined(__QNX__)
#include <sys/signal.h> #include <sys/signal.h>
#endif #endif

View File

@ -45,7 +45,7 @@
#include <OpenGL/gl.h> #include <OpenGL/gl.h>
#endif #endif
#define __X_GL_H // prevent chaotic gl.h inclusions to avoid compile errors #define __X_GL_H // prevent chaotic gl.h inclusions to avoid compile errors
#elif defined(HAVE_GLES2) || defined(__ANDROID__) #elif defined(HAVE_GLES2) || defined(__ANDROID__) || defined(__QNX__)
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
//#include <GLES3/gl3.h> //#include <GLES3/gl3.h>
#else #else
@ -149,7 +149,7 @@
#define GL_TEXTURE_BUFFER_ARB 0x8C2A #define GL_TEXTURE_BUFFER_ARB 0x8C2A
#endif #endif
#if defined(__ANDROID__) #if defined(__ANDROID__) || defined(__QNX__)
#define HAVE_EGL #define HAVE_EGL
#endif #endif

View File

@ -38,11 +38,11 @@
#include <Xw_Window.hxx> #include <Xw_Window.hxx>
#endif #endif
#if !defined(_WIN32) && !defined(__ANDROID__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) #if !defined(_WIN32) && !defined(__ANDROID__) && !defined(__QNX__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
#include <X11/Xlib.h> // XOpenDisplay() #include <X11/Xlib.h> // XOpenDisplay()
#endif #endif
#if defined(HAVE_EGL) || defined(__ANDROID__) #if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
#include <EGL/egl.h> #include <EGL/egl.h>
#endif #endif
@ -59,7 +59,7 @@ OpenGl_GraphicDriver::OpenGl_GraphicDriver (const Handle(Aspect_DisplayConnectio
const Standard_Boolean theToInitialize) const Standard_Boolean theToInitialize)
: Graphic3d_GraphicDriver (theDisp), : Graphic3d_GraphicDriver (theDisp),
myIsOwnContext (Standard_False), myIsOwnContext (Standard_False),
#if defined(HAVE_EGL) || defined(__ANDROID__) #if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
myEglDisplay ((Aspect_Display )EGL_NO_DISPLAY), myEglDisplay ((Aspect_Display )EGL_NO_DISPLAY),
myEglContext ((Aspect_RenderingContext )EGL_NO_CONTEXT), myEglContext ((Aspect_RenderingContext )EGL_NO_CONTEXT),
myEglConfig (NULL), myEglConfig (NULL),
@ -68,7 +68,7 @@ OpenGl_GraphicDriver::OpenGl_GraphicDriver (const Handle(Aspect_DisplayConnectio
myMapOfView (1, NCollection_BaseAllocator::CommonBaseAllocator()), myMapOfView (1, NCollection_BaseAllocator::CommonBaseAllocator()),
myMapOfStructure (1, NCollection_BaseAllocator::CommonBaseAllocator()) myMapOfStructure (1, NCollection_BaseAllocator::CommonBaseAllocator())
{ {
#if !defined(_WIN32) && !defined(__ANDROID__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) #if !defined(_WIN32) && !defined(__ANDROID__) && !defined(__QNX__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
if (myDisplayConnection.IsNull()) if (myDisplayConnection.IsNull())
{ {
//Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_GraphicDriver: cannot connect to X server!"); //Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_GraphicDriver: cannot connect to X server!");
@ -202,7 +202,7 @@ void OpenGl_GraphicDriver::ReleaseContext()
aWindow->GetGlContext()->forcedRelease(); aWindow->GetGlContext()->forcedRelease();
} }
#if defined(HAVE_EGL) || defined(__ANDROID__) #if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
if (myIsOwnContext) if (myIsOwnContext)
{ {
if (myEglContext != (Aspect_RenderingContext )EGL_NO_CONTEXT) if (myEglContext != (Aspect_RenderingContext )EGL_NO_CONTEXT)
@ -237,9 +237,9 @@ void OpenGl_GraphicDriver::ReleaseContext()
Standard_Boolean OpenGl_GraphicDriver::InitContext() Standard_Boolean OpenGl_GraphicDriver::InitContext()
{ {
ReleaseContext(); ReleaseContext();
#if defined(HAVE_EGL) || defined(__ANDROID__) #if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
#if !defined(_WIN32) && !defined(__ANDROID__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) #if !defined(_WIN32) && !defined(__ANDROID__) && !defined(__QNX__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
if (myDisplayConnection.IsNull()) if (myDisplayConnection.IsNull())
{ {
return Standard_False; return Standard_False;
@ -328,7 +328,7 @@ Standard_Boolean OpenGl_GraphicDriver::InitContext()
return Standard_True; return Standard_True;
} }
#if defined(HAVE_EGL) || defined(__ANDROID__) #if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
// ======================================================================= // =======================================================================
// function : InitEglContext // function : InitEglContext
// purpose : // purpose :
@ -338,7 +338,7 @@ Standard_Boolean OpenGl_GraphicDriver::InitEglContext (Aspect_Display t
void* theEglConfig) void* theEglConfig)
{ {
ReleaseContext(); ReleaseContext();
#if !defined(_WIN32) && !defined(__ANDROID__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) #if !defined(_WIN32) && !defined(__ANDROID__) && !defined(__QNX__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
if (myDisplayConnection.IsNull()) if (myDisplayConnection.IsNull())
{ {
return Standard_False; return Standard_False;
@ -751,7 +751,7 @@ Standard_Boolean OpenGl_GraphicDriver::ViewExists (const Handle(Aspect_Window)&
#else #else
NSView* TheSpecifiedWindowId = THEWindow->HView(); NSView* TheSpecifiedWindowId = THEWindow->HView();
#endif #endif
#elif defined(__ANDROID__) #elif defined(__ANDROID__) || defined(__QNX__)
int TheSpecifiedWindowId = -1; int TheSpecifiedWindowId = -1;
#else #else
const Handle(Xw_Window) THEWindow = Handle(Xw_Window)::DownCast (AWindow); const Handle(Xw_Window) THEWindow = Handle(Xw_Window)::DownCast (AWindow);
@ -776,7 +776,7 @@ Standard_Boolean OpenGl_GraphicDriver::ViewExists (const Handle(Aspect_Window)&
#else #else
NSView* TheWindowIdOfView = theWindow->HView(); NSView* TheWindowIdOfView = theWindow->HView();
#endif #endif
#elif defined(__ANDROID__) #elif defined(__ANDROID__) || defined(__QNX__)
int TheWindowIdOfView = 0; int TheWindowIdOfView = 0;
#else #else
const Handle(Xw_Window) theWindow = Handle(Xw_Window)::DownCast (AspectWindow); const Handle(Xw_Window) theWindow = Handle(Xw_Window)::DownCast (AspectWindow);

View File

@ -104,7 +104,7 @@ public:
//! Perform initialization of default OpenGL context. //! Perform initialization of default OpenGL context.
Standard_EXPORT Standard_Boolean InitContext(); Standard_EXPORT Standard_Boolean InitContext();
#if defined(HAVE_EGL) || defined(__ANDROID__) #if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
//! Initialize default OpenGL context using existing one. //! Initialize default OpenGL context using existing one.
//! @param theEglDisplay EGL connection to the Display //! @param theEglDisplay EGL connection to the Display
//! @param theEglContext EGL rendering context //! @param theEglContext EGL rendering context
@ -199,7 +199,7 @@ public:
//! Could return NULL-handle if no window created by this driver. //! Could return NULL-handle if no window created by this driver.
Standard_EXPORT const Handle(OpenGl_Context)& GetSharedContext() const; Standard_EXPORT const Handle(OpenGl_Context)& GetSharedContext() const;
#if defined(HAVE_EGL) || defined(__ANDROID__) #if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
Aspect_Display getRawGlDisplay() const { return myEglDisplay; } Aspect_Display getRawGlDisplay() const { return myEglDisplay; }
Aspect_RenderingContext getRawGlContext() const { return myEglContext; } Aspect_RenderingContext getRawGlContext() const { return myEglContext; }
void* getRawGlConfig() const { return myEglConfig; } void* getRawGlConfig() const { return myEglConfig; }
@ -212,7 +212,7 @@ public:
protected: protected:
Standard_Boolean myIsOwnContext; //!< indicates that shared context has been created within OpenGl_GraphicDriver Standard_Boolean myIsOwnContext; //!< indicates that shared context has been created within OpenGl_GraphicDriver
#if defined(HAVE_EGL) || defined(__ANDROID__) #if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
Aspect_Display myEglDisplay; //!< EGL connection to the Display : EGLDisplay Aspect_Display myEglDisplay; //!< EGL connection to the Display : EGLDisplay
Aspect_RenderingContext myEglContext; //!< EGL rendering context : EGLContext Aspect_RenderingContext myEglContext; //!< EGL rendering context : EGLContext
void* myEglConfig; //!< EGL configuration : EGLConfig void* myEglConfig; //!< EGL configuration : EGLConfig

View File

@ -26,7 +26,7 @@
#include <TCollection_ExtendedString.hxx> #include <TCollection_ExtendedString.hxx>
#include <Graphic3d_GraphicDriver.hxx> #include <Graphic3d_GraphicDriver.hxx>
#if defined(HAVE_EGL) || defined(__ANDROID__) #if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
#include <EGL/egl.h> #include <EGL/egl.h>
#endif #endif
@ -36,7 +36,7 @@
namespace namespace
{ {
#if defined(HAVE_EGL) || defined(__ANDROID__) #if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
// //
#elif defined(_WIN32) #elif defined(_WIN32)
@ -172,7 +172,7 @@ OpenGl_Window::OpenGl_Window (const Handle(OpenGl_GraphicDriver)& theDriver,
Standard_Boolean isCoreProfile = Standard_False; Standard_Boolean isCoreProfile = Standard_False;
#if defined(HAVE_EGL) || defined(__ANDROID__) #if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
EGLDisplay anEglDisplay = (EGLDisplay )theDriver->getRawGlDisplay(); EGLDisplay anEglDisplay = (EGLDisplay )theDriver->getRawGlDisplay();
EGLContext anEglContext = (EGLContext )theDriver->getRawGlContext(); EGLContext anEglContext = (EGLContext )theDriver->getRawGlContext();
EGLConfig anEglConfig = (EGLConfig )theDriver->getRawGlConfig(); EGLConfig anEglConfig = (EGLConfig )theDriver->getRawGlConfig();
@ -615,7 +615,7 @@ OpenGl_Window::~OpenGl_Window()
// release "GL" context if it is owned by window // release "GL" context if it is owned by window
// Mesa implementation can fail to destroy GL context if it set for current thread. // Mesa implementation can fail to destroy GL context if it set for current thread.
// It should be safer to unset thread GL context before its destruction. // It should be safer to unset thread GL context before its destruction.
#if defined(HAVE_EGL) || defined(__ANDROID__) #if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
if ((EGLSurface )myGlContext->myWindow != EGL_NO_SURFACE) if ((EGLSurface )myGlContext->myWindow != EGL_NO_SURFACE)
{ {
eglDestroySurface ((EGLDisplay )myGlContext->myDisplay, eglDestroySurface ((EGLDisplay )myGlContext->myDisplay,
@ -677,7 +677,7 @@ Standard_Boolean OpenGl_Window::Activate()
// ======================================================================= // =======================================================================
void OpenGl_Window::Resize() void OpenGl_Window::Resize()
{ {
#if !defined(_WIN32) && !defined(HAVE_EGL) && !defined(__ANDROID__) #if !defined(_WIN32) && !defined(HAVE_EGL) && !defined(__ANDROID__) && !defined(__QNX__)
Display* aDisp = (Display* )myGlContext->myDisplay; Display* aDisp = (Display* )myGlContext->myDisplay;
if (aDisp == NULL) if (aDisp == NULL)
return; return;
@ -694,7 +694,7 @@ void OpenGl_Window::Resize()
myWidth = aWidth; myWidth = aWidth;
myHeight = aHeight; myHeight = aHeight;
#if !defined(_WIN32) && !defined(HAVE_EGL) && !defined(__ANDROID__) #if !defined(_WIN32) && !defined(HAVE_EGL) && !defined(__ANDROID__) && !defined(__QNX__)
XResizeWindow (aDisp, myGlContext->myWindow, (unsigned int )myWidth, (unsigned int )myHeight); XResizeWindow (aDisp, myGlContext->myWindow, (unsigned int )myWidth, (unsigned int )myHeight);
XSync (aDisp, False); XSync (aDisp, False);
#endif #endif
@ -711,7 +711,7 @@ void OpenGl_Window::Init()
if (!Activate()) if (!Activate())
return; return;
#if defined(HAVE_EGL) || defined(__ANDROID__) #if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
eglQuerySurface ((EGLDisplay )myGlContext->myDisplay, (EGLSurface )myGlContext->myWindow, EGL_WIDTH, &myWidth); eglQuerySurface ((EGLDisplay )myGlContext->myDisplay, (EGLSurface )myGlContext->myWindow, EGL_WIDTH, &myWidth);
eglQuerySurface ((EGLDisplay )myGlContext->myDisplay, (EGLSurface )myGlContext->myWindow, EGL_HEIGHT, &myHeight); eglQuerySurface ((EGLDisplay )myGlContext->myDisplay, (EGLSurface )myGlContext->myWindow, EGL_HEIGHT, &myHeight);
#elif defined(_WIN32) #elif defined(_WIN32)

View File

@ -27,7 +27,7 @@
#include <locale.h> #include <locale.h>
#endif #endif
#if defined(_MSC_VER) || defined(__ANDROID__) #if defined(_MSC_VER) || defined(__ANDROID__) || defined(__QNX__)
#include <malloc.h> #include <malloc.h>
#elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 1) #elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 1)
#include <mm_malloc.h> #include <mm_malloc.h>
@ -264,7 +264,7 @@ Standard_Address Standard::AllocateAligned (const Standard_Size theSize,
{ {
#if defined(_MSC_VER) #if defined(_MSC_VER)
return _aligned_malloc (theSize, theAlign); return _aligned_malloc (theSize, theAlign);
#elif defined(__ANDROID__) #elif defined(__ANDROID__) || defined(__QNX__)
return memalign (theAlign, theSize); return memalign (theAlign, theSize);
#elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 1) #elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 1)
return _mm_malloc (theSize, theAlign); return _mm_malloc (theSize, theAlign);
@ -287,7 +287,7 @@ void Standard::FreeAligned (Standard_Address thePtrAligned)
{ {
#if defined(_MSC_VER) #if defined(_MSC_VER)
_aligned_free (thePtrAligned); _aligned_free (thePtrAligned);
#elif defined(__ANDROID__) #elif defined(__ANDROID__) || defined(__QNX__)
free (thePtrAligned); free (thePtrAligned);
#elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 1) #elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 1)
_mm_free (thePtrAligned); _mm_free (thePtrAligned);

View File

@ -80,7 +80,7 @@ Standard_Integer HashCodes (const Standard_CString Value,
// glibc version for android platform use locale-independent implementation of // glibc version for android platform use locale-independent implementation of
// strtod, strtol, strtoll functions. For other system with locale-depended // strtod, strtol, strtoll functions. For other system with locale-depended
// implementations problems may appear if "C" locale is not set explicitly. // implementations problems may appear if "C" locale is not set explicitly.
#ifndef __ANDROID__ #if !defined(__ANDROID__) && !defined(__QNX__)
#error System does not support xlocale. Import/export could be broken if C locale did not specified by application. #error System does not support xlocale. Import/export could be broken if C locale did not specified by application.
#endif #endif
#define strtod_l(thePtr, theNextPtr, theLocale) strtod(thePtr, theNextPtr) #define strtod_l(thePtr, theNextPtr, theLocale) strtod(thePtr, theNextPtr)

View File

@ -18,6 +18,7 @@
#include <Standard_Assert.hxx> #include <Standard_Assert.hxx>
#include <stdio.h> #include <stdio.h>
#include <errno.h>
#ifdef _WIN32 #ifdef _WIN32
# include <windows.h> # include <windows.h>

View File

@ -24,6 +24,8 @@
#include <Standard_Mutex.hxx> #include <Standard_Mutex.hxx>
#include <Standard_OStream.hxx> #include <Standard_OStream.hxx>
#include <errno.h>
//============================================= //=============================================
// Standard_Mutex::Standard_Mutex // Standard_Mutex::Standard_Mutex
//============================================= //=============================================

View File

@ -20,11 +20,11 @@
#include <Standard_Boolean.hxx> #include <Standard_Boolean.hxx>
#include <Standard_ErrorHandlerCallback.hxx> #include <Standard_ErrorHandlerCallback.hxx>
#if (defined(_WIN32) || defined(__WIN32__)) #if defined(_WIN32)
#include <windows.h> #include <windows.h>
#else #else
#include <pthread.h> #include <pthread.h>
#include <sys/errno.h> ///#include <sys/errno.h>
#include <unistd.h> #include <unistd.h>
#include <time.h> #include <time.h>
#endif #endif

View File

@ -239,8 +239,12 @@ Standard_Real ATanh(const Standard_Real Value)
#ifdef OCCT_DEBUG #ifdef OCCT_DEBUG
cout << "Illegal agument in ATanh" << endl ; cout << "Illegal agument in ATanh" << endl ;
#endif #endif
} }
return atanh(Value); #if __cplusplus >= 201103L
return std::atanh(Value);
#else
return atanh(Value);
#endif
} }
//------------------------------------------------------------------- //-------------------------------------------------------------------
@ -253,8 +257,12 @@ Standard_Real ACosh (const Standard_Real Value)
#ifdef OCCT_DEBUG #ifdef OCCT_DEBUG
cout << "Illegal agument in ACosh" << endl ; cout << "Illegal agument in ACosh" << endl ;
#endif #endif
} }
return acosh(Value); #if __cplusplus >= 201103L
return std::acosh(Value);
#else
return acosh(Value);
#endif
} }
//------------------------------------------------------------------- //-------------------------------------------------------------------

View File

@ -15,8 +15,8 @@
#ifndef _Standard_Real_HeaderFile #ifndef _Standard_Real_HeaderFile
#define _Standard_Real_HeaderFile #define _Standard_Real_HeaderFile
#include <cmath>
#include <float.h> #include <float.h>
#include <math.h>
#include <Standard_values.h> #include <Standard_values.h>
#include <Standard_math.hxx> #include <Standard_math.hxx>
#include <Standard_TypeDef.hxx> #include <Standard_TypeDef.hxx>
@ -295,7 +295,11 @@ inline Standard_Real Sinh(const Standard_Real Value)
// ASinh : Returns the hyperbolic arc sine of a real // ASinh : Returns the hyperbolic arc sine of a real
//------------------------------------------------------------------- //-------------------------------------------------------------------
inline Standard_Real ASinh(const Standard_Real Value) inline Standard_Real ASinh(const Standard_Real Value)
#if __cplusplus >= 201103L
{ return std::asinh(Value); }
#else
{ return asinh(Value); } { return asinh(Value); }
#endif
//------------------------------------------------------------------- //-------------------------------------------------------------------
// Square : Returns a real to the power 2 // Square : Returns a real to the power 2

View File

@ -15,8 +15,8 @@
#ifndef _Standard_ShortReal_HeaderFile #ifndef _Standard_ShortReal_HeaderFile
#define _Standard_ShortReal_HeaderFile #define _Standard_ShortReal_HeaderFile
#include <cmath>
#include <float.h> #include <float.h>
#include <math.h>
#include <Standard_values.h> #include <Standard_values.h>
#include <Standard_TypeDef.hxx> #include <Standard_TypeDef.hxx>

View File

@ -21,6 +21,8 @@
// - IsEqual // - IsEqual
// =============================================== // ===============================================
#ifndef __QNX__ // same as Standard_Size
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// IsEqual : Returns Standard_True if two time values are equal // IsEqual : Returns Standard_True if two time values are equal
// ------------------------------------------------------------------ // ------------------------------------------------------------------
@ -31,3 +33,5 @@ inline Standard_Boolean IsEqual (const Standard_Time theOne,
} }
#endif #endif
#endif

View File

@ -15,7 +15,7 @@
#include <Xw_Window.hxx> #include <Xw_Window.hxx>
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) #if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
#include <Aspect_Convert.hxx> #include <Aspect_Convert.hxx>
#include <Aspect_WindowDefinitionError.hxx> #include <Aspect_WindowDefinitionError.hxx>

View File

@ -16,7 +16,7 @@
#ifndef _Xw_Window_H__ #ifndef _Xw_Window_H__
#define _Xw_Window_H__ #define _Xw_Window_H__
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) #if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
#include <Aspect_Window.hxx> #include <Aspect_Window.hxx>

View File

@ -27,7 +27,7 @@
#define No_Standard_DimensionError #define No_Standard_DimensionError
//#endif //#endif
#include <math.h> #include <cmath>
#include <math_Recipes.hxx> #include <math_Recipes.hxx>