From dfd9279f87791e36a5212726781c31fbe7110361 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Fri, 10 Jul 2020 10:35:32 +1000 Subject: Resolve complation issues with -fno-common (default from gcc-10) Extends the MakeHeader script to auto-generate correct "extern" function declarations in some cases that it currently does not. Related to https://github.com/hishamhm/htop/pull/981 --- scripts/MakeHeader.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/MakeHeader.py b/scripts/MakeHeader.py index 349531b8..3ef34b88 100755 --- a/scripts/MakeHeader.py +++ b/scripts/MakeHeader.py @@ -54,8 +54,10 @@ for line in file.readlines(): elif line.startswith("typedef struct"): state = SKIP elif line[-1] == "{": - out.write( line[:-2].replace("inline", "extern") + ";\n" ) + out.write("extern " + line[:-2].replace("inline ", "") + ";\n") state = SKIP + elif line[-1] == ";": + out.write("extern " + line + "\n") else: out.write( line + "\n") is_blank = False -- cgit v1.2.3