Skip to content

Commit

Permalink
Add an etl::nullptr_t type
Browse files Browse the repository at this point in the history
  • Loading branch information
tigran2008 committed Jul 17, 2024
1 parent 744d54c commit 00ba1b6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion include/etl/nullptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,18 @@ SOFTWARE.

#include <stddef.h>

namespace etl
{
#if ETL_CPP11_NOT_SUPPORTED
// Use the old style C++ NULL definition.
#define ETL_NULLPTR 0
typedef enum { _nullptr = 0 } nullptr_t;
#define ETL_NULLPTR (etl::_nullptr)
#else
// Use the new style nullptr.
typedef decltype(nullptr) nullptr_t;
#define ETL_NULLPTR nullptr
#endif
}

#endif

0 comments on commit 00ba1b6

Please sign in to comment.