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

Fix circular includes #156

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

MEhrn00
Copy link

@MEhrn00 MEhrn00 commented Sep 13, 2024

There is a circular include where include/donut.h#L85 includes format.h while include/format.h#L35 includes donut.h. This could potentially cause issues where included symbols do not get defined.

Since format.c only uses donut.h for the error macros, they can be refactored out into a separate errors.h file which can be included separately in format.c without needing to include all of donut.h.

The DPRINT macro has to be re-implemented because it is needed for format.c but is only defined in donut.h and loader/loader.h. loader/loader.h#L101 also includes donut.h so it cannot be used since this would result in another circular include.

Remove `donut.h` include from `format.h`. Separate out `DONUT_ERROR_*`
macros to separate `errors.h` header file to satisfy `format.c`
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.

1 participant