@@ -124,10 +124,10 @@ fn write_include_cxxbridge(out: &mut OutFile, types: &Types) {
124124 }
125125 }
126126
127- out. begin_block ( "namespace cxxbridge00 " ) ;
127+ out. begin_block ( "namespace cxxbridge01 " ) ;
128128 if needs_rust_box {
129129 writeln ! ( out, "// #include \" cxxbridge.h\" " ) ;
130- for line in include:: get ( "CXXBRIDGE00_RUST_BOX " ) . lines ( ) {
130+ for line in include:: get ( "CXXBRIDGE01_RUST_BOX " ) . lines ( ) {
131131 if !line. trim_start ( ) . starts_with ( "//" ) {
132132 writeln ! ( out, "{}" , line) ;
133133 }
@@ -146,7 +146,7 @@ fn write_namespace_alias(out: &mut OutFile, types: &Types) {
146146 }
147147
148148 if needs_namespace_alias {
149- writeln ! ( out, "namespace cxxbridge = cxxbridge00 ;" ) ;
149+ writeln ! ( out, "namespace cxxbridge = cxxbridge01 ;" ) ;
150150 }
151151}
152152
@@ -176,7 +176,7 @@ fn write_cxx_function_shim(out: &mut OutFile, efn: &ExternFn, types: &Types) {
176176 for name in out. namespace . clone ( ) {
177177 write ! ( out, "{}$" , name) ;
178178 }
179- write ! ( out, "cxxbridge00 ${}(" , efn. ident) ;
179+ write ! ( out, "cxxbridge01 ${}(" , efn. ident) ;
180180 for ( i, arg) in efn. args . iter ( ) . enumerate ( ) {
181181 if i > 0 {
182182 write ! ( out, ", " ) ;
@@ -244,7 +244,7 @@ fn write_rust_function_decl(out: &mut OutFile, efn: &ExternFn, types: &Types) {
244244 for name in out. namespace . clone ( ) {
245245 write ! ( out, "{}$" , name) ;
246246 }
247- write ! ( out, "cxxbridge00 ${}(" , efn. ident) ;
247+ write ! ( out, "cxxbridge01 ${}(" , efn. ident) ;
248248 for ( i, arg) in efn. args . iter ( ) . enumerate ( ) {
249249 if i > 0 {
250250 write ! ( out, ", " ) ;
@@ -299,7 +299,7 @@ fn write_rust_function_shim(out: &mut OutFile, efn: &ExternFn, types: &Types) {
299299 for name in out. namespace . clone ( ) {
300300 write ! ( out, "{}$" , name) ;
301301 }
302- write ! ( out, "cxxbridge00 ${}(" , efn. ident) ;
302+ write ! ( out, "cxxbridge01 ${}(" , efn. ident) ;
303303 for ( i, arg) in efn. args . iter ( ) . enumerate ( ) {
304304 if i > 0 {
305305 write ! ( out, ", " ) ;
@@ -435,7 +435,7 @@ fn write_generic_instantiations(out: &mut OutFile, types: &Types) {
435435 }
436436 out. end_block ( ) ;
437437
438- out. begin_block ( "namespace cxxbridge00 " ) ;
438+ out. begin_block ( "namespace cxxbridge01 " ) ;
439439 for ty in types {
440440 if let Type :: RustBox ( ty) = ty {
441441 if let Type :: Ident ( inner) = & ty. inner {
@@ -455,34 +455,34 @@ fn write_rust_box_extern(out: &mut OutFile, ident: &Ident) {
455455 inner += & ident. to_string ( ) ;
456456 let instance = inner. replace ( "::" , "$" ) ;
457457
458- writeln ! ( out, "#ifndef CXXBRIDGE00_RUST_BOX_ {}" , instance) ;
459- writeln ! ( out, "#define CXXBRIDGE00_RUST_BOX_ {}" , instance) ;
458+ writeln ! ( out, "#ifndef CXXBRIDGE01_RUST_BOX_ {}" , instance) ;
459+ writeln ! ( out, "#define CXXBRIDGE01_RUST_BOX_ {}" , instance) ;
460460 writeln ! (
461461 out,
462- "void cxxbridge00 $rust_box${}$uninit(cxxbridge::RustBox<{}> *ptr) noexcept;" ,
462+ "void cxxbridge01 $rust_box${}$uninit(cxxbridge::RustBox<{}> *ptr) noexcept;" ,
463463 instance, inner,
464464 ) ;
465465 writeln ! (
466466 out,
467- "void cxxbridge00 $rust_box${}$set_raw(cxxbridge::RustBox<{}> *ptr, {} *raw) noexcept;" ,
467+ "void cxxbridge01 $rust_box${}$set_raw(cxxbridge::RustBox<{}> *ptr, {} *raw) noexcept;" ,
468468 instance, inner, inner
469469 ) ;
470470 writeln ! (
471471 out,
472- "void cxxbridge00 $rust_box${}$drop(cxxbridge::RustBox<{}> *ptr) noexcept;" ,
472+ "void cxxbridge01 $rust_box${}$drop(cxxbridge::RustBox<{}> *ptr) noexcept;" ,
473473 instance, inner,
474474 ) ;
475475 writeln ! (
476476 out,
477- "const {} *cxxbridge00 $rust_box${}$deref(const cxxbridge::RustBox<{}> *ptr) noexcept;" ,
477+ "const {} *cxxbridge01 $rust_box${}$deref(const cxxbridge::RustBox<{}> *ptr) noexcept;" ,
478478 inner, instance, inner,
479479 ) ;
480480 writeln ! (
481481 out,
482- "{} *cxxbridge00 $rust_box${}$deref_mut(cxxbridge::RustBox<{}> *ptr) noexcept;" ,
482+ "{} *cxxbridge01 $rust_box${}$deref_mut(cxxbridge::RustBox<{}> *ptr) noexcept;" ,
483483 inner, instance, inner,
484484 ) ;
485- writeln ! ( out, "#endif // CXXBRIDGE00_RUST_BOX_ {}" , instance) ;
485+ writeln ! ( out, "#endif // CXXBRIDGE01_RUST_BOX_ {}" , instance) ;
486486}
487487
488488fn write_rust_box_impl ( out : & mut OutFile , ident : & Ident ) {
@@ -498,7 +498,7 @@ fn write_rust_box_impl(out: &mut OutFile, ident: &Ident) {
498498 writeln ! ( out, "void RustBox<{}>::uninit() noexcept {{" , inner) ;
499499 writeln ! (
500500 out,
501- " return cxxbridge00 $rust_box${}$uninit(this);" ,
501+ " return cxxbridge01 $rust_box${}$uninit(this);" ,
502502 instance
503503 ) ;
504504 writeln ! ( out, "}}" ) ;
@@ -511,7 +511,7 @@ fn write_rust_box_impl(out: &mut OutFile, ident: &Ident) {
511511 ) ;
512512 writeln ! (
513513 out,
514- " return cxxbridge00 $rust_box${}$set_raw(this, raw);" ,
514+ " return cxxbridge01 $rust_box${}$set_raw(this, raw);" ,
515515 instance
516516 ) ;
517517 writeln ! ( out, "}}" ) ;
@@ -520,7 +520,7 @@ fn write_rust_box_impl(out: &mut OutFile, ident: &Ident) {
520520 writeln ! ( out, "void RustBox<{}>::drop() noexcept {{" , inner) ;
521521 writeln ! (
522522 out,
523- " return cxxbridge00 $rust_box${}$drop(this);" ,
523+ " return cxxbridge01 $rust_box${}$drop(this);" ,
524524 instance
525525 ) ;
526526 writeln ! ( out, "}}" ) ;
@@ -533,7 +533,7 @@ fn write_rust_box_impl(out: &mut OutFile, ident: &Ident) {
533533 ) ;
534534 writeln ! (
535535 out,
536- " return cxxbridge00 $rust_box${}$deref(this);" ,
536+ " return cxxbridge01 $rust_box${}$deref(this);" ,
537537 instance
538538 ) ;
539539 writeln ! ( out, "}}" ) ;
@@ -546,7 +546,7 @@ fn write_rust_box_impl(out: &mut OutFile, ident: &Ident) {
546546 ) ;
547547 writeln ! (
548548 out,
549- " return cxxbridge00 $rust_box${}$deref_mut(this);" ,
549+ " return cxxbridge01 $rust_box${}$deref_mut(this);" ,
550550 instance
551551 ) ;
552552 writeln ! ( out, "}}" ) ;
@@ -561,8 +561,8 @@ fn write_unique_ptr(out: &mut OutFile, ident: &Ident) {
561561 inner += & ident. to_string ( ) ;
562562 let instance = inner. replace ( "::" , "$" ) ;
563563
564- writeln ! ( out, "#ifndef CXXBRIDGE00_UNIQUE_PTR_ {}" , instance) ;
565- writeln ! ( out, "#define CXXBRIDGE00_UNIQUE_PTR_ {}" , instance) ;
564+ writeln ! ( out, "#ifndef CXXBRIDGE01_UNIQUE_PTR_ {}" , instance) ;
565+ writeln ! ( out, "#define CXXBRIDGE01_UNIQUE_PTR_ {}" , instance) ;
566566 writeln ! (
567567 out,
568568 "static_assert(sizeof(std::unique_ptr<{}>) == sizeof(void *), \" \" );" ,
@@ -575,14 +575,14 @@ fn write_unique_ptr(out: &mut OutFile, ident: &Ident) {
575575 ) ;
576576 writeln ! (
577577 out,
578- "void cxxbridge00 $unique_ptr${}$null(std::unique_ptr<{}> *ptr) noexcept {{" ,
578+ "void cxxbridge01 $unique_ptr${}$null(std::unique_ptr<{}> *ptr) noexcept {{" ,
579579 instance, inner,
580580 ) ;
581581 writeln ! ( out, " new (ptr) std::unique_ptr<{}>();" , inner) ;
582582 writeln ! ( out, "}}" ) ;
583583 writeln ! (
584584 out,
585- "void cxxbridge00 $unique_ptr${}$new(std::unique_ptr<{}> *ptr, {} *value) noexcept {{" ,
585+ "void cxxbridge01 $unique_ptr${}$new(std::unique_ptr<{}> *ptr, {} *value) noexcept {{" ,
586586 instance, inner, inner,
587587 ) ;
588588 writeln ! (
@@ -593,31 +593,31 @@ fn write_unique_ptr(out: &mut OutFile, ident: &Ident) {
593593 writeln ! ( out, "}}" ) ;
594594 writeln ! (
595595 out,
596- "void cxxbridge00 $unique_ptr${}$raw(std::unique_ptr<{}> *ptr, {} *raw) noexcept {{" ,
596+ "void cxxbridge01 $unique_ptr${}$raw(std::unique_ptr<{}> *ptr, {} *raw) noexcept {{" ,
597597 instance, inner, inner,
598598 ) ;
599599 writeln ! ( out, " new (ptr) std::unique_ptr<{}>(raw);" , inner) ;
600600 writeln ! ( out, "}}" ) ;
601601 writeln ! (
602602 out,
603- "const {} *cxxbridge00 $unique_ptr${}$get(const std::unique_ptr<{}>& ptr) noexcept {{" ,
603+ "const {} *cxxbridge01 $unique_ptr${}$get(const std::unique_ptr<{}>& ptr) noexcept {{" ,
604604 inner, instance, inner,
605605 ) ;
606606 writeln ! ( out, " return ptr.get();" ) ;
607607 writeln ! ( out, "}}" ) ;
608608 writeln ! (
609609 out,
610- "{} *cxxbridge00 $unique_ptr${}$release(std::unique_ptr<{}>& ptr) noexcept {{" ,
610+ "{} *cxxbridge01 $unique_ptr${}$release(std::unique_ptr<{}>& ptr) noexcept {{" ,
611611 inner, instance, inner,
612612 ) ;
613613 writeln ! ( out, " return ptr.release();" ) ;
614614 writeln ! ( out, "}}" ) ;
615615 writeln ! (
616616 out,
617- "void cxxbridge00 $unique_ptr${}$drop(std::unique_ptr<{}> *ptr) noexcept {{" ,
617+ "void cxxbridge01 $unique_ptr${}$drop(std::unique_ptr<{}> *ptr) noexcept {{" ,
618618 instance, inner,
619619 ) ;
620620 writeln ! ( out, " ptr->~unique_ptr();" ) ;
621621 writeln ! ( out, "}}" ) ;
622- writeln ! ( out, "#endif // CXXBRIDGE00_UNIQUE_PTR_ {}" , instance) ;
622+ writeln ! ( out, "#endif // CXXBRIDGE01_UNIQUE_PTR_ {}" , instance) ;
623623}
0 commit comments