Skip to content

Commit

Permalink
merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
aaryanshukla committed Jul 16, 2024
1 parent 8072087 commit 3ba2d40
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions libc/newhdrgen/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,38 @@ def __str__(self):

content.append("\n__BEGIN_C_DECLS\n")

current_guard = None
for function in self.functions:
content.append(str(function) + "__NOEXCEPT")
content.append("")
if function.guard == None:
content.append(str(function) + "__NOEXCEPT")
content.append("")
else:
if current_guard == None:
current_guard = function.guard
content.append(f"#ifdef {current_guard}")
content.append(str(function) + "__NOEXCEPT")
content.append("")
elif current_guard == function.guard:
content.append(str(function) + "__NOEXCEPT")
content.append("")
else:
content.pop()
content.append(f"#endif // {current_guard}")
content.append("")
current_guard = function.guard
content.append(f"#ifdef {current_guard}")
content.append(str(function) + "__NOEXCEPT")
content.append("")
if current_guard != None:
content.pop()
content.append(f"#endif // {current_guard}")
content.append("")

for object in self.objects:
content.append(str(object))
if self.objects:
content.append("\n__END_C_DECLS")
else:
content.append("__END_C_DECLS")

return "\n".join(content)
return "\n".join(content)

0 comments on commit 3ba2d40

Please sign in to comment.