Skip to content

Commit e8d8406

Browse files
committed
fstat exists on Apple and FreeBSD (thanks Jason)
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7450 212acab6-be3b-0410-9dea-997c60f758d6
1 parent 7fc79ce commit e8d8406

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Source/util.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ UINT64 get_file_size64(FILE *f)
705705
{
706706
UINT64 result = invalid_file_size64;
707707
// 32bit platforms require _FILE_OFFSET_BITS = 64 to correctly return the size
708-
#if _XOPEN_SOURCE >= 500 || _POSIX_C_SOURCE >= 200112L
708+
#if _XOPEN_SOURCE >= 500 || _POSIX_C_SOURCE >= 200112L || defined(__APPLE__) || defined(__FreeBSD__)
709709
struct stat st;
710710
if (0 == fstat(fileno(f), &st) && st.st_size <= (sizeof(st.st_size) >= 8 ? (off_t)0x7fffffffffffffffLL : LONG_MAX))
711711
result = (UINT64) st.st_size;
@@ -741,7 +741,7 @@ UINT64 Platform_GetMaxFileSize()
741741
{
742742
#ifdef _WIN32
743743
return ~(UINT64)0;
744-
#elif _XOPEN_SOURCE >= 500 || _POSIX_C_SOURCE >= 200112L
744+
#elif _XOPEN_SOURCE >= 500 || _POSIX_C_SOURCE >= 200112L || defined(__APPLE__) || defined(__FreeBSD__)
745745
struct stat st;
746746
if (sizeof(st.st_size) >= 8)
747747
{

0 commit comments

Comments
 (0)