blob: 646dd66f7b247e69b44b808860e0ad0d36ea6282 [file] [log] [blame]
## -*- coding: utf-8 -*-
/*
* Copyright 2022 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/**
* ! Do not edit this file directly !
*
* Generated automatically from camera_metadata_tags_verifier.mako
*/
<%!
def static_assert_eq(definition):
namespace, identifier = definition.split('::')
return ('static_assert(static_cast<ssize_t>(%s) == static_cast<ssize_t>(%s),\n'
' "%s != %s");') % (definition, identifier, definition, identifier)
%>
#include <system/camera_metadata_tags.h>
#include "camera/mojo/camera_metadata_tags.mojom.h"
namespace cros {
namespace mojom {
/**
* Verify all the definitions in CameraMetadataSection match their corresponding enum
* definitions in camera_metadata_tags.h.
*/
% for section in find_all_sections(metadata):
${static_assert_eq('CameraMetadataSection::%s' % csym(path_name(section)))}
% endfor
${static_assert_eq('CameraMetadataSection::VENDOR_SECTION')}
/**
* Verify all the definitions in CameraMetadataSectionStart match their corresponding enum
* definitions in camera_metadata_tags.h
*/
% for section in find_all_sections(metadata):
${static_assert_eq('CameraMetadataSectionStart::%s' % (csym(path_name(section) + '.start')))}
% endfor
## VENDOR_SECTION_START (0x80000000) is removed because it causes -Wc++11-narrowing warnings.
##${static_assert_eq('CameraMetadataSectionStart::VENDOR_SECTION_START')}
/**
* Verify all the definitions in CameraMetadataTag match their corresponding enum
* definitions in camera_metadata_tags.h
*/
% for section in find_all_sections(metadata):
% for entry in remove_synthetic(find_unique_entries(section)):
${static_assert_eq('CameraMetadataTag::%s' % (csym(entry.name)))}
% endfor
% endfor
/**
* Verify all the definitions in CameraMetadataEnum_* match their corresponding enum
* definitions in camera_metadata_tags.h
*/
% for section in find_all_sections(metadata):
% for entry in remove_synthetic(find_unique_entries(section)):
% if entry.enum:
% for val in entry.enum.values:
${static_assert_eq('%s::%s_%s' % (pascal_case(entry.name), csym(entry.name), val.name))}
% endfor
% endif
% endfor
%endfor
} // namespace mojom
} // namespace cros