You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.
Here's an "svn diff" patch to fix the multiple minor problems (mostly
linuxisms) that stopped it from building on FreeBSD. With this patch, "gmake
check" passes. I've tried to rely on only standard features wherever possible,
but on some of the scripts I wussed out and said "run bash" instead.
Summary of changes:
- Prefer standard POSIX shell constructs where possible:
- Bash isn't necessarily in /bin (FreeBSD puts it in /usr/local/bin);
- expr-matching instead of grep <<< string;
- case-statement instead of == inside [[ ]];
- "foo()" instead of "function foo";
- "for (( s1; expr; s2 ))" is not supported;
- "$SZL" in command position isn't always expanded correctly [actually, I'm not sure about this since I found some instances of $"$SZL" that might explain the odd error messages]; and
- in test statements, "-eq" instead of "==".
- Detect at configure time whether va_copy is supported, and if so use it
instead of trying to use __va_copy.
- Use a union type to effect reinterpret-casting between double and unsigned
long long; the pointer-reinterpretation approach failed disastrously with the
requested -O2 -fstrict-aliasing flags, causing incorrect values to come out of
the cast.
- On systems without ieee754.h (e.g. FreeBSD), generate random floats and
doubles by multiplying the minimum representable value >1 by a random integer
to get an exactly-representable value. I microbenchmarked this and found it to
be a tiny bit faster than the existing
fill-a-struct-of-bitfields-and-reinterpret-cast approach. Oddly, it returned
the same values given the same random seed; you might consider using it even if
ieee754.h is available.
- An abs() call had an ambiguous type since it had definitions available for
int and long, but not for long long which was the actual arg type. Replaced
with llabs().
- The declaration of uintptr_t clashed with the slightly different declaration
in the standard library, so it was made conditional on an autoconf check.
- ACX_USE_SYSTEM_EXTENSIONS doesn't exist, and that first X is probably a typo.
Read the ./configure output next time! :-)
Happy patching!
--Adrian.
who/aecolley
Original issue reported on code.google.com by aecolley on 8 Nov 2010 at 3:46
Original issue reported on code.google.com by
aecolley
on 8 Nov 2010 at 3:46Attachments:
The text was updated successfully, but these errors were encountered: