Portability fixes#74
Merged
ViralBShah merged 6 commits intoJuliaMath:masterfrom Jan 8, 2015
NuxiNL:master
Merged
Conversation
This test is also present in FreeBSD's <machine/ieeefp.h>. For FreeBSD it makes sense, but for a portable math library, we cannot assume that the system has a header file like <sys/cdefs.h> and that it uses a common header guard.
The finite() function has been superseded by isfinite(). There is also no need to use scalb(), as the exponent is also an integer value. We can simply use scalbn(). There is also no need to use __isnanf(). The values passed are guaranteed to be of type float, meaning we can safely use the standard isnan().
It seems that this header conditionally tests whether <complex.h> is included, as the 'complex' keyword is otherwise not available. This version of math_private.h includes <complex.h> unconditionally, so there is no need to test against this.
__ISO_C_VISIBLE is already defined on FreeBSD. By default, it has a value of 2011. This causes a lot of compiler warnings.
<sys/cdefs.h> is not a standard header. Instead, we'd better pull in a common header like <stdio.h>. It is very likely that such a header already provides the necessary bits.
Instead of using all sorts of operating system specific constructs, we can just query the compiler which byte order is being used. This has the advantage that the code builds on new platforms without any tweaks.
Contributor
Author
|
It seems that even though the code builds on OS X, the tests fail. My suspicion is that this is unrelated to this change, as the previous build also failed this way. |
Contributor
|
Yes, the OS X tests are borked. |
Member
|
Thanks. These are a nice set of changes. The mac tests need to be fixed, so that we can get a travis green. They have always been this way, but with Travis enabled now, we can't ignore it any more. One possibility could be to just do the compilation of the library, and run the tests after they are fixed to pass. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi there,
I'm currently working on getting openlibm working in an alternative POSIX-like environment which I'm planning on releasing in a couple of months from now. It seems the code builds pretty well, though I needed to tweak it in a couple of places.
Attached are a couple of cleanups that are needed to get openlibm to build.
Ed