Skip to content

Commit

Permalink
fix: win and linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-olivier committed Jul 26, 2024
1 parent bb4889e commit 90a6911
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/demangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ std::string format_symbol(std::string input);

#if (defined(_WIN32) || defined(_WIN64))

#include <windows.h>
#include <dbghelp.h>
#include <tchar.h>

#pragma comment(lib, "dbghelp.lib")

std::string get_demangled_name(const char *symbol) {
char undecorated[MAX_SYM_NAME];
DWORD flags = UNDNAME_COMPLETE | UNDNAME_NO_FUNCTION_RETURNS | UNDNAME_NO_MS_KEYWORDS;
Expand Down Expand Up @@ -37,6 +43,7 @@ std::string get_demangled_name(const char *symbol) {
#else

#include <cxxabi.h>
#include <cstring>

std::string get_demangled_name(const char *symbol) {
std::string result;
Expand Down
3 changes: 0 additions & 3 deletions src/symbols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ std::string get_demangled_name(const char *symbol);
#if (defined(_WIN32) || defined(_WIN64))

#include <windows.h>
#include <dbghelp.h>
#include <tchar.h>

#pragma comment(lib, "dbghelp.lib")

std::vector<std::string> get_symbols(HMODULE hModule, bool demangle) {
std::vector<std::string> result;

Expand Down

0 comments on commit 90a6911

Please sign in to comment.