Browse Source

Account for __EMSCRIPTEN_major__ etc. not being implicit on 3.1.23+.

It would all be much simpler if the <emscripten/version.h> header wasn't
added just a few versions ago.
pull/594/head
Vladimír Vondruš 4 years ago
parent
commit
b9be0d341f
  1. 11
      src/Magnum/DebugTools/BufferData.cpp
  2. 10
      src/Magnum/DebugTools/BufferData.h
  3. 10
      src/Magnum/GL/Buffer.h
  4. 10
      src/Magnum/GL/Implementation/BufferState.h
  5. 10
      src/Magnum/GL/Implementation/MeshState.cpp
  6. 5
      src/Magnum/GL/Implementation/driverSpecific.cpp
  7. 10
      src/Magnum/GL/Mesh.h
  8. 10
      src/Magnum/Platform/Test/EmscriptenApplicationTest.cpp
  9. 10
      src/Magnum/Platform/WindowlessEglApplication.cpp
  10. 10
      src/Magnum/Platform/gl-info.cpp

11
src/Magnum/DebugTools/BufferData.cpp

@ -24,6 +24,17 @@
DEALINGS IN THE SOFTWARE.
*/
/* The __EMSCRIPTEN_major__ etc macros used to be passed implicitly, version
3.1.4 moved them to a version header and version 3.1.23 dropped the
backwards compatibility. To work consistently on all versions, including the
header only if the version macros aren't present.
https://github.com/emscripten-core/emscripten/commit/f99af02045357d3d8b12e63793cef36dfde4530a
https://github.com/emscripten-core/emscripten/commit/f76ddc702e4956aeedb658c49790cc352f892e4c */
#include <Corrade/configure.h>
#if defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(__EMSCRIPTEN_major__)
#include <emscripten/version.h>
#endif
/* Don't compile this file on Emscripten < 2.0.17. Because it's easier to do
that here than through CMake. */
#if !defined(__EMSCRIPTEN_major__) || __EMSCRIPTEN_major__*10000 + __EMSCRIPTEN_minor__*100 + __EMSCRIPTEN_tiny__ >= 20017

10
src/Magnum/DebugTools/BufferData.h

@ -39,6 +39,16 @@
#include "Magnum/GL/OpenGL.h"
#include "Magnum/DebugTools/visibility.h"
/* The __EMSCRIPTEN_major__ etc macros used to be passed implicitly, version
3.1.4 moved them to a version header and version 3.1.23 dropped the
backwards compatibility. To work consistently on all versions, including the
header only if the version macros aren't present.
https://github.com/emscripten-core/emscripten/commit/f99af02045357d3d8b12e63793cef36dfde4530a
https://github.com/emscripten-core/emscripten/commit/f76ddc702e4956aeedb658c49790cc352f892e4c */
#if defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(__EMSCRIPTEN_major__)
#include <emscripten/version.h>
#endif
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Corrade/Containers/Array.h>
#include <Corrade/Utility/Macros.h>

10
src/Magnum/GL/Buffer.h

@ -41,6 +41,16 @@
#include "Magnum/GL/AbstractObject.h"
#include "Magnum/GL/GL.h"
/* The __EMSCRIPTEN_major__ etc macros used to be passed implicitly, version
3.1.4 moved them to a version header and version 3.1.23 dropped the
backwards compatibility. To work consistently on all versions, including the
header only if the version macros aren't present.
https://github.com/emscripten-core/emscripten/commit/f99af02045357d3d8b12e63793cef36dfde4530a
https://github.com/emscripten-core/emscripten/commit/f76ddc702e4956aeedb658c49790cc352f892e4c */
#if defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(__EMSCRIPTEN_major__)
#include <emscripten/version.h>
#endif
#ifdef MAGNUM_BUILD_DEPRECATED
/* For label() / setLabel(), which used to be a std::string. Not ideal for the
return type, but at least something. */

10
src/Magnum/GL/Implementation/BufferState.h

