From bd4e44e5c382316e10682eb1b231d2fdc0ba5742 Mon Sep 17 00:00:00 2001
From: jose <jose.kahan@w3.org>
Date: Tue, 9 Oct 2018 17:59:11 +0200
Subject: [PATCH 1/2] Fixes compilation / linking errors when using
 -DTRIO_MINIMAL:

triostr.h
trio_to_float() definition was required but missing.

trionan.[ch]
Using the combination of TRIO_PRIVATE_NAN and TRIO_INLINE
resulted in static inline and the linker complaining
that c99_fpclassify_and_signbit didn't exist (debian stretch/gcc/x86).
This may be also the case of all the other functions covered
by TRIO_FUNC_FPCLASSIFY_AND_SIGNBIT.

Solved by changing those functions to use TRIO_INLINE_NAN and
assigning it the value of INLINE only when not using -DTRIO_MINIMAL
---
 trionan.c | 11 +++++++----
 trionan.h |  4 ++++
 triostr.h |  3 +++
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/trionan.c b/trionan.c
index e3bae34..796e978 100644
--- a/trionan.c
+++ b/trionan.c
@@ -68,6 +68,9 @@
 #if !defined(TRIO_PRIVATE_NAN)
 # define TRIO_PRIVATE_NAN TRIO_PRIVATE
 #endif
+#if !defined(TRIO_INLINE_NAN)
+# define TRIO_INLINE_NAN TRIO_INLINE
+#endif
 
 #define TRIO_TRUE (1 == 1)
 #define TRIO_FALSE (0 == 1)
@@ -427,7 +430,7 @@ TRIO_ARGS1((number),
 
 #if defined(TRIO_FUNC_C99_FPCLASSIFY_AND_SIGNBIT)
 
-TRIO_PRIVATE_NAN TRIO_INLINE int
+TRIO_PRIVATE_NAN TRIO_INLINE_NAN int
 c99_fpclassify_and_signbit
 TRIO_ARGS2((number, is_negative),
 	   double number,
@@ -452,7 +455,7 @@ TRIO_ARGS2((number, is_negative),
 
 #if defined(TRIO_FUNC_DECC_FPCLASSIFY_AND_SIGNBIT)
 
-TRIO_PRIVATE_NAN TRIO_INLINE int
+TRIO_PRIVATE_NAN TRIO_INLINE_NAN int
 decc_fpclassify_and_signbit
 TRIO_ARGS2((number, is_negative),
 	  double number,
@@ -570,7 +573,7 @@ TRIO_ARGS2((number, is_negative),
 
 #if defined(TRIO_FUNC_HP_FPCLASSIFY_AND_SIGNBIT)
 
-TRIO_PRIVATE_NAN TRIO_INLINE int
+TRIO_PRIVATE_NAN TRIO_INLINE_NAN int
 hp_fpclassify_and_signbit
 TRIO_ARGS2((number, is_negative),
 	  double number,
@@ -619,7 +622,7 @@ TRIO_ARGS2((number, is_negative),
 
 #if defined(TRIO_FUNC_XLC_FPCLASSIFY_AND_SIGNBIT)
 
-TRIO_PRIVATE_NAN TRIO_INLINE int
+TRIO_PRIVATE_NAN TRIO_INLINE_NAN int
 xlc_fpclassify_and_signbit
 TRIO_ARGS2((number, is_negative),
 	  double number,
diff --git a/trionan.h b/trionan.h
index b441b4a..b61dbc5 100644
--- a/trionan.h
+++ b/trionan.h
@@ -71,6 +71,10 @@ enum {
 #  endif
 # endif
 
+# if !defined(TRIO_INLINE_NAN)
+#  define TRIO_INLINE_NAN
+# endif  
+
 #else
 
 /*
diff --git a/triostr.h b/triostr.h
index 1e6939b..c0c6e72 100644
--- a/triostr.h
+++ b/triostr.h
@@ -119,6 +119,9 @@ enum {
 #  if !defined(TRIO_FUNC_TO_LONG_DOUBLE)
 #   define TRIO_FUNC_TO_LONG_DOUBLE
 #  endif
+#  if !defined(TRIO_FUNC_TO_FLOAT)
+#   define TRIO_FUNC_TO_FLOAT
+#  endif  
 # endif
 
 # if defined(TRIO_FUNC_STRING_TERMINATE)
-- 
2.34.1

