Skip to content

Commit

Permalink
cygwin port
Browse files Browse the repository at this point in the history
strerror ; ftell64 ; fseek64 modification to run with cygwin
  • Loading branch information
NoelBruno authored Oct 3, 2023
1 parent 093fe37 commit b61d743
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mdflib/src/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ void strerror(int __errnum, char *__buf, size_t __buflen) {
{

}
#elif (__CYGWIN__)
strerror_r(__errnum, __buf, __buflen);
#else
auto* dummy = strerror_r(__errnum, __buf, __buflen);
if (dummy != nullptr) {
Expand All @@ -50,6 +52,8 @@ int64_t ftell64(std::FILE *__stream) {
return _ftelli64(__stream);
#elif (__APPLE__)
return ftell64(__stream);
#elif (__CYGWIN__)
return ftello(__stream);
#else
return ftello64(__stream);
#endif
Expand All @@ -60,6 +64,8 @@ int fseek64(std::FILE *__stream, int64_t __off, int __whence) {
return _fseeki64(__stream, __off, __whence);
#elif (__APPLE__)
return fseek64(__stream, __off, __whence);
#elif (__CYGWIN__)
return fseeko(__stream, __off, __whence);
#else
return fseeko64(__stream, __off, __whence);
#endif
Expand Down

0 comments on commit b61d743

Please sign in to comment.