Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default args to Define and make elselines optional in IfNdef/Ifdef #24

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lokraszewski
Copy link

Some quality of life improvements. This allows you to write a common include guard pattern such as:

test = c.IfNDef('__HEADER__', 
	[
		c.Define('__HEADER__'), 
		c.Comment("Header content")
	])

print(test)

Which results in:

#ifndef __HEADER__
#define __HEADER__
/* Header content */
#endif

Also added some test for the new ifndef/ifdef functionality.

@lokraszewski
Copy link
Author

@inducer let me know what you think of this! 😄

Base automatically changed from master to main March 8, 2021 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant