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

ABI dependency #6

Open
malleor opened this issue Mar 11, 2013 · 1 comment
Open

ABI dependency #6

malleor opened this issue Mar 11, 2013 · 1 comment

Comments

@malleor
Copy link

malleor commented Mar 11, 2013

Is it really required to depend on cxxabi.h? Non-gcc projects hit the wall here. Removed the problematic code regarding typename demangling. Interested in a contribution? One could provide a conditional compilation for this code.

@adishavit
Copy link

If you remove the cxxabi.h include and add around the original demangle function, it'll work on Windows too:

#ifndef WIN32
#include <cxxabi.h>

static inline std::string demangle(const std::string &name)
{
  int status=0;
  char *p=abi::__cxa_demangle(name.c_str(), 0, 0, &status);
  std::string ret(p);
  free(p);
  return ret;
}
#else

#include <windows.h> 
#include <Dbghelp.h>
#pragma comment(lib,"dbghelp.lib")     

static inline std::string demangle(const std::string &name)
{
   TCHAR szUndecorateName[256];
   memset(szUndecorateName, 0, 256);
   UnDecorateSymbolName(name.c_str(), szUndecorateName, 256, 0);
   return szUndecorateName;
}
#endif

MihailJP added a commit to MihailJP/cmdline that referenced this issue Jul 7, 2018
This fixes ABI dependency issue
tanakh#6
Implements adishavit's suggestion posted on 1 Oct 2015 and fixes errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants