diff options
author | Nathan Scott <nathans@redhat.com> | 2020-07-10 10:35:32 +1000 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2020-07-10 10:35:32 +1000 |
commit | dfd9279f87791e36a5212726781c31fbe7110361 (patch) | |
tree | ee044449e757e2ae56e876efd02c5b1965c05924 /scripts | |
parent | 402e46bb82964366746b86d77eb5afa69c279539 (diff) |
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
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/MakeHeader.py | 4 |
1 files changed, 3 insertions, 1 deletions
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 |