__always_inline is a (Free)BSD specific definition from cdefs.h.
Compilers like Clang don't care about these keywords anyway, as they
simply do whatever they like.
It looks like we already removed this keyword from ld80/e_rem_pio2l.h as
well. Apply exactly the same change to the ld128 version as well.
With this patch I have been able to successfully compile Openlibm on OpenBSD 5.7 (x86_64) using the following command:
gmake GCC=egcc GXX=eg++ USEGCC=1 ARCH=x86_64
(I had to install gcc 4.9 from ports, as Openlibm does not compile with the default compiler shipped with OpenBSD 5.7, which is gcc 4.2.1).
This is rather basic. A clean is needed to get rid of artifacts from
previous runs with other architectures.
Note this requires PR #88 to work because without it x86 is broken.
Closes#89
- Don't define llabs(). This breaks if llabs() is already a macro, which
is allowed by the C standard/POSIX. llabs() was introduced in C99, so
I think we can safely assume it is present on all interesting systems.
- Cast the parameters to fabs() to the floating point type. Clang has
introduced some interesting warnings that trigger if the arguments to
fabs*() are not the right type.
I often build the code with -Wmissing-prototypes to ensure that we don't
accidentically pollute the symbol namespace. If we want to provide a
symbol such as isopenlibm(), make sure we also declare it in
<openlibm_math.h>.
This is a bit more consistent with the naming of the other header files
(openlibm_complex.h and openlibm_fenv.h). Re-add an openlibm.h header
that includes all of the public headers as a shorthand.
Fix up all of the source files to include <openlibm_math.h> instead of
<openlibm.h>. While there, fix ordering of the includes.
While there, also modify the install target. We should make sure to
install all openlibm*.h headers. There is still some work to be done:
openlibm_fenv_*.h still depends on some additional bits. I'd propose
that we eventually create an include/openlibm_cdefs.h that contains all
of the macros we need.
Unlike the __weak_reference() macro, __strong_reference() does type
checking. It can only create the reference if the type of the source and
the destination function match exactly.
Even if double == long double in practice, they remain unequal at the
language level.