Skip to content

Commit

Permalink
crnlib: use native fopen/fseek/ftell on MinGW
Browse files Browse the repository at this point in the history
  • Loading branch information
illwieckz committed Jun 25, 2024
1 parent 7cd3e85 commit 3b0be5a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crnlib/crn_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ const bool c_crnlib_little_endian_platform = false;

const bool c_crnlib_big_endian_platform = !c_crnlib_little_endian_platform;

#if defined(__linux__)
#if defined(_WIN32)
#define crn_fopen(pDstFile, f, m) fopen_s(pDstFile, f, m)
#define crn_fseek _fseeki64
#define crn_ftell _ftelli64
#elif defined(__linux__)
#define crn_fopen(pDstFile, f, m) *(pDstFile) = fopen64(f, m)
#define crn_fseek fseeko64
#define crn_ftell ftello64
Expand All @@ -28,10 +32,6 @@ const bool c_crnlib_big_endian_platform = !c_crnlib_little_endian_platform;
#define crn_fopen(pDstFile, f, m) *(pDstFile) = fopen(f, m)
#define crn_fseek fseeko
#define crn_ftell ftello
#elif defined(_MSC_VER)
#define crn_fopen(pDstFile, f, m) fopen_s(pDstFile, f, m)
#define crn_fseek _fseeki64
#define crn_ftell _ftelli64
#else
#define crn_fopen(pDstFile, f, m) *(pDstFile) = fopen(f, m)
#define crn_fseek(s, o, w) fseek(s, static_cast<long>(o), w)
Expand Down

0 comments on commit 3b0be5a

Please sign in to comment.