From 3b39a0af74eeb3ea26f8da6dc1b1423a3278df1e Mon Sep 17 00:00:00 2001 From: Jiaxun Yang Date: Sat, 7 Mar 2020 09:56:01 +0800 Subject: [PATCH] linux-v4l2: Use LP64 macro to determine pointer size As currently all 64bit Linux platforms are respecting LP64 data model and most 32bit platforms are respecting ILP32, we don't have to discuss pointer size case by case. LP64 is effective enough to tell pointer size. This fixes build for armhf and powerpc. Signed-off-by: Jiaxun Yang --- plugins/linux-v4l2/v4l2-controls.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/linux-v4l2/v4l2-controls.c b/plugins/linux-v4l2/v4l2-controls.c index 1f6f84cbd..b11ba811f 100644 --- a/plugins/linux-v4l2/v4l2-controls.c +++ b/plugins/linux-v4l2/v4l2-controls.c @@ -24,14 +24,12 @@ along with this program. If not, see . #define blog(level, msg, ...) blog(level, "v4l2-controls: " msg, ##__VA_ARGS__) -#if defined(__i386__) -#define UINT_TO_POINTER(val) ((void *)(unsigned int)(val)) -#define POINTER_TO_UINT(p) ((unsigned int)(unsigned int)(p)) -#elif defined(__x86_64__) || defined(__aarch64__) || (_MIPS_SIM == _ABI64) +#if defined(__LP64__) #define UINT_TO_POINTER(val) ((void *)(unsigned long)(val)) #define POINTER_TO_UINT(p) ((unsigned int)(unsigned long)(p)) #else -#error "unknown platform, this code won't work" +#define UINT_TO_POINTER(val) ((void *)(unsigned int)(val)) +#define POINTER_TO_UINT(p) ((unsigned int)(unsigned int)(p)) #endif static bool v4l2_control_changed(void *data, obs_properties_t *props,