diff --git a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs index 7e767611..441b81f3 100644 --- a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs +++ b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs @@ -341,7 +341,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(TypeQualifiers.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(3); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(3)); + *(TypeQualifiers.Internal*) ret = native; return ret; } @@ -449,7 +449,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(QualifiedType.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(8); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(8)); + *(QualifiedType.Internal*) ret = native; return ret; } @@ -1355,7 +1355,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(TemplateArgument.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(20); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(20)); + *(TemplateArgument.Internal*) ret = native; return ret; } @@ -2246,7 +2246,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(VTableComponent.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(12); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(12)); + *(VTableComponent.Internal*) ret = native; return ret; } @@ -5212,7 +5212,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(BaseClassSpecifier.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(12); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(12)); + *(BaseClassSpecifier.Internal*) ret = native; return ret; } @@ -7887,7 +7887,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(Comment.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(4); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(4)); + *(Comment.Internal*) ret = native; return ret; } @@ -7962,7 +7962,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(FullComment.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(4); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(4)); + *(FullComment.Internal*) ret = native; return ret; } diff --git a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppParser.cs b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppParser.cs index 547205db..3b938122 100644 --- a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppParser.cs +++ b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppParser.cs @@ -923,7 +923,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(ClangParser.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(1); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(1)); + *(ClangParser.Internal*) ret = native; return ret; } diff --git a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs index cf84be67..b82a6fe0 100644 --- a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs +++ b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs @@ -341,7 +341,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(TypeQualifiers.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(3); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(3)); + *(TypeQualifiers.Internal*) ret = native; return ret; } @@ -449,7 +449,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(QualifiedType.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(8); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(8)); + *(QualifiedType.Internal*) ret = native; return ret; } @@ -1355,7 +1355,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(TemplateArgument.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(20); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(20)); + *(TemplateArgument.Internal*) ret = native; return ret; } @@ -2246,7 +2246,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(VTableComponent.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(12); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(12)); + *(VTableComponent.Internal*) ret = native; return ret; } @@ -5212,7 +5212,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(BaseClassSpecifier.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(12); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(12)); + *(BaseClassSpecifier.Internal*) ret = native; return ret; } @@ -7887,7 +7887,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(Comment.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(4); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(4)); + *(Comment.Internal*) ret = native; return ret; } @@ -7962,7 +7962,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(FullComment.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(4); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(4)); + *(FullComment.Internal*) ret = native; return ret; } diff --git a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppParser.cs b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppParser.cs index 22fa210c..21565923 100644 --- a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppParser.cs +++ b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppParser.cs @@ -923,7 +923,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(ClangParser.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(1); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(1)); + *(ClangParser.Internal*) ret = native; return ret; } diff --git a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs index 899e4eb7..e104a0d3 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs @@ -341,7 +341,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(TypeQualifiers.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(3); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(3)); + *(TypeQualifiers.Internal*) ret = native; return ret; } @@ -449,7 +449,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(QualifiedType.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(16); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(16)); + *(QualifiedType.Internal*) ret = native; return ret; } @@ -1355,7 +1355,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(TemplateArgument.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(40); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(40)); + *(TemplateArgument.Internal*) ret = native; return ret; } @@ -2246,7 +2246,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(VTableComponent.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(16); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(16)); + *(VTableComponent.Internal*) ret = native; return ret; } @@ -5211,7 +5211,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(BaseClassSpecifier.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(16); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(16)); + *(BaseClassSpecifier.Internal*) ret = native; return ret; } @@ -7886,7 +7886,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(Comment.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(4); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(4)); + *(Comment.Internal*) ret = native; return ret; } @@ -7961,7 +7961,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(FullComment.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(4); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(4)); + *(FullComment.Internal*) ret = native; return ret; } diff --git a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppParser.cs b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppParser.cs index fe76500e..937b4a29 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppParser.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppParser.cs @@ -923,7 +923,7 @@ namespace CppSharp private static global::System.IntPtr __CopyValue(ClangParser.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(1); - CppSharp.Runtime.Helpers.memcpy(ret, new IntPtr(&native), new UIntPtr(1)); + *(ClangParser.Internal*) ret = native; return ret; } diff --git a/src/CppParser/Parser.cpp b/src/CppParser/Parser.cpp index eb323e23..6bd3130b 100644 --- a/src/CppParser/Parser.cpp +++ b/src/CppParser/Parser.cpp @@ -572,10 +572,6 @@ Class* Parser::GetRecord(clang::RecordDecl* Record, bool& Process) if (Record->isInjectedClassName()) return nullptr; - // skip va_list_tag as in clang: lib/Sema/SemaLookup.cpp - if (Record->getDeclName() == C->getSema().VAListTagName) - return nullptr; - auto NS = GetNamespace(Record); assert(NS && "Expected a valid namespace"); @@ -749,7 +745,8 @@ void Parser::WalkRecordCXX(clang::CXXRecordDecl* Record, Class* RC) RC->HasNonTrivialCopyConstructor = Record->hasNonTrivialCopyConstructor(); RC->HasNonTrivialDestructor = Record->hasNonTrivialDestructor(); - bool hasLayout = !Record->isDependentType() && !Record->isInvalidDecl(); + bool hasLayout = !Record->isDependentType() && !Record->isInvalidDecl() && + Record->getDeclName() != C->getSema().VAListTagName; // Get the record layout information. const ASTRecordLayout* Layout = 0; diff --git a/tests/Basic/Basic.cpp b/tests/Basic/Basic.cpp index 3bca418b..1dd4b829 100644 --- a/tests/Basic/Basic.cpp +++ b/tests/Basic/Basic.cpp @@ -300,3 +300,7 @@ Bar::Item operator |(Bar::Item left, Bar::Item right) { return left | right; } + +void va_listFunction(va_list v) +{ +} diff --git a/tests/Basic/Basic.h b/tests/Basic/Basic.h index a0b7b4ed..3b5f1e0f 100644 --- a/tests/Basic/Basic.h +++ b/tests/Basic/Basic.h @@ -1,5 +1,7 @@ #include "../Tests.h" +#include + class DLL_API IgnoredType { class IgnoredNested @@ -556,3 +558,5 @@ class PureDtor public: virtual ~PureDtor() = 0; }; + +DLL_API void va_listFunction(va_list v);