diff mbox series

[1/4] v4l-utils: fix formats under alpha/ppc64/mips64

Message ID 20240702193343.5742-1-rosenp@gmail.com (mailing list archive)
State New
Headers show
Series [1/4] v4l-utils: fix formats under alpha/ppc64/mips64 | expand

Commit Message

Rosen Penev July 2, 2024, 7:33 p.m. UTC
Unlike libc, kernel headers use long long for 64-bit types.
__SANE_USERSPACE_TYPES__ needs to be defined for the exceptions.

Fixes -Wformat warnings about llu being used instead of lu.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 meson.build | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/meson.build b/meson.build
index 900377fa..15b16971 100644
--- a/meson.build
+++ b/meson.build
@@ -69,6 +69,12 @@  elif host_machine.system() == 'freebsd'
     v4l2_utils_incdir_arr += 'contrib/freebsd/include'
 endif
 
+# These platforms default to __[us]64 as long. Add this define to get long long
+# as is done elsewhere.
+if host_machine.cpu_family() in ['alpha', 'mips64', 'ppc64']
+  add_project_arguments('-D__SANE_USERSPACE_TYPES__', language: ['c', 'cpp'])
+endif
+
 v4l2_utils_incdir = include_directories(v4l2_utils_incdir_arr)
 
 prog_bash = find_program('bash')