Blender Git Commit Log

Git Commits -> Revision ea70bd2

Revision ea70bd2 by Ray molenkamp (master)
September 14, 2019, 15:59 (GMT)
MSVC: Fix macro collision with MSVC Headers

Picked up while investigating a build error on the functions branch
which seems to use this specific header in a way master doesn't.

The problem:

The MSVC headers define a `_CONCAT` macro, so does BLI_kdtree_imp.h
however at the end `BLI_kdtree_imp.h` undefines the macro making the
MS headers that still rely on it "unhappy".

Who's fault is this:

Ours, C99 Spec says

```
7.1.3 Reserved identifiers

- All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use.

...

if the program removes (with #undef) any macro definition of an identifier in the first
group listed above, the behavior is undefined.
```

So we should not have defined it, and we definitely should not
have undefined it.

We have *tons* of these violations, although fixing them would be great
at one point lots of them are in /extern or in the 3rd party deps,
I'd rather deal with them on a case by case basis when it actually
causes issues.

Differential Revision: https://developer.blender.org/D5790

Reviewers: campbellbarton, JacquesLucke

Commit Details:

Full Hash: ea70bd2abf7c178076a403dd071fcf593b79c20c
Parent Commit: 5fe14f3
Lines Changed: +5, -5

1 Modified Path:

/source/blender/blenlib/BLI_kdtree_impl.h (+5, -5) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021