Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for nested namespaces for C++ #765

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions feature_tests/c/include/Nested.d.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions feature_tests/c/include/Nested.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions feature_tests/c/include/Nested2.d.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions feature_tests/c/include/Nested2.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions feature_tests/cpp/include/nested/ns/Nested.d.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions feature_tests/cpp/include/nested/ns/Nested.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions feature_tests/cpp/include/nested/ns2/Nested.d.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions feature_tests/cpp/include/nested/ns2/Nested.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions feature_tests/cpp/tests/attrs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
#include "../include/ns/AttrOpaque1Renamed.hpp"
#include "../include/ns/RenamedAttrEnum.hpp"
#include "../include/Unnamespaced.hpp"
#include "../include/nested/ns/Nested.hpp"
#include "../include/nested/ns2/Nested.hpp"
#include "assert.hpp"

int main(int argc, char *argv[]) {
int main(int argc, char *argv[])
{
std::unique_ptr<ns::AttrOpaque1Renamed> r = ns::AttrOpaque1Renamed::totally_not_new();
simple_assert_eq("method should call", r->method_renamed(), 77);
simple_assert_eq("method should call", r->abirenamed(), 123);

// These C names should also resolve
void* renamed = (void*)ns::capi::renamed_on_abi_only;
std::cout<<"Renamed function at "<<renamed<<std::endl;
renamed = (void*)ns::capi::namespace_AttrOpaque1_method;
std::cout<<"Renamed function at "<<renamed<<std::endl;
void *renamed = (void *)ns::capi::renamed_on_abi_only;
std::cout << "Renamed function at " << renamed << std::endl;
renamed = (void *)ns::capi::namespace_AttrOpaque1_method;
std::cout << "Renamed function at " << renamed << std::endl;

ns::RenamedAttrEnum e = ns::RenamedAttrEnum::A;

Expand Down
28 changes: 28 additions & 0 deletions feature_tests/dart/lib/src/RenamedNested.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions feature_tests/dart/lib/src/RenamedNested2.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions feature_tests/dart/lib/src/lib.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions feature_tests/js/api/RenamedNested.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading