File tree Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -259,8 +259,12 @@ impl WorldGenerator for C {
259
259
" ,
260
260
) ;
261
261
}
262
-
262
+ let version = env ! ( "CARGO_PKG_VERSION" ) ;
263
263
let mut h_str = wit_bindgen_core:: Source :: default ( ) ;
264
+ uwriteln ! (
265
+ h_str,
266
+ "// Generated by `wit-bindgen` {version}. DO NOT EDIT!"
267
+ ) ;
264
268
265
269
uwrite ! (
266
270
h_str,
@@ -283,6 +287,10 @@ impl WorldGenerator for C {
283
287
}
284
288
285
289
let mut c_str = wit_bindgen_core:: Source :: default ( ) ;
290
+ uwriteln ! (
291
+ c_str,
292
+ "// Generated by `wit-bindgen` {version}. DO NOT EDIT!"
293
+ ) ;
286
294
uwriteln ! ( c_str, "#include \" {snake}.h\" " ) ;
287
295
if c_str. len ( ) > 0 {
288
296
c_str. push_str ( "\n " ) ;
Original file line number Diff line number Diff line change @@ -113,6 +113,11 @@ impl RustWasm {
113
113
114
114
impl WorldGenerator for RustWasm {
115
115
fn preprocess ( & mut self , resolve : & Resolve , _world : WorldId ) {
116
+ let version = env ! ( "CARGO_PKG_VERSION" ) ;
117
+ uwriteln ! (
118
+ self . src,
119
+ "// Generated by `wit-bindgen` {version}. DO NOT EDIT!"
120
+ ) ;
116
121
self . types . analyze ( resolve) ;
117
122
}
118
123
Original file line number Diff line number Diff line change @@ -179,7 +179,9 @@ impl WorldGenerator for TeaVmJava {
179
179
let package = format ! ( "wit_{}" , world. name. to_snake_case( ) ) ;
180
180
let name = world. name . to_upper_camel_case ( ) ;
181
181
182
+ let version = env ! ( "CARGO_PKG_VERSION" ) ;
182
183
let mut src = String :: new ( ) ;
184
+ uwriteln ! ( src, "// Generated by `wit-bindgen` {version}. DO NOT EDIT!" ) ;
183
185
184
186
uwrite ! (
185
187
src,
@@ -361,7 +363,8 @@ impl WorldGenerator for TeaVmJava {
361
363
. join ( "\n " ) ;
362
364
363
365
let body = format ! (
364
- "package {package};
366
+ "// Generated by `wit-bindgen` {version}. DO NOT EDIT!
367
+ package {package};
365
368
366
369
{IMPORTS}
367
370
@@ -386,7 +389,8 @@ impl WorldGenerator for TeaVmJava {
386
389
. join ( "\n " ) ;
387
390
388
391
let body = format ! (
389
- "package {package};
392
+ "// Generated by `wit-bindgen` {version}. DO NOT EDIT!
393
+ package {package};
390
394
391
395
{IMPORTS}
392
396
You can’t perform that action at this time.
0 commit comments