From 0e95cad418cff706743f98c1ac649d3378ab0b34 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Wed, 29 Mar 2017 16:06:48 -0700 Subject: vndk/window.h must be C compatible Test: added a c compatibility test Bug: 36725813 Change-Id: Ic7e1c8b50e1818707a9a457d84ed74e7e6c816c8 --- libs/nativewindow/include/vndk/window.h | 2 ++ libs/nativewindow/tests/Android.bp | 4 +++- libs/nativewindow/tests/c_compatibility.c | 21 +++++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 libs/nativewindow/tests/c_compatibility.c (limited to 'libs/nativewindow') 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 +#include +#include + +// this checks that all these headers are C-compatible -- cgit v1.2.3-59-g8ed1b