diff options
Diffstat (limited to 'main/strcompat.c')
-rw-r--r-- | main/strcompat.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/main/strcompat.c b/main/strcompat.c index dcd84d876..c3b4ff180 100644 --- a/main/strcompat.c +++ b/main/strcompat.c @@ -17,6 +17,8 @@ /*! \file * * \brief Compatibility functions for strsep and strtoq missing on Solaris + * + * .. and lots of other functions too. */ /*** MODULEINFO @@ -568,3 +570,15 @@ char *mkdtemp(char *path) return mktemp_internal(path, 0, MKTEMP_DIR) ? NULL : path; } #endif + +#ifndef HAVE_ROUNDF +#ifndef HAVE_ROUND +float roundf(float x) { + if (x < 0.0) { + return (float)(int)((x) - 0.5); + } else { + return (float)(int)((x) + 0.5); + } +} +#endif +#endif |