blob: 07d870ff7f6544a68a02369329961f9729f2b36d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
Description: Fix `stdatomic.h` in g++
`stdatomic.h` cannot be consumed by g++ because they refuse to implement
keywords like `_Atomic`, while Clang does.
Author: Kai-Chung Yan
Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60932
--- a/adb/adb_trace.h
+++ b/adb/adb_trace.h
@@ -62,7 +62,10 @@
#include <atomic>
#define ATRACE_TAG ATRACE_TAG_ADB
+extern "C" {
+using namespace std;
#include <cutils/trace.h>
+}
#include <utils/Trace.h>
#endif /* __ADB_TRACE_H */
--- a/libcutils/include/cutils/trace.h
+++ b/libcutils/include/cutils/trace.h
@@ -18,7 +18,9 @@
#define _LIBS_CUTILS_TRACE_H
#include <inttypes.h>
+#ifndef __cplusplus
#include <stdatomic.h>
+#endif
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
--- a/libcutils/include/cutils/atomic.h
+++ b/libcutils/include/cutils/atomic.h
@@ -19,7 +19,9 @@
#include <stdint.h>
#include <sys/types.h>
+#ifndef __cplusplus
#include <stdatomic.h>
+#endif
#ifndef ANDROID_ATOMIC_INLINE
#define ANDROID_ATOMIC_INLINE static inline
--- a/libutils/include/utils/Atomic.h
+++ b/libutils/include/utils/Atomic.h
@@ -17,6 +17,9 @@
#ifndef ANDROID_UTILS_ATOMIC_H
#define ANDROID_UTILS_ATOMIC_H
+extern "C" {
+using namespace std;
#include <cutils/atomic.h>
+}
#endif // ANDROID_UTILS_ATOMIC_H
|