mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-02-08 21:14:14 +00:00
Add nullptr implementation
This commit is contained in:
parent
bcbd934aea
commit
cadd6cd2c7
@ -97,10 +97,18 @@ typedef float vec_t; // needed before including progdefs.h
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Make NULL null pointer, not null integer
|
// Make NULL null pointer, not null integer
|
||||||
#ifdef __clang__
|
#ifdef __cplusplus
|
||||||
|
struct my_nullptr_t
|
||||||
|
{
|
||||||
|
template <typename T>
|
||||||
|
inline operator T*() { return static_cast<T*>(0); }
|
||||||
|
};
|
||||||
|
static my_nullptr_t my_nullptr;
|
||||||
#ifdef NULL
|
#ifdef NULL
|
||||||
#undef NULL
|
#undef NULL
|
||||||
#endif
|
#endif
|
||||||
#define NULL nullptr
|
#define NULL my_nullptr
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif //EXTDLL_H
|
#endif //EXTDLL_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user