From abc5c381bea2371aa533edd6cbee48aaaadbe4d1 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 24 Aug 2013 19:26:06 +0000 Subject: [PATCH] fix interrogate compile error when a function takes a non-const char pointer --- dtool/src/interrogate/parameterRemapToString.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dtool/src/interrogate/parameterRemapToString.cxx b/dtool/src/interrogate/parameterRemapToString.cxx index fe91062786..432b02d69f 100644 --- a/dtool/src/interrogate/parameterRemapToString.cxx +++ b/dtool/src/interrogate/parameterRemapToString.cxx @@ -26,10 +26,19 @@ ParameterRemapToString(CPPType *orig_type) : { static CPPType *char_star_type = (CPPType *)NULL; if (char_star_type == (CPPType *)NULL) { - char_star_type = parser.parse_type("const char *"); + char_star_type = parser.parse_type("char *"); } - _new_type = char_star_type; + static CPPType *const_char_star_type = (CPPType *)NULL; + if (const_char_star_type == (CPPType *)NULL) { + const_char_star_type = parser.parse_type("const char *"); + } + + if (TypeManager::is_const(orig_type)) { + _new_type = const_char_star_type; + } else { + _new_type = char_star_type; + } } ////////////////////////////////////////////////////////////////////