glib/glib/gnulib/isinf.c
Simon McVittie 44c004c84e Normalize C source files to end with exactly one newline
Some editors automatically remove trailing blank lines, or
automatically add a trailing newline to avoid having a trailing
non-blank line that is not terminated by a newline. To avoid unrelated
whitespace changes when users of such editors contribute to GLib,
let's pre-emptively normalize all files.

Unlike more intrusive whitespace normalization like removing trailing
whitespace from each line, this seems unlikely to cause significant
issues with cherry-picking changes to stable branches.

Implemented by:

    find . -name '*.[ch]' -print0 | \
    xargs -0 perl -0777 -p -i -e 's/\n+\z//g; s/\z/\n/g'

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-06-10 09:48:02 +01:00

31 lines
449 B
C

#ifndef _MSC_VER
#error "This implementation is currently supported for Visual Studio only!"
#endif
#include "config.h"
#include <gnulib_math.h>
#include <float.h>
#include <math.h>
int
gl_isinff (float x)
{
#if defined (_WIN64) && (defined (_M_X64) || defined (_M_AMD64))
return !_finitef (x);
#else
return !_finite (x);
#endif
}
int
gl_isinfd (double x)
{
return !_finite (x);
}
int
gl_isinfl (long double x)
{
return gl_isinfd (x);
}