Commit Graph

10 Commits

Author SHA1 Message Date
David Tolnay
7f65e7cda7
Remove rust::Str repr conversion on the C++ side 2021-01-02 00:34:19 -08:00
David Tolnay
0f0162f37d
Bump namespace to 1 2020-11-17 08:30:10 -08:00
David Tolnay
7be5b1f134
Enforce unsafe surrounding block on safe-to-call functions 2020-11-11 11:09:33 -08:00
David Tolnay
c72a9f6ad6
Update cxx::bridge modules to use extern "C++" as the ABI 2020-11-11 10:57:50 -08:00
David Tolnay
a972eb7d93
Ignore field_reassign_with_default 2020-11-06 10:12:21 -08:00
David Tolnay
0356d33acb
Pass Str in PtrLen representation
MSVC is hesitant about passing private fields in an extern "C" signature.
Repro:

    struct Str1 {
      const char *ptr;
      size_t len;
    };

    struct Str2 {
    private:
      const char *ptr;
      size_t len;
    };

    extern "C" {
      Str1 str1();
      Str2 str2();
    }

Warning from MSVC v19.27:

    warning C4190: 'str2' has C-linkage specified, but returns UDT 'Str2' which is incompatible with C
2020-10-31 20:33:39 -07:00
David Tolnay
5df1f06eb8
Eliminate Str::Repr struct 2020-10-31 17:31:44 -07:00
David Tolnay
8f16ae75f3
Bump namespace to 05 2020-10-08 19:34:50 -07:00
David Tolnay
1f7a7e5bca
Touch up cxx_gen test 2020-10-04 19:50:35 -07:00
David Tolnay
821402b2a6
Move C++ generated code test to cxx's integration test 2020-10-04 19:50:35 -07:00