Index: trunk/config.h.in =================================================================== --- trunk/config.h.in (revision 3338) +++ trunk/config.h.in (revision 3339) @@ -73,6 +73,9 @@ print {\n\n/* Define to 1 if you have the `rint' function. */\n} print_ternary libs/math/rint/presents {#define HAVE_RINT 1} {/* #undef HAVE_RINT */} +print {\n\n/* Define to 1 if you have the `round' function. */\n} +print_ternary libs/math/round/presents {#define HAVE_ROUND 1} {/* #undef HAVE_ROUND */} + print {\n\n/* Wrapper for S_ISLNK(x); always return 0 if S_ISLNK doesn't exist */\n} switch ?/target/libs/fs/stat/macros/S_ISLNK case {^$} print {#define WRAP_S_ISLNK(x) 0}; end; Index: trunk/scconfig/Rev.h =================================================================== --- trunk/scconfig/Rev.h (revision 3338) +++ trunk/scconfig/Rev.h (revision 3339) @@ -1 +1 @@ -static const int myrev = 3183; +static const int myrev = 3339; Index: trunk/scconfig/Rev.tab =================================================================== --- trunk/scconfig/Rev.tab (revision 3338) +++ trunk/scconfig/Rev.tab (revision 3339) @@ -1,3 +1,4 @@ +3339 configure C89: round() is detected by scconfig 3183 distclean,configure C89 switchover 3179 configure C89 correctness: do not depend on hardwired long long, detect it 2985 configure Revcheck installed in Makefiles. Index: trunk/scconfig/hooks.c =================================================================== --- trunk/scconfig/hooks.c (revision 3338) +++ trunk/scconfig/hooks.c (revision 3339) @@ -231,6 +231,7 @@ require("libs/fs/realpath/*", 0, 0); require("libs/fs/readdir/*", 0, 1); require("libs/math/rint/*", 0, 0); + require("libs/math/round/*", 0, 0); require("libs/userpass/getpwuid/*", 0, 0); if (require("libs/ldl", 0, 0) != 0) { Index: trunk/src/compat_inc.h.in =================================================================== --- trunk/src/compat_inc.h.in (revision 3338) +++ trunk/src/compat_inc.h.in (revision 3339) @@ -13,6 +13,7 @@ @?/target/libs/fs/mkdtemp/includes@ @?/target/libs/fs/readdir/includes@ @?/target/libs/userpass/getpwuid/includes@ +@?/target/libs/math/round/includes@ @] put /tmpasm/IFS {\n} Index: trunk/src/compat_misc.c =================================================================== --- trunk/src/compat_misc.c (revision 3338) +++ trunk/src/compat_misc.c (revision 3339) @@ -101,3 +101,16 @@ memcpy(o, s, l+1); return o; } + +#ifdef HAVE_ROUND +#undef round +double pcb_round(double x) +{ + return round(x); +} +#else +double pcb_round(double x) +{ +#error need to implement round() +} +#endif Index: trunk/src/compat_misc.h =================================================================== --- trunk/src/compat_misc.h (revision 3338) +++ trunk/src/compat_misc.h (revision 3339) @@ -37,10 +37,6 @@ #define pcb_strdup_null(x) (((x) != NULL) ? pcb_strdup (x) : NULL) +double pcb_round(double x); -#warning TODO: detect this from scconfig -#undef round -extern double round(double x); -#define pcb_round round - #endif /* PCB_COMPAT_MISC_H */