X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Flibc-extension.cc;h=c10eca00af775afeb1a419cd75a98c61cab8c247;hb=58a8474614a518ef2db3ac9036fe87df77d5d489;hp=198ecbb7fe31cc3d3f6d0f4d5a17ef6f6c6371d5;hpb=10c31ddf558110fefea0e0cbc1eca9ff05c54036;p=lilypond.git diff --git a/flower/libc-extension.cc b/flower/libc-extension.cc index 198ecbb7fe..c10eca00af 100644 --- a/flower/libc-extension.cc +++ b/flower/libc-extension.cc @@ -8,14 +8,13 @@ Jan Nieuwenhuizen */ +#include + #include #include #include #include "libc-extension.hh" -/* - urg: why soo wierd? - */ char* strnlwr (char* start ,int n) { @@ -38,6 +37,24 @@ strnupr (char* start, int n) return start; } +/* + There are some strange problems with round() on early glibcs. + */ +double +my_round (double x) +{ + return floor (x -0.5)+ 1.0 ; +} + +#ifndef isinf +#if !HAVE_ISINF +int +isinf (double x) +{ + return x && ( x == x/ 2) ; +} +#endif +#endif #if !HAVE_MEMMEM @@ -64,7 +81,7 @@ _memmem (Byte const *haystack, int haystack_len, if (*subneedle++ != *subhaystack++) goto next; - // completed the needle. Gotcha. + /* Completed the needle. Gotcha. */ return (Byte *) haystack; next: haystack++; @@ -120,10 +137,6 @@ strrev (Byte* byte, int length_i) return byte; } -#if ! HAVE_LRINT -#define lrint(__x) ((long)(double) __x) -#endif - #if ! HAVE_SNPRINTF int snprintf (char *str, size_t, char const *format, ...) @@ -144,13 +157,3 @@ vsnprintf (char *str, size_t, char const *format, va_list args) return i; } #endif - - -#if !HAVE_ISINF -int -isinf (double x) -{ - return x && ( x == x/ 2) ; -} - -#endif