diff --git a/src/opentimelineio/stringUtils.cpp b/src/opentimelineio/stringUtils.cpp index f84d977..3d713f3 100644 --- a/src/opentimelineio/stringUtils.cpp +++ b/src/opentimelineio/stringUtils.cpp @@ -4,7 +4,12 @@ #include "opentimelineio/serializableObject.h" #if defined(__GNUC__) || defined(__clang__) # include -# include +# if __has_include() +# define OTIO_HAVE_DEMANGLER 1 +# include +# else // !__has_include() +# define OTIO_HAVE_DEMANGLER 0 +# endif // __has_include() # include #else # include @@ -15,6 +20,7 @@ namespace { std::string cxxabi_type_name_for_error_mesage(const char* name) { + #if OTIO_HAVE_DEMANGLE int status = -4; // some arbitrary value to eliminate the compiler warning std::unique_ptr res{ @@ -23,6 +29,9 @@ cxxabi_type_name_for_error_mesage(const char* name) }; return (status == 0) ? res.get() : name; + #else // !OTIO_HAVE_DEMANGLE + return name; + #endif // OTIO_HAVE_DEMANGLE } #endif } // namespace