From 7e03db9cb903f13361fe8bdc7f080249d55086c1 Mon Sep 17 00:00:00 2001
From: Lev Walkin <vlm@lionet.info>
Date: Tue, 14 Sep 2004 13:50:21 +0000
Subject: [PATCH] more portable constructs

---
 skeletons/REAL.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/skeletons/REAL.c b/skeletons/REAL.c
index ea37965b..5ec56e48 100644
--- a/skeletons/REAL.c
+++ b/skeletons/REAL.c
@@ -257,7 +257,7 @@ asn1_double2REAL(REAL_t *st, double dbl_value) {
 		}
 		/* fpclassify(3) is not portable yet */
 		if(expval == -INT_MAX) {
-			if(signbit(dbl_value)) {
+			if(copysign(1.0, dbl_value) < 0.0) {
 				st->buf[0] = 0x80 | 0x40;
 				st->buf[1] = 0;
 				st->size = 2;
@@ -266,7 +266,7 @@ asn1_double2REAL(REAL_t *st, double dbl_value) {
 				st->size = 0;
 			}
 		} else if(isinf(dbl_value)) {
-			if(signbit(dbl_value)) {
+			if(copysign(1.0, dbl_value) < 0.0) {
 				st->buf[0] = 0x41;	/* MINUS-INFINITY */
 			} else {
 				st->buf[0] = 0x40;	/* PLUS-INFINITY */
-- 
GitLab