diff --git a/src/Magnum/Math/Frustum.h b/src/Magnum/Math/Frustum.h index f0f53f832..52b890c5b 100644 --- a/src/Magnum/Math/Frustum.h +++ b/src/Magnum/Math/Frustum.h @@ -43,8 +43,16 @@ #include "Magnum/Math/Vector4.h" #ifdef CORRADE_TARGET_WINDOWS /* I so HATE windef.h */ +/* far/near and FAR/NEAR are defined by minwindef.h, but the former are used by this file as variables. + While they are all empty defines, the Windows headers expect FAR/NEAR to be defined and so we redefine them here. + far/near are left undefined because they are not used directly in Windows headers. + */ #undef near +#undef NEAR +#define NEAR #undef far +#undef FAR +#define FAR #endif namespace Magnum { namespace Math { diff --git a/src/Magnum/Math/Matrix4.h b/src/Magnum/Math/Matrix4.h index 5c8b06e7e..07ec11dd6 100644 --- a/src/Magnum/Math/Matrix4.h +++ b/src/Magnum/Math/Matrix4.h @@ -38,8 +38,16 @@ #include "Magnum/Math/Vector4.h" #ifdef CORRADE_TARGET_WINDOWS /* I so HATE windef.h */ +/* far/near and FAR/NEAR are defined by minwindef.h, but the former are used by this file as variables. + While they are all empty defines, the Windows headers expect FAR/NEAR to be defined and so we redefine them here. + far/near are left undefined because they are not used directly in Windows headers. + */ #undef near +#undef NEAR +#define NEAR #undef far +#undef FAR +#define FAR #endif namespace Magnum { namespace Math { diff --git a/src/Magnum/SceneGraph/Camera.h b/src/Magnum/SceneGraph/Camera.h index 949e0d413..ee442e2fe 100644 --- a/src/Magnum/SceneGraph/Camera.h +++ b/src/Magnum/SceneGraph/Camera.h @@ -36,8 +36,16 @@ #include "Magnum/SceneGraph/visibility.h" #ifdef CORRADE_TARGET_WINDOWS /* I so HATE windef.h */ +/* far/near and FAR/NEAR are defined by minwindef.h, but the former are used by this file as variables. + While they are all empty defines, the Windows headers expect FAR/NEAR to be defined and so we redefine them here. + far/near are left undefined because they are not used directly in Windows headers. + */ #undef near +#undef NEAR +#define NEAR #undef far +#undef FAR +#define FAR #endif namespace Magnum { namespace SceneGraph { diff --git a/src/Magnum/Trade/CameraData.h b/src/Magnum/Trade/CameraData.h index 06f8ca2c7..5937d0a43 100644 --- a/src/Magnum/Trade/CameraData.h +++ b/src/Magnum/Trade/CameraData.h @@ -35,8 +35,16 @@ #include "Magnum/Trade/visibility.h" #ifdef CORRADE_TARGET_WINDOWS /* I so HATE windef.h */ +/* far/near and FAR/NEAR are defined by minwindef.h, but the former are used by this file as variables. + While they are all empty defines, the Windows headers expect FAR/NEAR to be defined and so we redefine them here. + far/near are left undefined because they are not used directly in Windows headers. + */ #undef near +#undef NEAR +#define NEAR #undef far +#undef FAR +#define FAR #endif namespace Magnum { namespace Trade {