diff options
author | Bertrand SIMONNET <bsimonnet@google.com> | 2016-03-21 12:11:09 -0700 |
---|---|---|
committer | Bertrand SIMONNET <bsimonnet@google.com> | 2016-03-21 12:31:02 -0700 |
commit | 5e56ca140ffe08d1db1fad94b4916e61b244dfc3 (patch) | |
tree | 5415d6eabc612544bd6f91cc11c3111093ce5989 | |
parent | abc3ca68e5c972e98deef01519278fdced23ddf0 (diff) | |
download | peripheralmanager-5e56ca140ffe08d1db1fad94b4916e61b244dfc3.tar.gz |
Add a test for the C only compatibility.
This will be done with a no-op static library, including all the C
headers and compiling with strict C only compiler flags.
Change-Id: I6fe4aaf0f3014b4325ec5fe052d09afc170ee972
-rw-r--r-- | example/Android.mk | 12 | ||||
-rw-r--r-- | example/headers_are_c89.c | 18 |
2 files changed, 30 insertions, 0 deletions
diff --git a/example/Android.mk b/example/Android.mk index 383b987..1aef4f1 100644 --- a/example/Android.mk +++ b/example/Android.mk @@ -101,3 +101,15 @@ LOCAL_SRC_FILES := \ pio_mcp9808.cc \ include $(BUILD_EXECUTABLE) + +# Check that headers are C89 compatible. +include $(CLEAR_VARS) +LOCAL_MODULE := compatibility_test +LOCAL_CFLAGS := -Wall -Wextra -std=c89 -pedantic -Wmissing-prototypes \ + -Wstrict-prototypes -Wold-style-definition -Wno-comment + +LOCAL_SHARED_LIBRARIES := libperipheralman +LOCAL_STATIC_LIBRARIES := peripheral_manager_hal_headers + +LOCAL_SRC_FILES := headers_are_c89.c +include $(BUILD_STATIC_LIBRARY) diff --git a/example/headers_are_c89.c b/example/headers_are_c89.c new file mode 100644 index 0000000..ff13b4d --- /dev/null +++ b/example/headers_are_c89.c @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2016 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 "hardware/peripheral_io.h" +#include "peripheralmanager/peripheral_manager_client.h" |