Skip to content

Conversation

edaigle
Copy link

@edaigle edaigle commented Apr 7, 2025

  • non-glibc Linux do not have stat64, causing build to fail on e.g. musl/Alpine.
  • this commit adds a check to make sure we are on a glibc system before using stat64.

Closes #807

* non-glibc Linux do not have stat64, causing build to fail on e.g. musl/Alpine.
* this commit adds a check to make sure we are on a glibc system before using stat64.
#endif

#if defined(__APPLE__)
#if defined(__APPLE__) || !defined (__GLIBC__)
Copy link

Choose a reason for hiding this comment

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

I don't think that change is correct - it would conflict with the define for stat64 when _MSC_VER is defined (above)

Maybe (assuming that __GLIBC__ isn't defined for __APPLE__ anyway):

#ifdef _MSC_VER
#define stat64 __stat64
#elif !defined(__GLIBC__)
#define stat64 stat
#endif

@cmeerw cmeerw mentioned this pull request May 25, 2025
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.

Build fails on non-glibc Linux due to use of stat64
2 participants