[not part of build] more heuristics for valid identifiers

git-svn-id: svn://10.0.0.236/trunk@65784 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
beard%netscape.com 2000-04-13 06:39:20 +00:00
parent ea22c7c2e0
commit e02a506408

View File

@ -9,6 +9,7 @@
*/
#include <typeinfo>
#include <ctype.h>
#include <Processes.h>
extern "C" const char* getTypeName(void* ptr);
@ -49,7 +50,10 @@ const char* getTypeName(void* ptr)
void** vt = *(void***)ptr;
if (space.contains(vt) && space.contains(*vt)) {
IUnknown* u = static_cast<IUnknown*>(ptr);
return typeid(*u).name();
const char* type = typeid(*u).name();
// make sure it looks like a C++ identifier.
if (type && (isalnum(type[0]) || type[0] == '_'))
return type;
}
return "void*";
}