Skip to content

Commit e2f0ddc

Browse files
committed
CI ARM: set CFLAGS for 32-bit off_t
The flags queried also for 64-bit ARM but it is empty there. This does basically the same as the commit f46a101, that adds _FILE_OFFSET_BITS=64 define to config.h. But the config.h may not be always included now. + compat/misc: typo in comment + assert 64b off_t (off_t should be actually 64b in _OFF64 env and >= 64b in _OFFBIG so assert at least 64)
1 parent 3aa6c39 commit e2f0ddc

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.github/scripts/Linux/arm/build.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH:+":$PKG_CONFIG
1010
ARCH=$(dpkg --print-architecture)
1111
APPNAME=UltraGrid-latest-${ARCH}.AppImage
1212

13+
# set 64-bit off_t for 32-bit ARM, see the following (POSIX 2024 will use V8):
14+
# <https://pubs.opengroup.org/onlinepubs/9699919799/utilities/c99.html>
15+
# TODO: this is duplicite of AC_SYS_LARGEFILE - figure out how to keep
16+
# that without needing to include the config.h in headers
17+
CENV=$(getconf POSIX_V7_WIDTH_RESTRICTED_ENVS | grep -E 'OFFBIG|OFF64' |
18+
head -n 1)
19+
CFLAGS=${CFLAGS:+$CFLAGS }$(getconf "${CENV}_CFLAGS")
20+
CXXFLAGS=${CXXFLAGS:+$CXXFLAGS }$(getconf "${CENV}_CFLAGS")
21+
export CFLAGS CXXFLAGS
22+
1323
# shellcheck disable=SC2086 # intentional
1424
set -- $FEATURES
1525
set -- "$@" --enable-drm_disp

src/compat/misc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
#define fseeko _fseeki64
5858
#else
5959
#ifndef __cplusplus
60-
#include <assert.h> // static_assert macro (until c32)
60+
#include <assert.h> // static_assert macro (until C23)
6161
#endif
62-
static_assert(sizeof(off_t) > 4, "32b off_t");
62+
static_assert(sizeof(off_t) >= 8, "off_t less than 64b");
6363
#endif // !defined _WIN32
6464
#endif // defined WANT_FSEEKO
6565

0 commit comments

Comments
 (0)