Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

Created Unassigned: nullptr defined as NULL on g++ [340]

$
0
0
Using g++ with C++ Rest SDK redefines nullptr as NULL even if nullptr is available.

In file include/cpprest/details/SafeInt3.hpp the following code is used to check if nullptr is available:

```
#if defined nullptr_t
#define NEEDS_NULLPTR_DEFINED 0
#else
#define NEEDS_NULLPTR_DEFINED 1
#endif
...
#if NEEDS_NULLPTR_DEFINED
#define nullptr NULL
#endif
```
However this is not a valid check (nullptr_t is a type so #if defined nullptr_t always evaluate to false leading to NEEDS_NULLPTR_DEFINED always beeing defined to 1).

Trying to change
```
#if defined nullptr_t
```
to
```
#if __cplusplus >= 201103L
```
which seems to be a more valid check breaks compilation (c.f. build_output.txt) of C++ REST SDK on my machine (using g++ 4.9.2 and boost 1.57.0).

Viewing all articles
Browse latest Browse all 4845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>