Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4c649c9 authored by Dan Albert's avatar Dan Albert
Browse files

Add a pre-C++11 constexpr compatibility macro.

Needed for cases where something should be constexpr if possible, but
not being constexpr is fine if in pre-C++11 code (such as a const
static float member variable).

Bug: 18466763
Change-Id: I635d062575ba2fbc4cbe3a89f730128c404d95e1
parent 606bb5f2
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -43,6 +43,17 @@ static inline ssize_t pread64(int fd, void* buf, size_t nbytes, off64_t offset)
#  define ZD_TYPE long
#endif

/*
 * Needed for cases where something should be constexpr if possible, but not
 * being constexpr is fine if in pre-C++11 code (such as a const static float
 * member variable).
 */
#if __cplusplus >= 201103L
#define CONSTEXPR constexpr
#else
#define CONSTEXPR
#endif

/*
 * TEMP_FAILURE_RETRY is defined by some, but not all, versions of
 * <unistd.h>. (Alas, it is not as standard as we'd hoped!) So, if it's