From 08c50dd4ebb4731ced7020a803b78bff04e14e3a Mon Sep 17 00:00:00 2001 From: GetAway Date: Thu, 7 Nov 2024 21:20:52 +0100 Subject: [PATCH] Fix: fix warning: type struct CFile violates the C++ one definition rule Set _FILE_OFFSET_BITS=64 in Makefiles for consistent 64-bit off_t definition This removes -Wodr warnings when compiling CFile and several other classes, ensuring off_t is consistently defined as a 64-bit type across all translation units. Observed while compiling with GCC 13. Signed-off-by: Thilo Graf --- src/driver/Makefile.am | 3 ++- src/gui/Makefile.am | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/driver/Makefile.am b/src/driver/Makefile.am index 72a1c19bf..9675eb14a 100644 --- a/src/driver/Makefile.am +++ b/src/driver/Makefile.am @@ -1,4 +1,5 @@ AM_CXXFLAGS = -fno-rtti -fno-exceptions -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS +AM_CPPFLAGS = -D_FILE_OFFSET_BITS=64 SUBDIRS = pictureviewer audiodec @@ -6,7 +7,7 @@ if ENABLE_GRAPHLCD SUBDIRS += glcd endif -AM_CPPFLAGS = \ +AM_CPPFLAGS += \ -I$(top_builddir) \ -I$(top_srcdir) \ -I$(top_srcdir)/src \ diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index a4cafa832..85ca71fa7 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -fno-rtti -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS +AM_CPPFLAGS = -fno-rtti -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 BUILT_SOURCES = version.h version.h: @rm -f $@; \