Skip to content
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

func_common.inl does not compile on clang 3.4 + libc++ on Android NDK #191

Closed
JohanKnutzen opened this issue Apr 15, 2014 · 6 comments
Closed
Assignees
Labels
Milestone

Comments

@JohanKnutzen
Copy link

I've attached a patch that negates this issue. May be applied to 0.9.5.3. Here is the patch:
http://pastebin.com/mR0BZ8xL

I guess that they implemented std::isinf and removed _isinf.

Android NDK: r9d

@JohanKnutzen

@Groovounet Groovounet added the bug label May 4, 2014
@Groovounet Groovounet added this to the GLM 0.9.5 milestone May 4, 2014
@Groovounet Groovounet self-assigned this May 4, 2014
@Groovounet
Copy link
Member

Hi,

Do you know a way to query the NDK version in C++? Through a #define?

Thanks,
Christophe

@JohanKnutzen
Copy link
Author

Hi Christophe,

I don't think that there is anything that specifies the NDK version. This bug is related to the usage of clang in conjunction with the NDK. Clang is required for C++11 and I don't think that the GCC compiler will support C++11 in the near future.

I have not confirmed this but std::isinf should work on other stl implementations on Android even when compiling using GCC 4.8.

Therefore, the patch should be safe and more portable.

Johan

@Groovounet
Copy link
Member

Hi Johan,

My concern is that I don't want to break compatibility with older version of the NDK.

Thanks,
Christophe

@Groovounet
Copy link
Member

Hi Johan,

I found a fix that I think will be reliable for old and new version of the NDK.
This fix has been pushed in GLM 0.9.5 branch.
If you could check the fix works for you, I would appreciate.

Thanks,
Christophe

@JohanKnutzen
Copy link
Author

Hi Christophe,

The ANDROID_API define does not refer to the ndk version. It refers to the Android API Level of the NDK. All versions of the ndk contain interfaces for api levels 3 - 19. In our project we are targeting api level 9. Most games target api level 9.

TL:DR: It's not the right define :).

To be honest I don't think that supporting older versions of the NDK make sense. The NDK is very unstable and for every release they fix a lot of important bugs. I think that most people who use the NDK, if not all, use the bleeding edge version.

Thank you,
Johan

@Groovounet
Copy link
Member

Hi Johan,

I have committed another fix where I am checking the version returned by __cplusplus. The logic here is that if the compiler is recent enough is would be a C++11 compiler and the library got fixed.

I am not quite 100% sure about that idea.

Thanks,
Christophe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants