Changeset 940 for trunk/src/core.h


Ignore:
Timestamp:
Sep 10, 2011, 4:55:44 PM (12 years ago)
Author:
sam
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core.h

    r923 r940  
    4646#endif
    4747
     48/* Ensure isnan() is present even on systems that don't define it, or
     49 * when -ffast-math is being used. */
     50#if defined __FAST_MATH__
     51#   undef isnan
     52#endif
     53#if !defined isnan
     54#   define isnan isnan
     55#   include <stdint.h>
     56static inline int isnan(float f)
     57{
     58    union { float f; uint32_t x; } u = { f };
     59    return (u.x << 1) > 0xff000000u;
     60}
     61#endif
     62
    4863// Base types
    4964#include "trig.h"
Note: See TracChangeset for help on using the changeset viewer.