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

fatal error: typedef redefinition with different types on OSX #70

Closed
Algorithmus opened this issue Nov 29, 2016 · 7 comments
Closed

fatal error: typedef redefinition with different types on OSX #70

Algorithmus opened this issue Nov 29, 2016 · 7 comments
Milestone

Comments

@Algorithmus
Copy link

As explained in this issue, it seems OSX already includes GLsizeiptr and a few others. The same problem happens with glad.h as well. The workaround appears to be to use long instead of ptrdiff_t. Here's another example.

@Dav1dde
Copy link
Owner

Dav1dde commented Nov 29, 2016

Thanks, I will have to look into this and why these types already exist...

@Dav1dde Dav1dde added the bug label Nov 29, 2016
@BastiaanOlij
Copy link

Ran into this issue as well, any updates on this?

@Dav1dde
Copy link
Owner

Dav1dde commented Jan 4, 2017

Trying to look into this issue this weekend, hopefully I can find a way to reproduce it without having access to an OSX instance (I assume just getting the OSX headers is enough).

@BastiaanOlij
Copy link

Cheers :)

@Dav1dde
Copy link
Owner

Dav1dde commented Jan 6, 2017

The fix looks like this:

#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
typedef long GLintptr;
#else
typedef ptrdiff_t GLintptr;
#endif
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
typedef long GLsizeiptr;
#else
typedef ptrdiff_t GLsizeiptr;
#endif
typedef int64_t GLint64;
typedef uint64_t GLuint64;
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
typedef long GLintptrARB;
#else
typedef ptrdiff_t GLintptrARB;
#endif
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
typedef long GLsizeiptrARB;
#else
typedef ptrdiff_t GLsizeiptrARB;
#endif

OSX Versions > 10.6 (starting with 10.7) only have 64 bit support, unfortunately I cannot test this on an OSX device, please report back if it actually works as intended.

After that I will release a new version and update the online generator.

@Algorithmus
Copy link
Author

I put those changes in glad.h. Works for me.

@Dav1dde
Copy link
Owner

Dav1dde commented Jan 6, 2017

Awesome, thanks!

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

No branches or pull requests

3 participants