diff --git a/webserver/core/lib/iec_std_FB.h b/webserver/core/lib/iec_std_FB.h index dfb01b7..fd25e05 100755 --- a/webserver/core/lib/iec_std_FB.h +++ b/webserver/core/lib/iec_std_FB.h @@ -1886,6 +1886,7 @@ __end: #include "communication.h" +#include "../c_blocks.h" #if defined(SEQUENT) #include "sm_cards.h" #endif diff --git a/webserver/openplc.py b/webserver/openplc.py index 3c11cfe..e00e0f8 100644 --- a/webserver/openplc.py +++ b/webserver/openplc.py @@ -129,6 +129,12 @@ class runtime: for line in combined_lines: if line.startswith('(*DBG:') and line.endswith('*)'): c_debug_lines.append(line[6:-2]) + elif line.startswith('(*FILE:c_blocks_code.cpp') and 'extern "C" void' in line: + # This is a hack to backport runtime v4 C/C++ functionality to v3. The v3 runtime needs to + # exclude all extern "C" declarations from the c_blocks_code.cpp file. I know this is not + # pretty, but v3 architecture is not pretty, so we are doing this here so that v4 code + # can remain pretty. + pass elif line.startswith('(*FILE:') and line.endswith('*)'): file_content = line[7:-2].strip() if ' ' in file_content: