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

Implement #if defined(...) and #elif defined(...) and #else #62

Merged
merged 2 commits into from
Jul 25, 2023

Conversation

ChinYikMing
Copy link
Collaborator

Now only support simple conditional expression which is defined(...) after #if and #elif. More complex conditional expression might be supported in the future.

Refactor 'lib/c.c' to improve readability.

Also, add a simple test case to 'tests/driver.sh'

Now only support simple conditional expression which is defined(...) after #if and #elif.
More complex conditional expression might be supported in the future.

Refactor 'lib/c.c' to improve readability.

Also, add a simple test case to 'tests/driver.sh'
@jserv
Copy link
Collaborator

jserv commented Jul 25, 2023

Can you reuse the logic between #ifdef and #if defined?

@jserv jserv requested a review from eecheng87 July 25, 2023 11:30
@ChinYikMing
Copy link
Collaborator Author

Do you mean use #ifdef and #if defined at the same time?

@jserv
Copy link
Collaborator

jserv commented Jul 25, 2023

Do you mean use #ifdef and #if defined at the same time?

I meant, to avoid code duplication for the same functionalities mentioned above.

@ChinYikMing
Copy link
Collaborator Author

I think some logic of #if and #elif can be refactored. Is it possible for next commit?

@jserv
Copy link
Collaborator

jserv commented Jul 25, 2023

I think some logic of #if and #elif can be refactored. Is it possible for next commit?

You can submit multiple functional commits in this pull request.

@jserv jserv merged commit d374993 into sysprog21:master Jul 25, 2023
3 checks passed
@jserv
Copy link
Collaborator

jserv commented Jul 25, 2023

Thank @ChinYikMing for contributing!

@ChinYikMing ChinYikMing deleted the pr branch July 25, 2023 15:48
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.

2 participants