math-compat: move static variable for NAN into #ifndef NAN block

And use G_GNUC_UNUSED instead of __attribute_used__
This commit is contained in:
Tim-Philipp Müller 2011-12-30 12:59:46 +00:00
parent eba636cc83
commit 8f7df5abac

View file

@ -79,21 +79,18 @@ __gst_math_compat_rintf (float x)
#define rintf(x) __gst_math_compat_rintf(x)
#endif
#ifndef NAN
#if G_BYTE_ORDER == G_BIG_ENDIAN
#define __gst_nan_bytes { 0x7f, 0xc0, 0, 0 }
#define __GST_NAN_BYTES { 0x7f, 0xc0, 0, 0 }
#elif G_BYTE_ORDER == G_LITTLE_ENDIAN
#define __GST_NAN_BYTES { 0, 0, 0xc0, 0x7f }
#endif
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
#define __gst_nan_bytes { 0, 0, 0xc0, 0x7f }
#endif
static union {
unsigned char __c[4];
float __d;
} __gst_nan_union __attribute_used__ = {
__gst_nan_bytes
} __gst_nan_union G_GNUC_UNUSED = {
__GST_NAN_BYTES
};
#ifndef NAN
#define NAN (__gst_nan_union.__d)
#endif