Skip to content

Commit 2e35452

Browse files
aymanm-googleGerrit Code Review
authored andcommitted
Merge "[Cherry-pick] Add sys/cdefs and __REMOVED_IN define to looper.h" into main
2 parents 7f358de + 1aa9f86 commit 2e35452

3 files changed

Lines changed: 14 additions & 11 deletions

File tree

include/android/input.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,12 @@
5454
#include <stdint.h>
5555
#include <sys/types.h>
5656
#include <android/keycodes.h>
57-
58-
// This file is included by modules that have host support but android/looper.h is not supported
59-
// on host. __REMOVED_IN needs to be defined in order for android/looper.h to be compiled.
60-
#ifndef __BIONIC__
61-
#define __REMOVED_IN(x) __attribute__((deprecated))
62-
#endif
6357
#include <android/looper.h>
6458

6559
#include <jni.h>
6660

61+
// This file may also be built on glibc or on Windows/MacOS libc's, so no-op
62+
// definitions are provided.
6763
#if !defined(__INTRODUCED_IN)
6864
#define __INTRODUCED_IN(__api_level) /* nothing */
6965
#endif

include/android/looper.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,18 @@
2626
#ifndef ANDROID_LOOPER_H
2727
#define ANDROID_LOOPER_H
2828

29+
#include <sys/cdefs.h>
30+
2931
#ifdef __cplusplus
3032
extern "C" {
3133
#endif
3234

35+
// This file may also be built on glibc or on Windows/MacOS libc's, so
36+
// deprecated definitions are provided.
37+
#if !defined(__REMOVED_IN)
38+
#define __REMOVED_IN(__api_level) __attribute__((__deprecated__))
39+
#endif
40+
3341
struct ALooper;
3442
/**
3543
* ALooper

include/android/sensor.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#ifndef ANDROID_SENSOR_H
3030
#define ANDROID_SENSOR_H
3131

32+
#include <sys/cdefs.h>
33+
3234
/******************************************************************
3335
*
3436
* IMPORTANT NOTICE:
@@ -45,18 +47,15 @@
4547
* - DO NOT CHANGE THE LAYOUT OR SIZE OF STRUCTURES
4648
*/
4749

48-
// This file is included by modules that have host support but android/looper.h is not supported
49-
// on host. __REMOVED_IN needs to be defined in order for android/looper.h to be compiled.
50-
#ifndef __BIONIC__
51-
#define __REMOVED_IN(x) __attribute__((deprecated))
52-
#endif
5350
#include <android/looper.h>
5451

5552
#include <stdbool.h>
5653
#include <sys/types.h>
5754
#include <math.h>
5855
#include <stdint.h>
5956

57+
// This file may also be built on glibc or on Windows/MacOS libc's, so no-op
58+
// and deprecated definitions are provided.
6059
#if !defined(__INTRODUCED_IN)
6160
#define __INTRODUCED_IN(__api_level) /* nothing */
6261
#endif

0 commit comments

Comments
 (0)