From a14539d5ecce1b6c641e6f5e2f5a99f4ff26c597 Mon Sep 17 00:00:00 2001 From: Gregor Weiss Date: Thu, 25 Jan 2024 16:59:09 +0100 Subject: [PATCH] Interfacing with C++ -- 'extern "C"' --- public_header.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/public_header.py b/public_header.py index 489975e..f14028d 100644 --- a/public_header.py +++ b/public_header.py @@ -282,6 +282,10 @@ public_header.write("\n" + ubox + tab + "||" + lspaces * " " + "___ _ _ ___ _ tab + "||" + lspaces * " " + "| |__| |__] |___ | |___ | |__| | \| |___ | | |__| | \| ___]" + rspaces * " " + "||\n" + tab + "||" + (116 - len(tab)) * " " + "||\n" + lbox) +public_header.write("\n" + tab + "#ifdef __cplusplus\n" + + tab + "extern \"C\" {\n" + + tab + "#endif\n\n") + files = os.listdir("include/library/private") printFlg = False ltab = 0 @@ -327,5 +331,10 @@ for file in files: public_header.write(buff) buff = line f.close + +public_header.write("\n" + tab + "#ifdef __cplusplus\n" + + tab + "}\n" + + tab + "#endif\n\n") + public_header.write("#endif") public_header.close \ No newline at end of file