Skip to content

Commit

Permalink
Merge pull request cython#211 from Juntalis/master
Browse files Browse the repository at this point in the history
Non-Wrapped Inline Declaration Breaking Compatibility with C89 Compilers
  • Loading branch information
robertwb committed Apr 11, 2013
2 parents 332a526 + 87b8a49 commit cb94550
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions Cython/Utility/ModuleSetupCode.c
Expand Up @@ -262,10 +262,23 @@
#define __Pyx_DOCSTR(n) (n)
#endif

/* inline attribute */
#ifndef CYTHON_INLINE
#if defined(__GNUC__)
#define CYTHON_INLINE __inline__
#elif defined(_MSC_VER)
#define CYTHON_INLINE __inline
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define CYTHON_INLINE inline
#else
#define CYTHON_INLINE
#endif
#endif

#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static inline float __PYX_NAN() {
static CYTHON_INLINE float __PYX_NAN() {
/* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
a quiet NaN. */
Expand All @@ -277,19 +290,6 @@ static inline float __PYX_NAN() {

/////////////// UtilityFunctionPredeclarations.proto ///////////////

/* inline attribute */
#ifndef CYTHON_INLINE
#if defined(__GNUC__)
#define CYTHON_INLINE __inline__
#elif defined(_MSC_VER)
#define CYTHON_INLINE __inline
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define CYTHON_INLINE inline
#else
#define CYTHON_INLINE
#endif
#endif

/* unused attribute */
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
Expand Down

0 comments on commit cb94550

Please sign in to comment.