Commit graph

27 commits

Author SHA1 Message Date
Ed Schouten
bc3f903bc2 Move public headers into include/ and private headers into src/.
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.
2015-01-11 16:35:32 +01:00
Ed Schouten
c253db68ca Add a new compilation flag: OPENLIBM_ONLY_THREAD_SAFE.
The global signgam variable is only part of the X/Open System
Interfaces. It is not part of the POSIX base definitions nor the C
standard.

I'd rather have it disabled for my specific use-case, so introduce a new
compilation flag that we can use to disable it.
2015-01-10 09:57:33 +01:00
Ed Schouten
9fdc4f9d9e Fix a small number of -Wmissing-prototypes compiler warnings in sincos().
- Add missing prototypes to openlibm.h for sincos() and sincosf().
- Mark the internal kernel functions static.
2015-01-10 09:44:31 +01:00
Ed Schouten
f6b045b4cd Add bits to openlibm headers to switch between using the host headers. 2015-01-09 14:11:11 +01:00
Ed Schouten
410e6ebb59 Move CMPLX() into <openlibm_complex.h>, as it is normally part of <complex.h>.
While there, make CMPLX() work with Clang by using compound literals.
Now that cimag*() uses __imag__, we can also just inline the unions.
There is no need for the separate types anymore.

Also just define CMPLX() unconditionally now, as we no longer pull in
the host's <complex.h>.
2015-01-09 14:04:44 +01:00
Ed Schouten
08dbb2b517 Never include <complex.h>. Include <openlibm_complex.h> instead.
If we ship with a separate copy of <complex.h>, we should also use this
one instead of the one provided by the system.
2015-01-09 13:30:44 +01:00
Viral B. Shah
f5377fda83 Merge pull request #75 from NuxiNL/signgam
Clean up handling of signgam
2015-01-08 18:58:31 +05:30
Ed Schouten
5d6cb09b96 Change existing code to use CMPLX*() instead of cpack*() where possible.
I am currently working on building openlibm against stock copies of
<math.h>, instead of the openlibm.h header. It seems that a C compliant
<math.h> header can be used as a drop-in replacement for openlibm.h,
with the exception that it lacks cpack*().

In FreeBSD SVN r275819 I patched up the math library by replacing
cpack*() by CMPLX*(). That way many functions become less tied to the
intrinsics of the math library. Make the same change to openlibm.
2015-01-08 12:02:56 +01:00
Ed Schouten
55ac462808 Add lgammal_r().
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.
2015-01-08 11:23:28 +01:00
Ed Schouten
24cec16fcc Remove references to _DECLARE_C99_LDBL_MATH.
When building openlibm with Clang, I seem to get a lot of warnings in
ld80/ related to some prototypes for long double functions that are
missing. This seems to be because we don't define _DECLARE_C99_LDBL_MATH
anywhere.

It seems that this definition only existed on FreeBSD, as certain C99
math functions were not present yet. The prototypes were simply there as
placeholders. This flag has been removed upstream (FreeBSD SVN r236148).
2015-01-08 11:07:03 +01:00
Ed Schouten
f9fd21c96f Don't define __ISO_C_VISIBLE unconditionally.
__ISO_C_VISIBLE is already defined on FreeBSD. By default, it has a
value of 2011. This causes a lot of compiler warnings.
2015-01-07 22:20:56 +01:00
Viral B. Shah
d8c909a980 Add all the complex declarations to openlibm.h. 2014-12-05 00:37:39 +05:30
Elliot Saba
e9d02ee729 Fix compilation by including cdefs-compat.h in math_private.h
Also fix redefinition of __pure2
2014-06-05 22:08:41 -07:00
Thomas Leonard
f22d7db106 Fixed build on ARM
Removed all long double support, since ARM doesn't have long doubles.
2014-05-26 10:55:49 +01:00
Thomas Leonard
15fa3252fc Merge noinc branch 2014-05-19 15:29:33 +01:00
Milan Bouchet-Valat
3e769e48b8 Move complex number declarations to openlibm.h
These are used by openspecfun, thus they need to be available
from public headers.
2014-03-29 11:24:31 +01:00
Elliot Saba
7065fdf6c5 Remove {cdefs,types}-compat.h from openlibm.h 2014-02-08 21:35:14 -08:00
Jameson Nash
0df00dd0f7 initial attempt getting everything to build on windows 2012-04-08 20:03:36 -04:00
Viral B. Shah
68fae89b6a Ignore __pure2 on linux as I don't know what to do about it. 2012-01-05 23:33:01 -05:00
Viral B. Shah
7129663350 OpenLIBM builds on linux.
Disable -std=c99 on linux for now, as gcc does freaks out in math_private.h
on the definition of IEEE_WORD_ORDER, and defines ieee_double_shape_type twice.

Disable building s_cbrtl.c for the time being as it requires ieeefp.h
2012-01-05 23:24:14 -05:00
Viral B. Shah
394d97b5e2 198 out of 203 files build now. 2011-12-31 00:48:35 +05:30
Viral B. Shah
e4481ba487 Get a bunch of stuff to build with clang. 2011-12-31 00:25:58 +05:30
Viral B. Shah
3c7b5cc6f7 Get much of src/ to build.
Use build.clang.sh or build.gcc.sh for the time being.
2011-12-16 11:00:31 +05:30
Viral B. Shah
b0b27a0ff4 Replace math.h with openlibm.h
Remove man
2011-12-15 11:54:24 +05:30
Viral B. Shah
16b9264f9d Import entire msun from FreeBSD. 2011-12-15 11:29:35 +05:30
Viral B. Shah
db4db9cf35 uint64_t -> u_int64_t 2011-08-13 10:43:52 +05:30
Viral B. Shah
aba7ae910f Initialize repo. FreeBSD 8.2 msun code + some tweaks 2011-08-13 00:31:25 +05:30