From 2d0ed575711589484a6755f3bcdd5f9005ad5bcc Mon Sep 17 00:00:00 2001 From: Simo Piiroinen Date: Mon, 1 Oct 2018 14:40:11 +0300 Subject: [PATCH] [hybrisadaptor] Deal with sensor type aliasing changes. JB#43020 It seems that in later android header versions sensor type values have been changed from #define constants into enumeration values. And while previously SENSOR_TYPE_MAGNETIC_FIELD was alias for SENSOR_TYPE_GEOMAGNETIC_FIELD, now it is the other way around. Which then has the net effect of: Attempt to provide fallback value for SENSOR_TYPE_MAGNETIC_FIELD with symbolic name results in compilation failures. Use hard-coded fallback values for both SENSOR_TYPE_GEOMAGNETIC_FIELD and SENSOR_TYPE_MAGNETIC_FIELD to break dependency on what types android header considers to be aliases vs not. Signed-off-by: Simo Piiroinen --- core/hybrisadaptor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/hybrisadaptor.cpp b/core/hybrisadaptor.cpp index c8b54bcf..ec818b06 100644 --- a/core/hybrisadaptor.cpp +++ b/core/hybrisadaptor.cpp @@ -47,10 +47,10 @@ #define SENSOR_TYPE_ACCELEROMETER (1) #endif #ifndef SENSOR_TYPE_GEOMAGNETIC_FIELD -#define SENSOR_TYPE_GEOMAGNETIC_FIELD (2) +#define SENSOR_TYPE_GEOMAGNETIC_FIELD (2) // alias for SENSOR_TYPE_MAGNETIC_FIELD #endif #ifndef SENSOR_TYPE_MAGNETIC_FIELD -#define SENSOR_TYPE_MAGNETIC_FIELD SENSOR_TYPE_GEOMAGNETIC_FIELD +#define SENSOR_TYPE_MAGNETIC_FIELD (2) // alias for SENSOR_TYPE_GEOMAGNETIC_FIELD #endif #ifndef SENSOR_TYPE_ORIENTATION #define SENSOR_TYPE_ORIENTATION (3)