## -*- coding: utf-8 -*- /* * Copyright (C) ${copyright_year()} 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. */ /** * ! Do not edit this file directly ! * * Generated automatically from ndk_camera_metadata_asserts.mako */ #include #include #include <% def annotated_enum_type(entry): if entry.type == 'int64' and entry.container == 'array': type = 'int64_t' else: type = 'int32_t' return type %> % for sec in find_all_sections_filtered(metadata, ('extension')): static_assert(static_cast(${path_name(sec) | csym}) == static_cast(${ndk(path_name(sec)) | csym})); % endfor % for sec in find_all_sections_filtered(metadata, ('extension')): static_assert(static_cast(${path_name(sec) + '.start' | csym}) == static_cast(${csym(ndk(path_name(sec)) + '.start')})); % endfor % for sec in find_all_sections_filtered(metadata, ('extension')): % for idx,entry in enumerate(remove_hal_non_visible(find_unique_entries(sec))): % if entry.applied_ndk_visible != "true": <% continue %> % endif static_assert(static_cast(${csym(entry.name)}) == static_cast(${csym(ndk(entry.name))})); % endfor % endfor % for sec in find_all_sections_filtered(metadata, ('extension')): % for entry in remove_hal_non_visible(find_unique_entries(sec)): % if entry.enum: % if entry.applied_ndk_visible != "true": <% continue %> % endif % for val in aidl_enum_values(entry): % if val.ndk_hidden: <% continue %> % endif static_assert(static_cast<${annotated_enum_type(entry)}>(${csym(entry.name)}_${val.name}) == static_cast<${annotated_enum_type(entry)}>(${csym(ndk(entry.name))}_${val.name})); % endfor % endif % endfor % endfor