Skip to content

Commit 5313888

Browse files
committed
Changed to avoid conflicts with windows standard headers.
1 parent 558e7f6 commit 5313888

4 files changed

Lines changed: 82 additions & 25 deletions

File tree

Solver/src/ReportClient.cpp

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
1-
#if defined(_WIN32)
2-
#ifndef NOMINMAX
3-
#define NOMINMAX
4-
#endif
5-
#ifndef WIN32_LEAN_AND_MEAN
6-
#define WIN32_LEAN_AND_MEAN
7-
#endif
8-
#include <windows.h>
9-
10-
// Defensive cleanup for common macro collisions from legacy/project headers
11-
#ifdef Source
12-
#undef Source
13-
#endif
14-
#ifdef Destination
15-
#undef Destination
16-
#endif
1+
#ifdef _WIN32
2+
#ifndef WIN32_LEAN_AND_MEAN
3+
#define WIN32_LEAN_AND_MEAN
4+
#endif
5+
#ifndef NOMINMAX
6+
#define NOMINMAX
7+
#endif
8+
#ifndef NOGDI
9+
#define NOGDI
10+
#endif
11+
#include <windows.h>
12+
// Defensive cleanup for common macro collisions from legacy/project headers
13+
#ifdef Source
14+
#undef Source
15+
#endif
16+
#ifdef Destination
17+
#undef Destination
18+
#endif
19+
#ifdef POINT
20+
#undef POINT
21+
#endif
22+
#ifdef FIXED
23+
#undef FIXED
24+
#endif
1725
#endif
1826

1927
#include <MPoint.h>

Solver/src/intersection.cpp

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,27 @@
1717
#include "clipper.hpp"
1818
//#define TIMEIT
1919
#ifdef TIMEIT
20-
#define WIN32_LEAN_AND_MEAN
21-
#include <windows.h>
22-
#undef max
20+
#ifdef _WIN32
21+
#ifndef WIN32_LEAN_AND_MEAN
22+
#define WIN32_LEAN_AND_MEAN
23+
#endif
24+
#ifndef NOMINMAX
25+
#define NOMINMAX
26+
#endif
27+
#ifndef NOGDI
28+
#define NOGDI
29+
#endif
30+
#include <windows.h>
31+
#ifdef POINT
32+
#undef POINT
33+
#endif
34+
#ifdef FIXED
35+
#undef FIXED
36+
#endif
37+
#endif
38+
#ifdef max
39+
#undef max
40+
#endif
2341
#endif
2442
//temp for debugging
2543
namespace ClipperLib {

matlab/clipperLink/matlabClipper.cpp

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,26 @@
66
#include <MBridge/Figure.h>
77
#include <stdint.h>
88
#include <cassert>
9-
#ifdef WIN32
10-
#define WIN32_LEAN_AND_MEAN
11-
#include <windows.h>
9+
10+
#ifdef _WIN32
11+
#ifndef WIN32_LEAN_AND_MEAN
12+
#define WIN32_LEAN_AND_MEAN
13+
#endif
14+
#ifndef NOMINMAX
15+
#define NOMINMAX
16+
#e ndif
17+
#ifndef NOGDI
18+
#define NOGDI
19+
#endif
20+
#include <windows.h>
21+
#ifdef POINT
22+
#undef POINT
23+
#endif
24+
#ifdef FIXED
25+
#undef FIXED
26+
#endif
1227
#endif
28+
1329
typedef matlabLink::MData<int64_t> iArray;
1430

1531
void fillClipper(const iArray & xa, const iArray &ya, ClipperLib::Path &dest) {

matlab/clipperLink/mexClipper.cpp

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,24 @@
55
#include <MBridge/FronTierAdapt.h>
66
#include <MBridge/Figure.h>
77
#include <stdint.h>
8-
#ifdef WIN32
9-
#define WIN32_LEAN_AND_MEAN
10-
#include <windows.h>
8+
9+
#ifdef _WIN32
10+
#ifndef WIN32_LEAN_AND_MEAN
11+
#define WIN32_LEAN_AND_MEAN
12+
#endif
13+
#ifndef NOMINMAX
14+
#define NOMINMAX
15+
#endif
16+
#ifndef NOGDI
17+
#define NOGDI
18+
#endif
19+
#include <windows.h>
20+
#ifdef POINT
21+
#undef POINT
22+
#endif
23+
#ifdef FIXED
24+
#undef FIXED
25+
#endif
1126
#endif
1227

1328
using spatial::Point2D;

0 commit comments

Comments
 (0)