OLD | NEW |
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 // TODO(vardhan): Include only the necessary headers for a particular | 7 // TODO(vardhan): Include only the necessary headers for a particular |
8 // mojom. | 8 // mojom. |
9 const GenerateHeaderFile = ` | 9 const GenerateHeaderFile = ` |
10 {{- define "GenerateHeaderFile" -}} | 10 {{- define "GenerateHeaderFile" -}} |
11 // This file was auto-generated by the C bindings generator. | 11 // This file was auto-generated by the C bindings generator. |
12 | 12 |
13 #ifndef {{.HeaderGuard}} | 13 #ifndef {{.HeaderGuard}} |
14 #define {{.HeaderGuard}} | 14 #define {{.HeaderGuard}} |
15 | 15 |
16 #include <assert.h> | 16 #include <assert.h> |
17 #include <math.h> | 17 #include <math.h> |
| 18 #include <mojo/macros.h> |
18 #include <stdbool.h> | 19 #include <stdbool.h> |
19 #include <stdint.h> | 20 #include <stdint.h> |
20 | 21 |
21 #include "mojo/public/c/bindings/array.h" | 22 #include "mojo/public/c/bindings/array.h" |
22 #include "mojo/public/c/bindings/buffer.h" | 23 #include "mojo/public/c/bindings/buffer.h" |
23 #include "mojo/public/c/bindings/interface.h" | 24 #include "mojo/public/c/bindings/interface.h" |
24 #include "mojo/public/c/bindings/lib/type_descriptor.h" | 25 #include "mojo/public/c/bindings/lib/type_descriptor.h" |
25 #include "mojo/public/c/bindings/map.h" | 26 #include "mojo/public/c/bindings/map.h" |
26 #include "mojo/public/c/bindings/string.h" | 27 #include "mojo/public/c/bindings/string.h" |
27 #include "mojo/public/c/bindings/validation.h" | 28 #include "mojo/public/c/bindings/validation.h" |
28 #include "mojo/public/c/system/handle.h" | 29 #include "mojo/public/c/system/handle.h" |
29 #include "mojo/public/c/system/macros.h" | |
30 | 30 |
31 // Imports. | 31 // Imports. |
32 {{range $import := .Imports -}} | 32 {{range $import := .Imports -}} |
33 #include "{{$import}}" | 33 #include "{{$import}}" |
34 {{end}} | 34 {{end}} |
35 | 35 |
36 MOJO_BEGIN_EXTERN_C | 36 MOJO_BEGIN_EXTERN_C |
37 | 37 |
38 // Forward declarations for structs. | 38 // Forward declarations for structs. |
39 {{range $struct := .Structs -}} | 39 {{range $struct := .Structs -}} |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 {{end}} | 85 {{end}} |
86 | 86 |
87 // Type tables declarations for structs and unions. | 87 // Type tables declarations for structs and unions. |
88 {{template "GenerateTypeTableDeclarations" .TypeTable}} | 88 {{template "GenerateTypeTableDeclarations" .TypeTable}} |
89 | 89 |
90 MOJO_END_EXTERN_C | 90 MOJO_END_EXTERN_C |
91 | 91 |
92 #endif // {{.HeaderGuard}} | 92 #endif // {{.HeaderGuard}} |
93 {{- end }} | 93 {{- end }} |
94 ` | 94 ` |
OLD | NEW |