Browse Source

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 <[email protected]>
Jiaxun Yang 5 năm trước cách đây
mục cha
commit
3b39a0af74
1 tập tin đã thay đổi với 3 bổ sung5 xóa
  1. 3 5
      plugins/linux-v4l2/v4l2-controls.c

+ 3 - 5
plugins/linux-v4l2/v4l2-controls.c

@@ -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__)
 
-#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,