vndk/window.h must be C compatible
Test: added a c compatibility test
Bug: 36725813
Change-Id: Ic7e1c8b50e1818707a9a457d84ed74e7e6c816c8
diff --git a/libs/nativewindow/tests/Android.bp b/libs/nativewindow/tests/Android.bp
index 437ab75..6d78770 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 0000000..a0dfdf9
--- /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