Skip to content

Commit cfbcc55

Browse files
committed
Fix windows build error due to windows header definition leakage
1 parent 1cc5bec commit cfbcc55

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/api/apiCore.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@
2828
#include <graph/GraphRunCtx.hpp>
2929
#include <NvtxWrappers.hpp>
3030

31+
#ifdef _WIN32
32+
// near defined in minwindef.h causing compile error on Windows.
33+
#if defined(near)
34+
#undef near
35+
#endif
36+
37+
// far defined in minwindef.h causing compile error on Windows.
38+
#if defined(far)
39+
#undef far
40+
#endif
41+
#endif // _WIN32
42+
3143
extern "C" {
3244

3345
RGL_API rgl_status_t rgl_get_version_info(int32_t* out_major, int32_t* out_minor, int32_t* out_patch)

src/graph/RaytraceNode.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@
2020
#include <macros/optix.hpp>
2121
#include <RGLFields.hpp>
2222

23+
#ifdef _WIN32
24+
// near defined in minwindef.h causing compile error on Windows.
25+
#if defined(near)
26+
#undef near
27+
#endif
28+
29+
// far defined in minwindef.h causing compile error on Windows.
30+
#if defined(far)
31+
#undef far
32+
#endif
33+
#endif // _WIN32
34+
2335
void RaytraceNode::setParameters()
2436
{
2537
const static Vec2f defaultRangeValue = Vec2f(0.0f, FLT_MAX);

0 commit comments

Comments
 (0)