Skip to content

Commit

Permalink
CheckedFile: Fix CPP redefinition warnings. Fixes asmaloney#291.
Browse files Browse the repository at this point in the history
The warning I got was "_LARGEFILE64_SOURCE" redefined".

Most likely, the same issue can exist for "__LARGE64_FILES";
applying the same fix it for that one as well even though I can't test
it.
  • Loading branch information
nh2 committed Jun 23, 2024
1 parent 9a2a327 commit 71dde7b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/CheckedFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,25 @@
#include <codecvt>
#include <io.h>
#elif defined( __GNUC__ )
#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
#endif
#ifndef __LARGE64_FILES
#define __LARGE64_FILES
#endif
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#else
#error "no supported compiler defined"
#endif
#elif defined( __linux__ ) || defined( __EMSCRIPTEN__ )
#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
#endif
#ifndef __LARGE64_FILES
#define __LARGE64_FILES
#endif
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
Expand Down

0 comments on commit 71dde7b

Please sign in to comment.