Commit c668b205 authored by Dave Marchevsky's avatar Dave Marchevsky Committed by Facebook GitHub Bot

Add cplus_demangle_v3 wrapper to Demangle.cpp

Summary: This file contains a wrapper that is protected from `basename` fn name collision between `libiberty.h` and `libgen.h` (0fb6287719abb3cf52d7eda457efbe567985d1d4). I ran into this same issue again when trying to use `libiberty`'s `cplus_demangle_v3`, so let's add a similar wrapper for this function.

Reviewed By: fjricci

Differential Revision: D24008824

fbshipit-source-id: 868e90579f753f0c5b62aaeb27af2ef0a2006155
parent 42b8f101
......@@ -48,5 +48,15 @@ int cplus_demangle_v3_callback_wrapper(
#endif
}
char* cplus_demangle_v3_wrapper(const char* mangled) {
#if FOLLY_DETAIL_HAVE_DEMANGLE_H
auto const options = DMGL_PARAMS | DMGL_ANSI | DMGL_TYPES;
return cplus_demangle_v3(mangled, options);
#else
(void)mangled;
return 0;
#endif
}
} // namespace detail
} // namespace folly
......@@ -32,5 +32,7 @@ extern int cplus_demangle_v3_callback_wrapper(
void (*cbref)(char const*, std::size_t, void*),
void* opaque);
extern char* cplus_demangle_v3_wrapper(const char* mangled);
} // namespace detail
} // namespace folly
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment