Closes#137
This reverts commit ebcd40f1b0.
The tests were failing to load the library on i386 due to an undefined
reference to __fpgetprec, which resulted from __fpgetprec not being inlined
due to the missing definition of __GNUCLIKE_ASM and __CC_SUPPORTS___INLINE__.
- Align DLLEXPORT in definitions and declations. There is still a few
cases left, where the declation in the compiler's complex.h disagrees
with the implementation here. For now we can't do anything about that,
but maybe should be revisited in the future.
- Fix the syntax on an .ascii directive that gcc accepted mistakingly, but
clang does not.
The current tradition of openlibm is to hide all of its internal symbols
into the reserved system namespace. CloudABI has a check in place to
ensure that its C library (which contains openlibm) to not place any
unwanted symbols into the public namespace. openlibm seems to leak
_scan_nan() in there, so we'd better add an additional underscore.
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.
Put external headers before internal ones. While there, replace a lot of
occurences of "openlibm.h" with <openlibm.h>. It should be thought of as
an external header, as it is installed along with the library.
We already provide lgammaf_r() and lgamma_r(). It's not hard to also add
lgammal_r(), for consistency.
I am currently working on porting openlibm to an environment where
global state, and thus signgam, is not available. By adding lgammal_r(),
I can trivially disable support for signgam by just patching up
src/e_lgamma{f,,l}.c. That way there is no need to patch up the actual
algorithms.
Letting tgammal() modify signgam has two disadvantages:
- It breaks valid code that assumes that the value of signgam is not
clobbered by calls to tgammal().
- It makes this function depend on the presence of signgam. signgam is
an X/Open System Interface. It is not part of the C standard.