diff options
author | 2017-03-29 16:06:48 -0700 | |
---|---|---|
committer | 2017-03-29 16:06:48 -0700 | |
commit | 0e95cad418cff706743f98c1ac649d3378ab0b34 (patch) | |
tree | e52b87a0b5e4fec3b4ff7d54fe3b8ee5b5babf6a | |
parent | ad0a84fd2a6e416760909fc7a0658e08ef897e62 (diff) |
vndk/window.h must be C compatible
Test: added a c compatibility test
Bug: 36725813
Change-Id: Ic7e1c8b50e1818707a9a457d84ed74e7e6c816c8
-rw-r--r-- | libs/nativewindow/include/vndk/window.h | 2 | ||||
-rw-r--r-- | libs/nativewindow/tests/Android.bp | 4 | ||||
-rw-r--r-- | libs/nativewindow/tests/c_compatibility.c | 21 |
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 |