From 217b571a6526f6c101efbb77075fc3287eec4ddf Mon Sep 17 00:00:00 2001 From: Philippe Coval Date: Wed, 29 Mar 2017 14:44:06 +0200 Subject: [PATCH] zigbee_wrapper: Do IEEE754 test at runtime Some systems (Tizen) havent __STDC_IEC_559__ defined while sizeof(double) = 8, build breaks. Moving test to run time is more flexible For the record: BUILD_ID=tizen-ivi_20170328.2_ivi-target-odroidxu3 gcc -dM -E - < /dev/null | grep 559 #define __GCC_IEC_559_COMPLEX 0 #define __GCC_IEC_559 0 Change-Id: I427188afcb6178e9a5e15c341185eb1b3d951fc8 Signed-off-by: Philippe Coval Reviewed-on: https://gerrit.iotivity.org/gerrit/18333 Tested-by: jenkins-iotivity Reviewed-by: Joseph Morrow Tested-by: Joseph Morrow --- plugins/zigbee_wrapper/src/zigbee_wrapper.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/zigbee_wrapper/src/zigbee_wrapper.c b/plugins/zigbee_wrapper/src/zigbee_wrapper.c index 7087fc3..6f96e02 100644 --- a/plugins/zigbee_wrapper/src/zigbee_wrapper.c +++ b/plugins/zigbee_wrapper/src/zigbee_wrapper.c @@ -42,7 +42,7 @@ // then we are guaranteed that the 'double' type is 64-bit. Otherwise, the // compilation of this file should fail because we are no longer guaranteed. #ifndef __STDC_IEC_559__ -#error "Requires IEEE 754 floating point!" +#warning "Requires IEEE 754 floating point!" #endif #include "zigbee_wrapper.h" @@ -435,6 +435,10 @@ OCStackResult ZigbeeInit(const char * comPort, PIPlugin_Zigbee ** plugin, PINewResourceFound newResourceCB, PIObserveNotificationUpdate observeNotificationUpdate) { + if (sizeof(double) != 64/8) + { + return OC_STACK_ERROR; + } if (!plugin) { return OC_STACK_INVALID_PARAM; -- 2.7.4