@ -28,6 +28,16 @@
#include "Magnum/GL/Buffer.h"
/* The __EMSCRIPTEN_major__ etc macros used to be passed implicitly, version
3.1.4 moved them to a version header and version 3.1.23 dropped the
backwards compatibility. To work consistently on all versions, including the
header only if the version macros aren't present.
https://github.com/emscripten-core/emscripten/commit/f99af02045357d3d8b12e63793cef36dfde4530a
https://github.com/emscripten-core/emscripten/commit/f76ddc702e4956aeedb658c49790cc352f892e4c */
#if defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(__EMSCRIPTEN_major__)
#include <emscripten/version.h>
#endif
namespace Magnum { namespace GL { namespace Implementation {
struct BufferState {

10
src/Magnum/GL/Implementation/MeshState.cpp

@ -33,6 +33,16 @@
#include "State.h"
/* The __EMSCRIPTEN_major__ etc macros used to be passed implicitly, version
3.1.4 moved them to a version header and version 3.1.23 dropped the
backwards compatibility. To work consistently on all versions, including the
header only if the version macros aren't present.
https://github.com/emscripten-core/emscripten/commit/f99af02045357d3d8b12e63793cef36dfde4530a
https://github.com/emscripten-core/emscripten/commit/f76ddc702e4956aeedb658c49790cc352f892e4c */
#if defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(__EMSCRIPTEN_major__)
#include <emscripten/version.h>
#endif
namespace Magnum { namespace GL { namespace Implementation {
using namespace Containers::Literals;

5
src/Magnum/GL/Implementation/driverSpecific.cpp

@ -31,6 +31,11 @@
#include "Magnum/Math/Range.h"
#if defined(MAGNUM_TARGET_WEBGL) && defined(CORRADE_TARGET_EMSCRIPTEN)
/* Including any Emscripten header should also make __EMSCRIPTEN_major__ etc
macros available, independently of whether they're passed implicitly (before
version 3.1.23) or taken from a version header (after version 3.1.4).
https://github.com/emscripten-core/emscripten/commit/f99af02045357d3d8b12e63793cef36dfde4530a
https://github.com/emscripten-core/emscripten/commit/f76ddc702e4956aeedb658c49790cc352f892e4c */
#include <emscripten/emscripten.h>
#include <emscripten/html5.h>
#endif

10
src/Magnum/GL/Mesh.h

@ -38,6 +38,16 @@
#include "Magnum/GL/Buffer.h"
#include "Magnum/GL/GL.h"
/* The __EMSCRIPTEN_major__ etc macros used to be passed implicitly, version
3.1.4 moved them to a version header and version 3.1.23 dropped the
backwards compatibility. To work consistently on all versions, including the
header only if the version macros aren't present.
https://github.com/emscripten-core/emscripten/commit/f99af02045357d3d8b12e63793cef36dfde4530a
https://github.com/emscripten-core/emscripten/commit/f76ddc702e4956aeedb658c49790cc352f892e4c */
#if defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(__EMSCRIPTEN_major__)
#include <emscripten/version.h>
#endif
#ifdef MAGNUM_BUILD_DEPRECATED
/* For label() / setLabel(), which used to be a std::string. Not ideal for the
return type, but at least something. */

10
src/Magnum/Platform/Test/EmscriptenApplicationTest.cpp

@ -33,6 +33,16 @@
#include "Magnum/GL/Mesh.h"
#include "Magnum/Math/Color.h"
/* The __EMSCRIPTEN_major__ etc macros used to be passed implicitly, version
3.1.4 moved them to a version header and version 3.1.23 dropped the
backwards compatibility. To work consistently on all versions, including the
header only if the version macros aren't present.
https://github.com/emscripten-core/emscripten/commit/f99af02045357d3d8b12e63793cef36dfde4530a
https://github.com/emscripten-core/emscripten/commit/f76ddc702e4956aeedb658c49790cc352f892e4c */
#if defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(__EMSCRIPTEN_major__)
#include <emscripten/version.h>
#endif
namespace Magnum { namespace Platform { namespace Test {
using namespace Containers::Literals;

10
src/Magnum/Platform/WindowlessEglApplication.cpp

@ -39,6 +39,16 @@
#include "Implementation/Egl.h"
/* The __EMSCRIPTEN_major__ etc macros used to be passed implicitly, version
3.1.4 moved them to a version header and version 3.1.23 dropped the
backwards compatibility. To work consistently on all versions, including the
header only if the version macros aren't present.
https://github.com/emscripten-core/emscripten/commit/f99af02045357d3d8b12e63793cef36dfde4530a
https://github.com/emscripten-core/emscripten/commit/f76ddc702e4956aeedb658c49790cc352f892e4c */
#if defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(__EMSCRIPTEN_major__)
#include <emscripten/version.h>
#endif
/* ANGLE's EGL on Windows needs an actual window */
/** @todo investigate if this is still needed */
#ifdef CORRADE_TARGET_WINDOWS

10
src/Magnum/Platform/gl-info.cpp

@ -72,6 +72,16 @@
#error no windowless application available on this platform
#endif
/* The __EMSCRIPTEN_major__ etc macros used to be passed implicitly, version
3.1.4 moved them to a version header and version 3.1.23 dropped the
backwards compatibility. To work consistently on all versions, including the
header only if the version macros aren't present.
https://github.com/emscripten-core/emscripten/commit/f99af02045357d3d8b12e63793cef36dfde4530a
https://github.com/emscripten-core/emscripten/commit/f76ddc702e4956aeedb658c49790cc352f892e4c */
#if defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(__EMSCRIPTEN_major__)
#include <emscripten/version.h>
#endif
namespace Magnum {
/** @page magnum-gl-info Magnum GL Info

Loading…
Cancel
Save