From 8f7df5abac92c77b2ac49373d19e2307775e5719 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 30 Dec 2011 12:59:46 +0000 Subject: [PATCH] math-compat: move static variable for NAN into #ifndef NAN block And use G_GNUC_UNUSED instead of __attribute_used__ --- gst/math-compat.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/gst/math-compat.h b/gst/math-compat.h index 8ad1c25..aa123db 100644 --- a/gst/math-compat.h +++ b/gst/math-compat.h @@ -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 } -#endif -#if G_BYTE_ORDER == G_LITTLE_ENDIAN -#define __gst_nan_bytes { 0, 0, 0xc0, 0x7f } +#define __GST_NAN_BYTES { 0x7f, 0xc0, 0, 0 } +#elif 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 -- 2.7.4