| {{/* |
| // Copyright 2019 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| */}} |
| |
| {{- define "Filename:Header" -}} |
| {{- .LibrarySlashes }}/cpp/libfuzzer.h |
| {{- end }} |
| |
| |
| {{- define "File:Header" -}} |
| {{- UseHLCPP -}} |
| // WARNING: This file is machine generated by fidlgen. |
| {{ range $experiment := .Experiments }} |
| // fidl_experiment = {{ $experiment }} |
| {{- end }} |
| |
| #pragma once |
| |
| #include "lib/fidl/cpp/fuzzing/traits.h" |
| #include "lib/fidl/cpp/internal/header.h" |
| |
| {{- /* Import the HLCPP bindings that we are using to fuzz. */}} |
| #include <{{ .LegacyIncludeDir }}/fidl.h> |
| {{ range .Dependencies -}} |
| #include <{{ . | Filename "Header" }}> |
| {{ end -}} |
| |
| // For ::std::max_element(). |
| #include <algorithm> |
| // For uint64_t. |
| #include <stdint.h> |
| |
| namespace fuzzing { |
| |
| {{ range .Decls }} |
| {{- if and (NEq .Kind Kinds.Alias) (NEq .Kind Kinds.Protocol) (NEq .Kind Kinds.Const) }} |
| using {{ .Name }} = {{ . }}; |
| {{- end }} |
| {{- end }} |
| |
| {{ range .Decls }} |
| {{- if Eq .Kind Kinds.Bits }}{{ template "BitsSizeAndAlloc" . }}{{- end }} |
| {{- if Eq .Kind Kinds.Enum }}{{ template "EnumSizeAndAlloc" . }}{{- end }} |
| {{- if Eq .Kind Kinds.Struct }}{{ template "StructSizeAndAlloc" . }}{{- end }} |
| {{- if Eq .Kind Kinds.Table }}{{ template "TableSizeAndAlloc" . }}{{- end }} |
| {{- if Eq .Kind Kinds.Union }}{{ template "UnionSizeAndAlloc" . }}{{- end }} |
| {{- end }} |
| |
| } // namespace fuzzing |
| {{ end }} |