When compiling trio with -DTRIO_MINIMAL I get the following warning:
[[
trio.c: In function ‘TrioReadDouble’:
trio.c:6702: warning: implicit declaration of function ‘trio_to_float’
]]
When doing a make test, I get:
[[
gcc -std=gnu99 -g -O2 -I. -DDEBUG -DTRIO_MINIMAL regression.o -L. -ltrio -lm -o regression
regression.o: In function `number_writer':
/tmp/trio/regression.c:679: undefined reference to `trio_equal'
./libtrio.a(trio.o): In function `TrioReadDouble':
/tmp/trio/trio.c:6702: undefined reference to `trio_to_float'
collect2: ld returned 1 exit status
make: *** [regression] Error 1
]]
I solved this by adding the following define. I'm not sure, though, if that wass the correct place to do it:
[[
*** /tmp/trio/triostr.h 2010-01-26 14:02:02.000000000 +0100
--- triostr.h 2013-03-15 00:19:19.000000000 +0100
***************
*** 119,124 ****
--- 119,127 ----
# 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)
]]
I forgot to add. This is with the latest release (1.14). When I tried this patch with the CVS trunk, it does solve the trio_to_float problem, but there are apparently some other missing defines when using -DTRIO_MINIMAL . The next one is:
[[
$ make test
gcc -std=gnu99 -g -O2 -I. -DDEBUG -DTRIO_MINIMAL -c -o regression.o regression.c
regression.c: In function ‘number_writer’:
regression.c:679: warning: implicit declaration of function ‘trio_equal’
gcc -std=gnu99 -g -O2 -I. -DDEBUG -DTRIO_MINIMAL regression.o -L. -ltrio -lm -o regression
regression.o: In function `number_writer':
/tmp/trio/regression.c:679: undefined reference to `trio_equal'
collect2: ld returned 1 exit status
]
Please disregard my previous patch. I found the guilty part. Rev 1.13 of triop.h had a change for conditional compilation. There was a confusion in for TRIO_MINIMAL. Here's the diff against trunk that fixes the regression and clears my issue:
Index: triop.h
RCS file: /cvsroot/ctrio/trio/triop.h,v
retrieving revision 1.19
diff -r1.19 triop.h
326,327c326,327
< # if !defined(TRIO_EMBED_NAN)
< # define TRIO_EMBED_NAN
---
> # if defined(TRIO_EMBED_NAN)
> # undef TRIO_EMBED_NAN
329,330c329,330
< # if !defined(TRIO_EMBED_STRING)
< # define TRIO_EMBED_STRING
---
> # if defined(TRIO_EMBED_STRING)
> # undef TRIO_EMBED_STRING
Thank you for the merge request.