Skip to content

Commit 987d00a

Browse files
authored
Deprecate c++ demangling. (#1800)
Signed-off-by: furby™ <devs@wabi.foundation>
1 parent e1f3791 commit 987d00a

File tree

1 file changed

+3
-29
lines changed

1 file changed

+3
-29
lines changed

src/opentimelineio/stringUtils.cpp

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,9 @@
22
// Copyright Contributors to the OpenTimelineIO project
33

44
#include "opentimelineio/serializableObject.h"
5-
#if defined(__GNUC__) || defined(__clang__)
6-
# include <cstdlib>
7-
# include <cxxabi.h>
8-
# include <memory>
9-
#else
10-
# include <typeinfo>
11-
#endif
12-
13-
namespace {
14-
#if defined(__GNUC__) || defined(__clang__)
15-
std::string
16-
cxxabi_type_name_for_error_mesage(const char* name)
17-
{
18-
int status = -4; // some arbitrary value to eliminate the compiler warning
19-
20-
std::unique_ptr<char, void (*)(void*)> res{
21-
abi::__cxa_demangle(name, NULL, NULL, &status),
22-
std::free
23-
};
24-
25-
return (status == 0) ? res.get() : name;
26-
}
27-
#endif
28-
} // namespace
5+
#include <cstdlib>
6+
#include <memory>
7+
#include <typeinfo>
298

309
namespace opentimelineio { namespace OPENTIMELINEIO_VERSION {
3110

@@ -41,12 +20,7 @@ type_name_for_error_message(std::type_info const& t)
4120
return "None";
4221
}
4322

44-
#if defined(__GNUC__) || defined(__clang__)
45-
return ::cxxabi_type_name_for_error_mesage(t.name());
46-
#else
47-
// On Windows std::type_info.name() returns a human readable string.
4823
return t.name();
49-
#endif
5024
}
5125

5226
std::string

0 commit comments

Comments
 (0)