diff --git a/doc/platforms-html5.dox b/doc/platforms-html5.dox
index cec875776..ac877f1b8 100644
--- a/doc/platforms-html5.dox
+++ b/doc/platforms-html5.dox
@@ -818,9 +818,9 @@ warning: '$' in identifier
@endcode
Solution is to disable the warning for the offending lines, below for example
-when modifying a title element contents through DOM. No @cpp #ifdef __clang__ @ce
-is necessary, as the code in question is only ever compiled by Emscripten's
-Clang anyway:
+when modifying a title element contents through DOM. No
+@cpp #ifdef CORRADE_TARGET_CLANG @ce is necessary, as the code in question is
+only ever compiled by Emscripten's Clang anyway:
@snippet platforms-html5.cpp emasm-dollar
diff --git a/doc/snippets/MagnumSceneGraph.cpp b/doc/snippets/MagnumSceneGraph.cpp
index c639bdc7f..b6013761b 100644
--- a/doc/snippets/MagnumSceneGraph.cpp
+++ b/doc/snippets/MagnumSceneGraph.cpp
@@ -256,7 +256,7 @@ class MyObject: MyFeature, public Object3D {
/* [feature-construction-order-crash] */
}
{
-#ifdef __GNUC__
+#ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wreorder"
#endif
@@ -269,7 +269,7 @@ class MyObject: MyFeature, public Object3D {
};
/* [feature-construction-order-crash-destruction] */
}
-#ifdef __GNUC__
+#ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
}
diff --git a/doc/snippets/MagnumShaders-gl.cpp b/doc/snippets/MagnumShaders-gl.cpp
index a1affe2d0..ad5ac5f93 100644
--- a/doc/snippets/MagnumShaders-gl.cpp
+++ b/doc/snippets/MagnumShaders-gl.cpp
@@ -74,7 +74,7 @@ int main() {
/* internal compiler error: in gimplify_init_constructor, at gimplify.c:4271
on GCC 4.8 in the [60] array */
-#if !defined(__GNUC__) || defined(__clang__) || __GNUC__*100 + __GNUC_MINOR__ >= 500
+#if !defined(CORRADE_TARGET_GCC) || defined(CORRADE_TARGET_CLANG) || __GNUC__ >= 5
{
/* [shaders-setup] */
struct Vertex {
@@ -343,7 +343,7 @@ shader
/* internal compiler error: in gimplify_init_constructor, at gimplify.c:4271
on GCC 4.8 in the [60] array */
-#if !defined(__GNUC__) || defined(__clang__) || __GNUC__*100 + __GNUC_MINOR__ >= 500
+#if !defined(CORRADE_TARGET_GCC) || defined(CORRADE_TARGET_CLANG) || __GNUC__ >= 5
{
/* [DistanceFieldVectorGL-usage1] */
struct Vertex {
@@ -420,7 +420,7 @@ shader
/* internal compiler error: in gimplify_init_constructor, at gimplify.c:4271
on GCC 4.8 in the [60] array */
-#if !defined(__GNUC__) || defined(__clang__) || __GNUC__*100 + __GNUC_MINOR__ >= 500
+#if !defined(CORRADE_TARGET_GCC) || defined(CORRADE_TARGET_CLANG) || __GNUC__ >= 5
{
/* [FlatGL-usage-colored1] */
struct Vertex {
@@ -633,7 +633,7 @@ mesh.setInstanceCount(Containers::arraySize(instancedTransformations))
/* internal compiler error: in gimplify_init_constructor, at gimplify.c:4271
on GCC 4.8 in the [60] array */
-#if !defined(__GNUC__) || defined(__clang__) || __GNUC__*100 + __GNUC_MINOR__ >= 500
+#if !defined(CORRADE_TARGET_GCC) || defined(CORRADE_TARGET_CLANG) || __GNUC__ >= 5
{
/* [MeshVisualizerGL3D-usage-geom1] */
struct Vertex {
@@ -679,7 +679,7 @@ mesh.addVertexBuffer(vertexIndices, 0, Shaders::MeshVisualizerGL3D::VertexIndex{
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
/* internal compiler error: in gimplify_init_constructor, at gimplify.c:4271
on GCC 4.8 in the [60] array */
-#if !defined(__GNUC__) || defined(__clang__) || __GNUC__*100 + __GNUC_MINOR__ >= 500
+#if !defined(CORRADE_TARGET_GCC) || defined(CORRADE_TARGET_CLANG) || __GNUC__ >= 5
{
/* [MeshVisualizerGL3D-usage-tbn1] */
struct Vertex {
@@ -841,7 +841,7 @@ mesh.setInstanceCount(Containers::arraySize(instanceData))
}
#endif
-#if !defined(__GNUC__) || defined(__clang__) || __GNUC__*100 + __GNUC_MINOR__ >= 500
+#if !defined(CORRADE_TARGET_GCC) || defined(CORRADE_TARGET_CLANG) || __GNUC__ >= 5
{
/* [PhongGL-usage-colored1] */
struct Vertex {
@@ -1000,7 +1000,7 @@ shader
}
#endif
-#if !defined(__GNUC__) || defined(__clang__) || __GNUC__*100 + __GNUC_MINOR__ >= 500
+#if !defined(CORRADE_TARGET_GCC) || defined(CORRADE_TARGET_CLANG) || __GNUC__ >= 5
{
/* [VectorGL-usage1] */
struct Vertex {
@@ -1064,7 +1064,7 @@ shader
}
#endif
-#if !defined(__GNUC__) || defined(__clang__) || __GNUC__*100 + __GNUC_MINOR__ >= 500
+#if !defined(CORRADE_TARGET_GCC) || defined(CORRADE_TARGET_CLANG) || __GNUC__ >= 5
{
/* [VertexColorGL-usage1] */
struct Vertex {
diff --git a/src/Magnum/Audio/Context.cpp b/src/Magnum/Audio/Context.cpp
index 2e2963d71..70454b70e 100644
--- a/src/Magnum/Audio/Context.cpp
+++ b/src/Magnum/Audio/Context.cpp
@@ -134,7 +134,7 @@ namespace {
Windows not handled yet, as it needs a workaround using DllMain() and
GetProcAddress(). */
CORRADE_VISIBILITY_EXPORT
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
__attribute__((weak))
#else
/* uh oh? the test will fail, probably */
diff --git a/src/Magnum/DebugTools/CompareImage.cpp b/src/Magnum/DebugTools/CompareImage.cpp
index d7c3fe370..14f5e448c 100644
--- a/src/Magnum/DebugTools/CompareImage.cpp
+++ b/src/Magnum/DebugTools/CompareImage.cpp
@@ -109,7 +109,7 @@ std::tuple, Float, Float> calculateImageDelta(const Pix
CORRADE_ASSERT(!isPixelFormatImplementationSpecific(expected.format()),
"DebugTools::CompareImage: can't compare implementation-specific pixel formats", {});
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -189,7 +189,7 @@ std::tuple, Float, Float> calculateImageDelta(const Pix
case PixelFormat::Depth32FStencil8UI:
CORRADE_ASSERT_UNREACHABLE("DebugTools::CompareImage: packed depth/stencil formats are not supported yet", {});
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
@@ -261,7 +261,7 @@ namespace {
void printPixelAt(Debug& out, const Containers::StridedArrayView3D& pixels, const Vector2i& pos, const PixelFormat format) {
const char* const pixel = &pixels[pos.y()][pos.x()][0];
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -344,7 +344,7 @@ void printPixelAt(Debug& out, const Containers::StridedArrayView3D&
/* Already handled by a printing assert before */
CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
}
diff --git a/src/Magnum/DebugTools/ResourceManager.h b/src/Magnum/DebugTools/ResourceManager.h
index f981eb391..869396bc4 100644
--- a/src/Magnum/DebugTools/ResourceManager.h
+++ b/src/Magnum/DebugTools/ResourceManager.h
@@ -40,7 +40,7 @@
#include "Magnum/SceneGraph/SceneGraph.h"
/** @todo fix this better */
-#ifdef _MSC_VER /* This is not a bug, this is a feature :( Not even /permissive- helps. */
+#ifdef CORRADE_TARGET_MSVC /* This is not a bug, this is a feature :( Not even /permissive- helps. */
#include "Magnum/DebugTools/ForceRenderer.h"
#include "Magnum/DebugTools/ObjectRenderer.h"
#include "Magnum/GL/AbstractShaderProgram.h"
diff --git a/src/Magnum/GL/AbstractTexture.cpp b/src/Magnum/GL/AbstractTexture.cpp
index 9754b65d6..d36f726dc 100644
--- a/src/Magnum/GL/AbstractTexture.cpp
+++ b/src/Magnum/GL/AbstractTexture.cpp
@@ -551,7 +551,7 @@ void AbstractTexture::bindInternal() {
namespace {
PixelFormat pixelFormatForInternalFormat(const TextureFormat internalFormat) {
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -888,7 +888,7 @@ PixelFormat pixelFormatForInternalFormat(const TextureFormat internalFormat) {
#endif
return PixelFormat::DepthStencil;
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
@@ -896,7 +896,7 @@ PixelFormat pixelFormatForInternalFormat(const TextureFormat internalFormat) {
}
PixelType pixelTypeForInternalFormat(const TextureFormat internalFormat) {
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -1183,7 +1183,7 @@ PixelType pixelTypeForInternalFormat(const TextureFormat internalFormat) {
return PixelType::Float32UnsignedInt248Rev;
#endif
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
diff --git a/src/Magnum/GL/Context.cpp b/src/Magnum/GL/Context.cpp
index a47f06cea..75542aa74 100644
--- a/src/Magnum/GL/Context.cpp
+++ b/src/Magnum/GL/Context.cpp
@@ -631,7 +631,7 @@ CORRADE_THREAD_LOCAL
it's apparently enough to just export, macOS needs the weak attribute.
Windows handled differently below. */
CORRADE_VISIBILITY_EXPORT
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
__attribute__((weak))
#else
/* uh oh? the test will fail, probably */
diff --git a/src/Magnum/GL/Implementation/FramebufferState.h b/src/Magnum/GL/Implementation/FramebufferState.h
index 2cc1d64d4..c2307d257 100644
--- a/src/Magnum/GL/Implementation/FramebufferState.h
+++ b/src/Magnum/GL/Implementation/FramebufferState.h
@@ -27,7 +27,7 @@
#include "Magnum/GL/Framebuffer.h"
-#ifdef _MSC_VER
+#ifdef CORRADE_TARGET_MSVC
/* Otherwise the member function pointers will have different size based on
whether the header was included or not. CAUSES SERIOUS MEMORY CORRUPTION AND
IS NOT CAUGHT BY ANY WARNING WHATSOEVER! AARGH! */
diff --git a/src/Magnum/GL/Implementation/QueryState.h b/src/Magnum/GL/Implementation/QueryState.h
index 73e746875..b5aafe168 100644
--- a/src/Magnum/GL/Implementation/QueryState.h
+++ b/src/Magnum/GL/Implementation/QueryState.h
@@ -28,7 +28,7 @@
#include "Magnum/Magnum.h"
#include "Magnum/GL/GL.h"
-#ifdef _MSC_VER
+#ifdef CORRADE_TARGET_MSVC
/* Otherwise the member function pointers will have different size based on
whether the header was included or not. CAUSES SERIOUS MEMORY CORRUPTION AND
IS NOT CAUGHT BY ANY WARNING WHATSOEVER! AARGH! */
diff --git a/src/Magnum/GL/Implementation/ShaderState.h b/src/Magnum/GL/Implementation/ShaderState.h
index 1c6d14a18..3eef9f0b5 100644
--- a/src/Magnum/GL/Implementation/ShaderState.h
+++ b/src/Magnum/GL/Implementation/ShaderState.h
@@ -31,7 +31,7 @@
#include "Magnum/GL/GL.h"
#include "Magnum/GL/OpenGL.h"
-#ifdef _MSC_VER
+#ifdef CORRADE_TARGET_MSVC
/* Otherwise the member function pointers will have different size based on
whether the header was included or not. CAUSES SERIOUS MEMORY CORRUPTION AND
IS NOT CAUGHT BY ANY WARNING WHATSOEVER! AARGH! */
diff --git a/src/Magnum/GL/Implementation/TextureState.h b/src/Magnum/GL/Implementation/TextureState.h
index 8ded1dbf2..833064ecd 100644
--- a/src/Magnum/GL/Implementation/TextureState.h
+++ b/src/Magnum/GL/Implementation/TextureState.h
@@ -32,7 +32,7 @@
#include "Magnum/GL/GL.h"
#include "Magnum/GL/OpenGL.h"
-#ifdef _MSC_VER
+#ifdef CORRADE_TARGET_MSVC
#include "Magnum/GL/AbstractTexture.h"
#ifndef MAGNUM_TARGET_GLES2
diff --git a/src/Magnum/GL/Implementation/TransformFeedbackState.h b/src/Magnum/GL/Implementation/TransformFeedbackState.h
index 0098a04b5..0b356a835 100644
--- a/src/Magnum/GL/Implementation/TransformFeedbackState.h
+++ b/src/Magnum/GL/Implementation/TransformFeedbackState.h
@@ -32,7 +32,7 @@
#include "Magnum/GL/GL.h"
#include "Magnum/GL/OpenGL.h"
-#ifdef _MSC_VER
+#ifdef CORRADE_TARGET_MSVC
/* Otherwise the member function pointers will have different size based on
whether the header was included or not. CAUSES SERIOUS MEMORY CORRUPTION AND
IS NOT CAUGHT BY ANY WARNING WHATSOEVER! AARGH! */
diff --git a/src/Magnum/GL/PixelFormat.cpp b/src/Magnum/GL/PixelFormat.cpp
index f81edea9b..93acfef5c 100644
--- a/src/Magnum/GL/PixelFormat.cpp
+++ b/src/Magnum/GL/PixelFormat.cpp
@@ -124,7 +124,7 @@ TextureFormat textureFormat(const Magnum::PixelFormat format) {
UnsignedInt pixelSize(const PixelFormat format, const PixelType type) {
std::size_t size = 0;
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -184,11 +184,11 @@ UnsignedInt pixelSize(const PixelFormat format, const PixelType type) {
return 8;
#endif
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -254,7 +254,7 @@ UnsignedInt pixelSize(const PixelFormat format, const PixelType type) {
case PixelFormat::DepthStencil:
CORRADE_ASSERT_UNREACHABLE("GL::pixelSize(): invalid" << type << "specified for" << format, 0);
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
@@ -265,7 +265,7 @@ UnsignedInt pixelSize(const PixelFormat format, const PixelType type) {
Debug& operator<<(Debug& debug, const PixelFormat value) {
debug << "GL::PixelFormat" << Debug::nospace;
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -322,7 +322,7 @@ Debug& operator<<(Debug& debug, const PixelFormat value) {
#undef _c
/* LCOV_EXCL_STOP */
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
@@ -332,7 +332,7 @@ Debug& operator<<(Debug& debug, const PixelFormat value) {
Debug& operator<<(Debug& debug, const PixelType value) {
debug << "GL::PixelType" << Debug::nospace;
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -388,7 +388,7 @@ Debug& operator<<(Debug& debug, const PixelType value) {
#undef _c
/* LCOV_EXCL_STOP */
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
@@ -458,7 +458,7 @@ TextureFormat textureFormat(const Magnum::CompressedPixelFormat format) {
Debug& operator<<(Debug& debug, const CompressedPixelFormat value) {
debug << "GL::CompressedPixelFormat" << Debug::nospace;
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -570,7 +570,7 @@ Debug& operator<<(Debug& debug, const CompressedPixelFormat value) {
#undef _c
/* LCOV_EXCL_STOP */
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
diff --git a/src/Magnum/GL/Test/AttributeTest.cpp b/src/Magnum/GL/Test/AttributeTest.cpp
index 8c2ffa530..3c5f4b7a1 100644
--- a/src/Magnum/GL/Test/AttributeTest.cpp
+++ b/src/Magnum/GL/Test/AttributeTest.cpp
@@ -877,7 +877,7 @@ void AttributeTest::hasVertexFormat() {
const auto format = Magnum::VertexFormat(i);
/* Each case only verifies that hasVertexFormat() handles the format
and doesn't fall into unreachable code */
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -889,7 +889,7 @@ void AttributeTest::hasVertexFormat() {
#include "Magnum/Implementation/vertexFormatMapping.hpp"
#undef _c
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
}
diff --git a/src/Magnum/GL/Test/MeshTest.cpp b/src/Magnum/GL/Test/MeshTest.cpp
index 8955290f2..82d9ec71b 100644
--- a/src/Magnum/GL/Test/MeshTest.cpp
+++ b/src/Magnum/GL/Test/MeshTest.cpp
@@ -175,7 +175,7 @@ void MeshTest::mapPrimitive() {
too much. */
for(UnsignedInt i = 1; i <= 0xffff; ++i) {
const auto primitive = Magnum::MeshPrimitive(i);
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -188,7 +188,7 @@ void MeshTest::mapPrimitive() {
#include "Magnum/Implementation/meshPrimitiveMapping.hpp"
#undef _c
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
}
@@ -236,7 +236,7 @@ void MeshTest::mapIndexType() {
too much. */
for(UnsignedInt i = 1; i <= 0xffff; ++i) {
const auto type = Magnum::MeshIndexType(i);
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -248,7 +248,7 @@ void MeshTest::mapIndexType() {
#include "Magnum/Implementation/meshIndexTypeMapping.hpp"
#undef _c
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
}
diff --git a/src/Magnum/GL/Test/PixelFormatTest.cpp b/src/Magnum/GL/Test/PixelFormatTest.cpp
index 0f773d5c4..fa5a7848f 100644
--- a/src/Magnum/GL/Test/PixelFormatTest.cpp
+++ b/src/Magnum/GL/Test/PixelFormatTest.cpp
@@ -122,7 +122,7 @@ void PixelFormatTest::mapFormatTypeTextureFormat() {
- that there was no gap (unhandled value inside the range)
- that a particular pixel format maps to a particular GL format
- that a particular pixel type maps to a particular GL type */
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -177,7 +177,7 @@ void PixelFormatTest::mapFormatTypeTextureFormat() {
#undef _n
#undef _c
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
@@ -381,7 +381,7 @@ void PixelFormatTest::mapCompressedFormatTextureFormat() {
- that there was no gap (unhandled value inside the range)
- that a particular pixel format maps to a particular GL format
- that a particular pixel type maps to a particular GL type */
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -416,7 +416,7 @@ void PixelFormatTest::mapCompressedFormatTextureFormat() {
#undef _s
#undef _c
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
diff --git a/src/Magnum/GL/TextureFormat.cpp b/src/Magnum/GL/TextureFormat.cpp
index 1e624236e..8f3c7bf85 100644
--- a/src/Magnum/GL/TextureFormat.cpp
+++ b/src/Magnum/GL/TextureFormat.cpp
@@ -42,7 +42,7 @@ namespace Magnum { namespace GL {
Debug& operator<<(Debug& debug, const TextureFormat value) {
debug << "GL::TextureFormat" << Debug::nospace;
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -293,7 +293,7 @@ Debug& operator<<(Debug& debug, const TextureFormat value) {
#undef _c
/* LCOV_EXCL_STOP */
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
diff --git a/src/Magnum/Math/Functions.h b/src/Magnum/Math/Functions.h
index 30a8f0c3d..0ffa0dfb2 100644
--- a/src/Magnum/Math/Functions.h
+++ b/src/Magnum/Math/Functions.h
@@ -161,7 +161,7 @@ template inline T cos(Unit angle) { return std::cos(T(angle));
template inline T cos(Unit angle) { return cos(Rad(angle)); }
#endif
-#if defined(__GNUC__) && !defined(__clang__)
+#if defined(CORRADE_TARGET_GCC) && !defined(CORRADE_TARGET_CLANG)
namespace Implementation {
/* GCC builtin since 3.4 (https://stackoverflow.com/a/2742861),
unfortunately either Clang nor MSVC have any alternative which wouldn't
@@ -192,7 +192,7 @@ instruction as well.
template inline std::pair sincos(Rad angle);
#else
template inline std::pair sincos(Unit angle) {
- #if defined(__GNUC__) && !defined(__clang__)
+ #if defined(CORRADE_TARGET_GCC) && !defined(CORRADE_TARGET_CLANG)
std::pair out;
Implementation::sincos(T(angle), out.first, out.second);
return out;
diff --git a/src/Magnum/Math/Test/HalfTest.cpp b/src/Magnum/Math/Test/HalfTest.cpp
index 36611c81a..92b24d4c7 100644
--- a/src/Magnum/Math/Test/HalfTest.cpp
+++ b/src/Magnum/Math/Test/HalfTest.cpp
@@ -625,7 +625,7 @@ void HalfTest::debug() {
Debug{&out} << -36.41_h << Half{Constants::inf()}
<< Math::Vector3{3.14159_h, -1.4142_h, 1.618_h};
- #ifdef _MSC_VER
+ #ifdef CORRADE_TARGET_MSVC
CORRADE_COMPARE(out.str(), "-36.41 inf Vector(3.141, -1.414, 1.618)\n");
#else
CORRADE_COMPARE(out.str(), "-36.41 inf Vector(3.141, -1.414, 1.618)\n");
diff --git a/src/Magnum/MeshTools/Interleave.h b/src/Magnum/MeshTools/Interleave.h
index cf932856b..299435d79 100644
--- a/src/Magnum/MeshTools/Interleave.h
+++ b/src/Magnum/MeshTools/Interleave.h
@@ -54,12 +54,12 @@ struct AttributeCount {
next
#endif
) const {
- #ifdef _MSC_VER
+ #ifdef CORRADE_TARGET_MSVC
#pragma warning(push)
#pragma warning(disable:4127) /* conditional expression is constant (of course) */
#endif
CORRADE_ASSERT(sizeof...(next) == 0 || AttributeCount{}(next...) == first.size() || AttributeCount{}(next...) == ~std::size_t(0), "MeshTools::interleave(): attribute arrays don't have the same length, expected" << first.size() << "but got" << AttributeCount{}(next...), 0);
- #ifdef _MSC_VER
+ #ifdef CORRADE_TARGET_MSVC
#pragma warning(pop)
#endif
diff --git a/src/Magnum/PixelFormat.cpp b/src/Magnum/PixelFormat.cpp
index 7d3fb2d82..1f0a4ca10 100644
--- a/src/Magnum/PixelFormat.cpp
+++ b/src/Magnum/PixelFormat.cpp
@@ -38,7 +38,7 @@ UnsignedInt pixelSize(const PixelFormat format) {
CORRADE_ASSERT(!isPixelFormatImplementationSpecific(format),
"pixelSize(): can't determine size of an implementation-specific format" << reinterpret_cast(pixelFormatUnwrap(format)), {});
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -111,7 +111,7 @@ UnsignedInt pixelSize(const PixelFormat format) {
case PixelFormat::RGBA32F:
return 16;
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
diff --git a/src/Magnum/Platform/Implementation/DpiScaling.cpp b/src/Magnum/Platform/Implementation/DpiScaling.cpp
index bf1a714ae..bca689236 100644
--- a/src/Magnum/Platform/Implementation/DpiScaling.cpp
+++ b/src/Magnum/Platform/Implementation/DpiScaling.cpp
@@ -81,27 +81,27 @@ Float x11DpiScaling() {
won't be and that's okay -- it may be using Wayland or something else. */
void* xlib = dlopen(nullptr, RTLD_NOW|RTLD_GLOBAL);
Containers::ScopeGuard closeXlib{xlib, dlclose};
- #ifdef __GNUC__ /* http://www.mr-edd.co.uk/blog/supressing_gcc_warnings */
+ #ifdef CORRADE_TARGET_GCC /* http://www.mr-edd.co.uk/blog/supressing_gcc_warnings */
__extension__
#endif
auto xOpenDisplay = reinterpret_cast(dlsym(xlib, "XOpenDisplay"));
- #ifdef __GNUC__ /* http://www.mr-edd.co.uk/blog/supressing_gcc_warnings */
+ #ifdef CORRADE_TARGET_GCC /* http://www.mr-edd.co.uk/blog/supressing_gcc_warnings */
__extension__
#endif
auto xCloseDisplay = reinterpret_cast(dlsym(xlib, "XCloseDisplay"));
- #ifdef __GNUC__ /* http://www.mr-edd.co.uk/blog/supressing_gcc_warnings */
+ #ifdef CORRADE_TARGET_GCC /* http://www.mr-edd.co.uk/blog/supressing_gcc_warnings */
__extension__
#endif
auto xResourceManagerString = reinterpret_cast(dlsym(xlib, "XResourceManagerString"));
- #ifdef __GNUC__ /* http://www.mr-edd.co.uk/blog/supressing_gcc_warnings */
+ #ifdef CORRADE_TARGET_GCC /* http://www.mr-edd.co.uk/blog/supressing_gcc_warnings */
__extension__
#endif
auto xrmGetStringDatabase = reinterpret_cast(dlsym(xlib, "XrmGetStringDatabase"));
- #ifdef __GNUC__ /* http://www.mr-edd.co.uk/blog/supressing_gcc_warnings */
+ #ifdef CORRADE_TARGET_GCC /* http://www.mr-edd.co.uk/blog/supressing_gcc_warnings */
__extension__
#endif
auto xrmGetResource = reinterpret_cast(dlsym(xlib, "XrmGetResource"));
- #ifdef __GNUC__ /* http://www.mr-edd.co.uk/blog/supressing_gcc_warnings */
+ #ifdef CORRADE_TARGET_GCC /* http://www.mr-edd.co.uk/blog/supressing_gcc_warnings */
__extension__
#endif
auto xrmDestroyDatabase = reinterpret_cast(dlsym(xlib, "XrmDestroyDatabase"));
diff --git a/src/Magnum/Platform/Implementation/OpenGLFunctionLoader.cpp b/src/Magnum/Platform/Implementation/OpenGLFunctionLoader.cpp
index 2cb6775c7..d476b264a 100644
--- a/src/Magnum/Platform/Implementation/OpenGLFunctionLoader.cpp
+++ b/src/Magnum/Platform/Implementation/OpenGLFunctionLoader.cpp
@@ -37,7 +37,7 @@
/* WGL-specific stuff */
#elif defined(CORRADE_TARGET_WINDOWS)
-#ifdef _MSC_VER
+#ifdef CORRADE_TARGET_MSVC
#pragma warning(disable: 4055)
#pragma warning(disable: 4054)
#endif
diff --git a/src/Magnum/Test/MeshTest.cpp b/src/Magnum/Test/MeshTest.cpp
index 5eaa5a50b..c6a0b30d8 100644
--- a/src/Magnum/Test/MeshTest.cpp
+++ b/src/Magnum/Test/MeshTest.cpp
@@ -107,7 +107,7 @@ void MeshTest::primitiveMapping() {
- that the entries are ordered by number by comparing a function to
expected result (so insertion here is done in proper place)
- that there was no gap (unhandled value inside the range) */
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -122,7 +122,7 @@ void MeshTest::primitiveMapping() {
#include "Magnum/Implementation/meshPrimitiveMapping.hpp"
#undef _c
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
@@ -188,7 +188,7 @@ void MeshTest::indexTypeMapping() {
- that the entries are ordered by number by comparing a function to
expected result (so insertion here is done in proper place)
- that there was no gap (unhandled value inside the range) */
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -203,7 +203,7 @@ void MeshTest::indexTypeMapping() {
#include "Magnum/Implementation/meshIndexTypeMapping.hpp"
#undef _c
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
diff --git a/src/Magnum/Test/PixelFormatTest.cpp b/src/Magnum/Test/PixelFormatTest.cpp
index 7f595efc3..a0f32cb8d 100644
--- a/src/Magnum/Test/PixelFormatTest.cpp
+++ b/src/Magnum/Test/PixelFormatTest.cpp
@@ -123,7 +123,7 @@ void PixelFormatTest::mapping() {
- that the entries are ordered by number by comparing a function to
expected result (so insertion here is done in proper place)
- that there was no gap (unhandled value inside the range) */
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -138,7 +138,7 @@ void PixelFormatTest::mapping() {
#include "Magnum/Implementation/pixelFormatMapping.hpp"
#undef _c
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
@@ -162,7 +162,7 @@ void PixelFormatTest::compressedMapping() {
- that the entries are ordered by number by comparing a function to
expected result (so insertion here is done in proper place)
- that there was no gap (unhandled value inside the range) */
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -184,7 +184,7 @@ void PixelFormatTest::compressedMapping() {
#include "Magnum/Implementation/compressedPixelFormatMapping.hpp"
#undef _c
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
diff --git a/src/Magnum/Test/VertexFormatTest.cpp b/src/Magnum/Test/VertexFormatTest.cpp
index 7bc871955..f2c4e83b7 100644
--- a/src/Magnum/Test/VertexFormatTest.cpp
+++ b/src/Magnum/Test/VertexFormatTest.cpp
@@ -190,7 +190,7 @@ void VertexFormatTest::mapping() {
- that the entries are ordered by number by comparing a function to
expected result (so insertion here is done in proper place)
- that there was no gap (unhandled value inside the range) */
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -205,7 +205,7 @@ void VertexFormatTest::mapping() {
#include "Magnum/Implementation/vertexFormatMapping.hpp"
#undef _c
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
diff --git a/src/Magnum/Trade/Test/MaterialDataTest.cpp b/src/Magnum/Trade/Test/MaterialDataTest.cpp
index 340b19f9b..18d33b997 100644
--- a/src/Magnum/Trade/Test/MaterialDataTest.cpp
+++ b/src/Magnum/Trade/Test/MaterialDataTest.cpp
@@ -374,7 +374,7 @@ void MaterialDataTest::attributeMap() {
/* Attribute 0 reserved for an invalid value */
const auto attribute = MaterialAttribute(i);
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -400,7 +400,7 @@ void MaterialDataTest::attributeMap() {
#undef _ct
#undef _cnt
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
}
@@ -417,7 +417,7 @@ void MaterialDataTest::layerMap() {
/* Attribute 0 reserved for an invalid value */
const auto attribute = MaterialLayer(i);
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -429,7 +429,7 @@ void MaterialDataTest::layerMap() {
#include "Magnum/Trade/Implementation/materialLayerProperties.hpp"
#undef _c
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
}
diff --git a/src/Magnum/Vk/Test/DeviceFeaturesTest.cpp b/src/Magnum/Vk/Test/DeviceFeaturesTest.cpp
index d765c3149..771afe40c 100644
--- a/src/Magnum/Vk/Test/DeviceFeaturesTest.cpp
+++ b/src/Magnum/Vk/Test/DeviceFeaturesTest.cpp
@@ -58,7 +58,7 @@ void DeviceFeaturesTest::mapping() {
expected result (so insertion here is done in proper place)
- that there was no gap (unhandled value inside the range)
- that the Debug output is equivalent to the name */
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -80,7 +80,7 @@ void DeviceFeaturesTest::mapping() {
#undef _cver
#undef _cext
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
diff --git a/src/Magnum/Vk/Test/MeshLayoutTest.cpp b/src/Magnum/Vk/Test/MeshLayoutTest.cpp
index 5cc893d77..c79fc1dd3 100644
--- a/src/Magnum/Vk/Test/MeshLayoutTest.cpp
+++ b/src/Magnum/Vk/Test/MeshLayoutTest.cpp
@@ -126,7 +126,7 @@ void MeshLayoutTest::mapMeshPrimitive() {
too much. */
for(UnsignedInt i = 1; i <= 0xffff; ++i) {
const auto primitive = Magnum::MeshPrimitive(i);
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -139,7 +139,7 @@ void MeshLayoutTest::mapMeshPrimitive() {
#include "Magnum/Implementation/meshPrimitiveMapping.hpp"
#undef _c
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
}
diff --git a/src/Magnum/Vk/Test/PipelineTest.cpp b/src/Magnum/Vk/Test/PipelineTest.cpp
index 80751fca5..f6f4f24ef 100644
--- a/src/Magnum/Vk/Test/PipelineTest.cpp
+++ b/src/Magnum/Vk/Test/PipelineTest.cpp
@@ -151,7 +151,7 @@ void PipelineTest::dynamicRasterizationStateMapping() {
- that the entries are ordered by number by comparing a function to
expected result (so insertion here is done in proper place)
- that there was no gap (unhandled value inside the range) */
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -168,7 +168,7 @@ void PipelineTest::dynamicRasterizationStateMapping() {
#include "Magnum/Vk/Implementation/dynamicRasterizationStateMapping.hpp"
#undef _c
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
diff --git a/src/Magnum/Vk/Test/PixelFormatTest.cpp b/src/Magnum/Vk/Test/PixelFormatTest.cpp
index 4f248f4d8..84de93249 100644
--- a/src/Magnum/Vk/Test/PixelFormatTest.cpp
+++ b/src/Magnum/Vk/Test/PixelFormatTest.cpp
@@ -80,7 +80,7 @@ void PixelFormatTest::map() {
- that there was no gap (unhandled value inside the range)
- that a particular generic format maps to a particular format
- that the debug output matches what was converted */
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -116,7 +116,7 @@ void PixelFormatTest::map() {
#undef _s
#undef _c
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
@@ -188,7 +188,7 @@ void PixelFormatTest::mapCompressed() {
- that there was no gap (unhandled value inside the range)
- that a particular generic format maps to a particular format
- that the debug output matches what was converted */
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -224,7 +224,7 @@ void PixelFormatTest::mapCompressed() {
#undef _s
#undef _c
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif
diff --git a/src/Magnum/Vk/Test/VertexFormatTest.cpp b/src/Magnum/Vk/Test/VertexFormatTest.cpp
index e711d6263..f6d01a027 100644
--- a/src/Magnum/Vk/Test/VertexFormatTest.cpp
+++ b/src/Magnum/Vk/Test/VertexFormatTest.cpp
@@ -71,7 +71,7 @@ void VertexFormatTest::map() {
- that a particular generic format maps to a particular format
- that the debug output matches what was converted
*/
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wswitch"
#endif
@@ -107,7 +107,7 @@ void VertexFormatTest::map() {
#undef _s
#undef _c
}
- #ifdef __GNUC__
+ #ifdef CORRADE_TARGET_GCC
#pragma GCC diagnostic pop
#endif