Sfoglia il codice sorgente

math: make sure PTRDIFF_MAX and INT_MAX are defined before using them.

undefined
Sam Hocevar 10 anni fa
parent
commit
bfe91c1098
1 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. +6
    -1
      src/lol/math/arraynd.h

+ 6
- 1
src/lol/math/arraynd.h Vedi File

@@ -26,12 +26,13 @@
#include <lol/base/array.h>
#include <lol/base/assert.h>

#include <cstddef>
#include <climits>
#include <type_traits>

namespace lol
{


template<typename T, ptrdiff_t L>
class arraynd_initializer
{
@@ -275,5 +276,9 @@ private:
template<typename... T> using array2d = arraynd<2, T...>;
template<typename... T> using array3d = arraynd<3, T...>;

/* Make sure these macros exist since we use them in preprocessor tests. */
static_assert(PTRDIFF_MAX > 0, "missing PTRDIFF_MAX");
static_assert(INT_MAX > 0, "missing INT_MAX");

} /* namespace lol */


Caricamento…
Annulla
Salva