summaryrefslogtreecommitdiff
path: root/demangler/msvc/demangle_msvc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'demangler/msvc/demangle_msvc.cpp')
-rw-r--r--demangler/msvc/demangle_msvc.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/demangler/msvc/demangle_msvc.cpp b/demangler/msvc/demangle_msvc.cpp
index 297da114..ab883771 100644
--- a/demangler/msvc/demangle_msvc.cpp
+++ b/demangler/msvc/demangle_msvc.cpp
@@ -15,12 +15,18 @@
// Includes snippets from LLVM, which is under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
-#include "binaryninjaapi.h"
#include "demangle_msvc.h"
#include <memory>
+
+#ifdef BINARYNINJACORE_LIBRARY
+using namespace BinaryNinjaCore;
+#define GetClass GetTypeClass
+#else
using namespace BinaryNinja;
using namespace std;
+#endif
+
#define MAX_DEMANGLE_LENGTH 4096
@@ -1860,8 +1866,13 @@ public:
return name[0] == '?';
}
+#ifdef BINARYNINJACORE_LIBRARY
+ virtual bool Demangle(Architecture* arch, const string& name, Ref<Type>& outType, QualifiedName& outVarName,
+ BinaryView* view) override
+#else
virtual bool Demangle(Ref<Architecture> arch, const string& name, Ref<Type>& outType, QualifiedName& outVarName,
Ref<BinaryView> view) override
+#endif
{
if (view)
return Demangle::DemangleMS(arch, name, outType, outVarName, view);
@@ -1869,12 +1880,15 @@ public:
}
};
-
extern "C"
{
+#ifndef BINARYNINJACORE_LIBRARY
BN_DECLARE_CORE_ABI_VERSION
+#endif
-#ifdef DEMO_EDITION
+#ifdef BINARYNINJACORE_LIBRARY
+ bool DemangleMSVCPluginInit()
+#elif defined(DEMO_EDITION)
bool DemangleMSVCPluginInit()
#else
BINARYNINJAPLUGIN bool CorePluginInit()