summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/unix/Makefile4
-rw-r--r--ports/windows/Makefile4
2 files changed, 8 insertions, 0 deletions
diff --git a/ports/unix/Makefile b/ports/unix/Makefile
index f02e6c635..88fa1af04 100644
--- a/ports/unix/Makefile
+++ b/ports/unix/Makefile
@@ -48,6 +48,10 @@ CWARN = -Wall -Werror
CWARN += -Wextra -Wno-unused-parameter -Wpointer-arith -Wdouble-promotion -Wfloat-conversion
CFLAGS += $(INC) $(CWARN) -std=gnu99 -DUNIX $(COPT) -I$(VARIANT_DIR) $(CFLAGS_EXTRA)
+# Force the use of 64-bits for file sizes in C library functions on 32-bit platforms.
+# This option has no effect on 64-bit builds.
+CFLAGS += -D_FILE_OFFSET_BITS=64
+
# Debugging/Optimization
ifdef DEBUG
COPT ?= -Og
diff --git a/ports/windows/Makefile b/ports/windows/Makefile
index cf0a92701..115d1a61e 100644
--- a/ports/windows/Makefile
+++ b/ports/windows/Makefile
@@ -42,6 +42,10 @@ INC += -I$(VARIANT_DIR)
CFLAGS += $(INC) -Wall -Wpointer-arith -Wdouble-promotion -Werror -std=gnu99 -DUNIX -D__USE_MINGW_ANSI_STDIO=1 $(COPT) $(CFLAGS_EXTRA)
LDFLAGS += -lm -lbcrypt $(LDFLAGS_EXTRA)
+# Force the use of 64-bits for file sizes in C library functions on 32-bit platforms.
+# This option has no effect on 64-bit builds.
+CFLAGS += -D_FILE_OFFSET_BITS=64
+
# Debugging/Optimization
ifdef DEBUG
CFLAGS += -g