Add sys/cdefs and __REMOVED_IN define to looper.h
The looper.h header introduced __REMOVED_IN, which requires the
sys/cdefs.h header to provide definitions for the macro. Add them here
and update files that include looper.h to not provide their own
definitions of __REMOVED_IN. Further, update comments to clarify that
the additional defines are in place to satisfy builds that use glibc or
Windows/MacOS libcs.
Bug: 14257980
Change-Id: Ia524b7e180c5137e84c205a77dc219b9e9e41608
diff --git a/include/android/sensor.h b/include/android/sensor.h
index a729dbc..a618393 100644
--- a/include/android/sensor.h
+++ b/include/android/sensor.h
@@ -29,6 +29,8 @@
#ifndef ANDROID_SENSOR_H
#define ANDROID_SENSOR_H
+#include <sys/cdefs.h>
+
/******************************************************************
*
* IMPORTANT NOTICE:
@@ -45,11 +47,6 @@
* - DO NOT CHANGE THE LAYOUT OR SIZE OF STRUCTURES
*/
-// This file is included by modules that have host support but android/looper.h is not supported
-// on host. __REMOVED_IN needs to be defined in order for android/looper.h to be compiled.
-#ifndef __BIONIC__
-#define __REMOVED_IN(x) __attribute__((deprecated))
-#endif
#include <android/looper.h>
#include <stdbool.h>
@@ -57,6 +54,8 @@
#include <math.h>
#include <stdint.h>
+// This file may also be built on glibc or on Windows/MacOS libc's, so no-op
+// and deprecated definitions are provided.
#if !defined(__INTRODUCED_IN)
#define __INTRODUCED_IN(__api_level) /* nothing */
#endif