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
This commit is contained in:
Nathan Scott
2020-07-10 10:35:32 +10:00
parent 402e46bb82
commit dfd9279f87
5 changed files with 31 additions and 27 deletions

View File

@ -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