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 <jiaxun.yang@flygoat.com>
master
Jiaxun Yang 2020-03-07 09:56:01 +08:00
parent 452a4b5085
commit 3b39a0af74
1 changed files with 3 additions and 5 deletions

View File

@ -24,14 +24,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define blog(level, msg, ...) blog(level, "v4l2-controls: " msg, ##__VA_ARGS__) #define blog(level, msg, ...) blog(level, "v4l2-controls: " msg, ##__VA_ARGS__)
#if defined(__i386__) #if defined(__LP64__)
#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)
#define UINT_TO_POINTER(val) ((void *)(unsigned long)(val)) #define UINT_TO_POINTER(val) ((void *)(unsigned long)(val))
#define POINTER_TO_UINT(p) ((unsigned int)(unsigned long)(p)) #define POINTER_TO_UINT(p) ((unsigned int)(unsigned long)(p))
#else #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 #endif
static bool v4l2_control_changed(void *data, obs_properties_t *props, static bool v4l2_control_changed(void *data, obs_properties_t *props,