Przeglądaj źródła

core: add our custom isnan() macro to the core headers.

legacy
Sam Hocevar sam 13 lat temu
rodzic
commit
04c4a959cd
2 zmienionych plików z 15 dodań i 13 usunięć
  1. +15
    -0
      src/core.h
  2. +0
    -13
      test/half.cpp

+ 15
- 0
src/core.h Wyświetl plik

@@ -45,6 +45,21 @@
# define FP_USE(x) (void)(x)
#endif

/* Ensure isnan() is present even on systems that don't define it, or
* when -ffast-math is being used. */
#if defined __FAST_MATH__
# undef isnan
#endif
#if !defined isnan
# define isnan isnan
# include <stdint.h>
static inline int isnan(float f)
{
union { float f; uint32_t x; } u = { f };
return (u.x << 1) > 0xff000000u;
}
#endif

// Base types
#include "trig.h"
#include "half.h"


+ 0
- 13
test/half.cpp Wyświetl plik

@@ -17,19 +17,6 @@
#include "core.h"
#include "lol/unit.h"

/* Ensure isnan() is present even on systems that don't define it, or
* when -ffast-math is being used. */
#if defined __FAST_MATH__
# undef isnan
#endif
#if !defined isnan
static inline int isnan(float f)
{
union { float f; uint32_t x; } u = { f };
return (u.x << 1) > 0xff000000u;
}
#endif

namespace lol
{



Ładowanie…
Anuluj
Zapisz