diff --git a/dtool/src/interrogate/interfaceMaker.cxx b/dtool/src/interrogate/interfaceMaker.cxx index 7efee037a3..56ed92b771 100644 --- a/dtool/src/interrogate/interfaceMaker.cxx +++ b/dtool/src/interrogate/interfaceMaker.cxx @@ -754,3 +754,19 @@ hash_function_signature(FunctionRemap *remap) { remap->_hash = hash; } + +//////////////////////////////////////////////////////////////////// +// Function: InterfaceMaker::write_spam_message +// Access: Protected +// Description: Generates a string to output a spammy message to +// notify indicating we have just called this function. +//////////////////////////////////////////////////////////////////// +void InterfaceMaker:: +write_spam_message(ostream &out, FunctionRemap *remap) const { + out << + " if (interrogatedb_cat.is_spam()) {\n" + " interrogatedb_cat.spam() << \""; + remap->write_orig_prototype(out, 0); + out << "\\n\";\n" + " }\n"; +} diff --git a/dtool/src/interrogate/interfaceMaker.h b/dtool/src/interrogate/interfaceMaker.h index fe177773f6..fd9d69b40f 100644 --- a/dtool/src/interrogate/interfaceMaker.h +++ b/dtool/src/interrogate/interfaceMaker.h @@ -138,6 +138,7 @@ protected: void output_ref(ostream &out, int indent_level, FunctionRemap *remap, const string &varname) const; + void write_spam_message(ostream &out, FunctionRemap *remap) const; protected: InterrogateModuleDef *_def; diff --git a/dtool/src/interrogate/interfaceMakerC.cxx b/dtool/src/interrogate/interfaceMakerC.cxx index 61c7c0a855..c4c7345bef 100644 --- a/dtool/src/interrogate/interfaceMakerC.cxx +++ b/dtool/src/interrogate/interfaceMakerC.cxx @@ -192,8 +192,10 @@ write_function_instance(ostream &out, InterfaceMaker::Function *func, write_function_header(out, func, remap, true); out << " {\n"; - - // write_spam_message(def_index, out); + + if (generate_spam) { + write_spam_message(out, remap); + } string return_expr = remap->call_function(out, 2, true, "param0"); diff --git a/dtool/src/interrogate/interfaceMakerPythonSimple.cxx b/dtool/src/interrogate/interfaceMakerPythonSimple.cxx index 26912cf3a8..fa922cb3d5 100644 --- a/dtool/src/interrogate/interfaceMakerPythonSimple.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonSimple.cxx @@ -233,8 +233,10 @@ write_function_instance(ostream &out, InterfaceMaker::Function *func, out << "PyObject *\n" << remap->_wrapper_name << "(PyObject *, PyObject *args) {\n"; - - // write_spam_message(def_index, out); + + if (generate_spam) { + write_spam_message(out, remap); + } string format_specifiers; string parameter_list;