[vlc-commits] commit: motion: Don't use unimotion on iOS. (Pierre d'Herbemont )

git at videolan.org git at videolan.org
Sun Oct 31 11:17:43 CET 2010


vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Sun Oct 31 10:05:21 2010 +0100| [27596ea4849079de26ef01f56fedfc258b507af8] | committer: Pierre d'Herbemont 

motion: Don't use unimotion on iOS.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=27596ea4849079de26ef01f56fedfc258b507af8
---

 modules/control/motion.c    |   13 ++++++++++---
 modules/control/unimotion.c |    7 +++++++
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/modules/control/motion.c b/modules/control/motion.c
index 091f767..4b605af 100644
--- a/modules/control/motion.c
+++ b/modules/control/motion.c
@@ -42,6 +42,13 @@
 #endif
 
 #ifdef __APPLE__
+#include "TargetConditionals.h"
+#if !TARGET_OS_IPHONE
+#define HAVE_MACOS_UNIMOTION
+#endif
+#endif
+
+#ifdef HAVE_MACOS_UNIMOTION
 #include "unimotion.h"
 #endif
 
@@ -52,7 +59,7 @@ struct intf_sys_t
 {
     enum { NO_SENSOR, HDAPS_SENSOR, AMS_SENSOR, APPLESMC_SENSOR,
            UNIMOTION_SENSOR } sensor;
-#ifdef __APPLE__
+#ifdef HAVE_MACOS_UNIMOTION
     enum sms_hardware unimotion_hw;
 #endif
     int i_calibrate;
@@ -144,7 +151,7 @@ int Open ( vlc_object_t *p_this )
             p_intf->p_sys->sensor = NO_SENSOR;
         }
     }
-#ifdef __APPLE__
+#ifdef HAVE_MACOS_UNIMOTION
     else if((p_intf->p_sys->unimotion_hw = detect_sms()))
         p_intf->p_sys->sensor = UNIMOTION_SENSOR;
 #endif
@@ -307,7 +314,7 @@ static int GetOrientation( intf_thread_t *p_intf )
 
         return ( i_x - p_intf->p_sys->i_calibrate ) * 10;
 
-#ifdef __APPLE__
+#ifdef HAVE_MACOS_UNIMOTION
     case UNIMOTION_SENSOR:
         if( read_sms_raw( p_intf->p_sys->unimotion_hw, &i_x, &i_y, &i_z ) )
         {
diff --git a/modules/control/unimotion.c b/modules/control/unimotion.c
index 39b6c1b..4b07a3c 100644
--- a/modules/control/unimotion.c
+++ b/modules/control/unimotion.c
@@ -69,6 +69,13 @@
  */
 
 #ifdef __APPLE__
+#include "TargetConditionals.h"
+#if !TARGET_OS_IPHONE
+#define HAVE_MACOS_UNIMOTION
+#endif
+#endif
+
+#ifdef HAVE_MACOS_UNIMOTION
 
 #include "unimotion.h"
 #include <IOKit/IOKitLib.h>



More information about the vlc-commits mailing list