mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0031070: Configuration - fix building issues when using Emscripten toolchain
Handled __EMSCRIPTEN__ macros to: - Workaround atomics (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 is undefined, but GCC atomics are provided). - Suppress non-standard header <sys/signal.h> warning. - Return OSD_LinuxREDHAT. - Avoid inclusion of XLib headers. - Skip fontconfig library. - Enable EGL+GLES path (translated by Emscripten into WebGL). - Skip eglCreatePbufferSurface() not implemented by Emscripten EGL. Fixed Graphic3d_Vec4.hxx usage within Quantity_ColorRGBA.hxx. OpenGl_ShaderManager::defaultGlslVersion() now prefers GLSL 300 es when WebGL 2.0 is available, as there no any OpenGL ES greater than 3.0 emulation so far. Shaders_Declarations.glsl - added workaround for GLSL compilation on WebGL 1.0 by defining Light properties accessors as macros instead of functions ('[]' : Index expression must be constant). OpenGl_FrameBuffer::Init() - added workaround for initialization of GL_DEPTH24_STENCIL8 depth-stencil attachment on WebGL 1.0 + GL_WEBGL_depth_texture extension. OpenGl_Context::Vec4FromQuantityColor() now considers myIsSRgbActive flag to handle use case, when Immediate Layer is drawn directly into window buffer, which is not sRGB-ready. Added new sample - OCCT WebGL viewer.
This commit is contained in:
@@ -44,7 +44,7 @@ inline int Standard_Atomic_Decrement (volatile int* theValue);
|
||||
inline bool Standard_Atomic_CompareAndSwap (volatile int* theValue, int theOldValue, int theNewValue);
|
||||
|
||||
// Platform-dependent implementation
|
||||
#if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
|
||||
#if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) || defined(__EMSCRIPTEN__)
|
||||
// gcc explicitly defines the macros __GCC_HAVE_SYNC_COMPARE_AND_SWAP_*
|
||||
// starting with version 4.4+, although built-in functions
|
||||
// are available since 4.1.x. However unless __GCC_HAVE_SYNC_COMPARE_AND_SWAP_*
|
||||
|
Reference in New Issue
Block a user