summaryrefslogtreecommitdiff
path: root/libs/nativewindow
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2017-03-30 01:57:31 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-03-30 01:57:32 +0000
commit0e7305cb0ab3787cd4767aa3c57d6842ac351663 (patch)
tree62eb263add743127f65d67a7121e70d2fee44047 /libs/nativewindow
parent61a5669b16fc632847af76b1159a6c051ff82087 (diff)
parent0e95cad418cff706743f98c1ac649d3378ab0b34 (diff)
Merge "vndk/window.h must be C compatible" into oc-dev
Diffstat (limited to 'libs/nativewindow')
-rw-r--r--libs/nativewindow/include/vndk/window.h2
-rw-r--r--libs/nativewindow/tests/Android.bp4
-rw-r--r--libs/nativewindow/tests/c_compatibility.c21
3 files changed, 26 insertions, 1 deletions
diff --git a/libs/nativewindow/include/vndk/window.h b/libs/nativewindow/include/vndk/window.h
index 89585f348a..310e1e52a1 100644
--- a/libs/nativewindow/include/vndk/window.h
+++ b/libs/nativewindow/include/vndk/window.h
@@ -236,6 +236,8 @@ enum ANativeWindowQuery {
ANATIVEWINDOW_QUERY_YDPI = 0x10003,
};
+typedef enum ANativeWindowQuery ANativeWindowQuery;
+
/*
* hook used to retrieve information about the native window.
*
diff --git a/libs/nativewindow/tests/Android.bp b/libs/nativewindow/tests/Android.bp
index 437ab7546c..6d78770e5f 100644
--- a/libs/nativewindow/tests/Android.bp
+++ b/libs/nativewindow/tests/Android.bp
@@ -17,5 +17,7 @@
cc_test {
name: "AHardwareBufferTest",
shared_libs: ["libnativewindow"],
- srcs: ["AHardwareBufferTest.cpp"],
+ srcs: [
+ "AHardwareBufferTest.cpp",
+ "c_compatibility.c"],
}
diff --git a/libs/nativewindow/tests/c_compatibility.c b/libs/nativewindow/tests/c_compatibility.c
new file mode 100644
index 0000000000..a0dfdf9fb1
--- /dev/null
+++ b/libs/nativewindow/tests/c_compatibility.c
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <android/hardware_buffer.h>
+#include <android/native_window.h>
+#include <vndk/window.h>
+
+// this checks that all these headers are C-compatible