From f729744ef92891a0417b8298e8a6978f20017f90 Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Fri, 21 Apr 2023 12:18:53 +0200 Subject: [PATCH] Print prototypes before functors (#1034) --- src/codegen/codegen_cpp_visitor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/codegen/codegen_cpp_visitor.cpp b/src/codegen/codegen_cpp_visitor.cpp index f51522c641..1cc56e1314 100644 --- a/src/codegen/codegen_cpp_visitor.cpp +++ b/src/codegen/codegen_cpp_visitor.cpp @@ -3562,10 +3562,12 @@ void CodegenCVisitor::print_nrn_destructor() { void CodegenCVisitor::print_functors_definitions() { + codegen = true; for (const auto& functor_name: info.functor_names) { printer->add_newline(2); print_functor_definition(*functor_name.first); } + codegen = false; } @@ -4585,7 +4587,6 @@ void CodegenCVisitor::print_g_unused() const { void CodegenCVisitor::print_compute_functions() { print_top_verbatim_blocks(); - print_function_prototypes(); for (const auto& procedure: info.procedures) { print_procedure(*procedure); } @@ -4633,6 +4634,7 @@ void CodegenCVisitor::print_codegen_routines() { print_nrn_alloc(); print_nrn_constructor(); print_nrn_destructor(); + print_function_prototypes(); print_functors_definitions(); print_compute_functions(); print_check_table_thread_function();