mirror of
https://github.com/libretro/devilutionX.git
synced 2026-11-10 17:20:56 -10:00
`CelSprite` data pointer can never be `nullptr`. We implement a smaller `optional` for it by taking advantage of that.
17 lines
545 B
C++
17 lines
545 B
C++
#pragma once
|
|
|
|
#ifdef __has_include
|
|
#if defined(__cplusplus) && (__cplusplus >= 201606L || _MSC_VER >= 1930) && __has_include(<optional>)
|
|
#include <optional> // IWYU pragma: export
|
|
#elif __has_include(<experimental/optional>)
|
|
#include <experimental/optional> // IWYU pragma: export
|
|
#define optional experimental::optional
|
|
#define nullopt experimental::nullopt
|
|
#define nullopt_t experimental::nullopt_t
|
|
#else
|
|
#error "Missing support for <optional> or <experimental/optional>"
|
|
#endif
|
|
#else
|
|
#error "__has_include unavailable"
|
|
#endif
|