Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit afdffd86 authored by Michael Hoisie's avatar Michael Hoisie
Browse files

Undefine 'near' and 'far' in mat4.h for host Windows

Previously, when a C++ file included 'windows.h' and subsequently
included 'mat4.h', a compile error occurred. This is because, for some
esoteric/obsolete reasons, 'windows.h' includes empty definitions of
'near' and 'far'. These conflict with the usage of 'near' and 'far' in
'mat4.h'.

Add some logic to 'mat4.h' for host Windows that undefines 'near' and
'far' to avoid these conflicts.

Test: Build libandroid_runtime on Windows
Bug: 328307399
Change-Id: I13d068e7f800cf370a0f7d9f1b98479f9c6aeb35
parent 1a067517
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -34,6 +34,14 @@
#define CONSTEXPR
#define CONSTEXPR
#endif
#endif


#ifdef _WIN32
// windows.h contains obsolete defines of 'near' and 'far' for systems using
// legacy 16 bit pointers. Undefine them to avoid conflicting with the usage of
// 'near' and 'far' in this file.
#undef near
#undef far
#endif

namespace android {
namespace android {
// -------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------
namespace details {
namespace details {