Skip to content

[stdlib] Enable lgamma for Android. #19862

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 13, 2018

Conversation

drodriguez
Copy link
Contributor

Android Bionic offers lgammaf_r and lgamma_r only if _GNU_SOURCE is
provided. It also offers lgammal_r in API levels 23 and above, but
that one will not be available until 128 bit floats are supported.

The patch modifies the importer to use _GNU_SOURCE while importing
Android headers and slighly modify a check that was avoding the
function from being created for Android.

This fixes the compilation of the tgmath test in Android.

Android Bionic offers lgammaf_r and lgamma_r only if _GNU_SOURCE is
provided. It also offers lgammal_r in API levels 23 and above, but
that one will not be available until 128 bit floats are supported.

The patch modifies the importer to use _GNU_SOURCE while importing
Android headers and slighly modify a check that was avoding the
function from being created for Android.

This fixes the compilation of the tgmath test in Android.
Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -292,8 +292,8 @@ public func ${bfunc}(_ lhs: ${T}, _ rhs: ${T}) -> ${T} {
% if T == 'Float80':
#if (arch(i386) || arch(x86_64)) && !os(Windows)
% else:
// lgamma not avaialable on Windows, apparently?
#if !os(Windows) && !os(Android)
// lgamma not available on Windows, apparently?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol, not apparently, it is true, it is not. The Windows environment does not have C99 math support.

@compnerd
Copy link
Member

@swift-ci please test

@compnerd compnerd merged commit 387b9ab into swiftlang:master Oct 13, 2018
@drodriguez drodriguez deleted the android-enable-lgamma_r branch October 15, 2018 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants