Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: mojom/generators/c/templates/source.tmpl.go

Issue 2232833003: Change the canonical way to include the C bindings headers to <mojo/bindings/*.h>. (Closed) Base URL: https://github.com/domokit/mojo.git@work791_mojo_tests
Patch Set: rebased Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojom/generators/c/templates/header.tmpl.go ('k') | sdk_build/data/cpp/Makefile » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package templates 5 package templates
6 6
7 const GenerateSourceFile = ` 7 const GenerateSourceFile = `
8 {{- define "GenerateSourceFile" -}} 8 {{- define "GenerateSourceFile" -}}
9 // This file was auto-generated by the C bindings generator. 9 // This file was auto-generated by the C bindings generator.
10 10
11 #include "{{.HeaderFile}}" 11 #include "{{.HeaderFile}}"
12 12
13 #include <mojo/bindings/internal/type_descriptor.h>
13 #include <mojo/system/handle.h> 14 #include <mojo/system/handle.h>
14 #include <stdbool.h> 15 #include <stdbool.h>
15 16
16 #include "mojo/public/c/bindings/lib/type_descriptor.h"
17
18 // Imports. 17 // Imports.
19 {{range $import := .Imports -}} 18 {{range $import := .Imports -}}
20 #include "{{$import}}" 19 #include "{{$import}}"
21 {{end}} 20 {{end}}
22 21
23 // Type tables definitions for structs, arrays and unions. 22 // Type tables definitions for structs, arrays and unions.
24 {{template "GenerateTypeTableDefinitions" .TypeTable}} 23 {{template "GenerateTypeTableDefinitions" .TypeTable}}
25 24
26 // Definitions for constants. 25 // Definitions for constants.
27 // Top level constants: 26 // Top level constants:
28 {{range $const := .Constants -}} 27 {{range $const := .Constants -}}
29 const {{$const.Type}} {{$const.Name}} = {{$const.Value}}; 28 const {{$const.Type}} {{$const.Name}} = {{$const.Value}};
30 {{end -}} 29 {{end -}}
31 30
32 // Struct definitions. 31 // Struct definitions.
33 {{range $struct := .Structs -}} 32 {{range $struct := .Structs -}}
34 {{template "GenerateStructDefinitions" $struct}} 33 {{template "GenerateStructDefinitions" $struct}}
35 {{end -}} 34 {{end -}}
36 35
37 // Interface definitions. 36 // Interface definitions.
38 {{range $interface := .Interfaces -}} 37 {{range $interface := .Interfaces -}}
39 {{template "GenerateInterfaceDefinitions" $interface}} 38 {{template "GenerateInterfaceDefinitions" $interface}}
40 {{end -}} 39 {{end -}}
41 40
42 {{end}} 41 {{end}}
43 ` 42 `
OLDNEW
« no previous file with comments | « mojom/generators/c/templates/header.tmpl.go ('k') | sdk_build/data/cpp/Makefile » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698