Skip to content

Conversation

@eschaton
Copy link

@eschaton eschaton commented Nov 6, 2024

To ensure ease of interoperability, I've prefixed almost all of the preprocessor macros used by Musashi with M68K_ since that's the common prefix in the public API. The only ones I've left alone are TRUE and FALSE and NULL since those are so universal.

I've also wrapped the preprocessor macros with #ifdef and #endif so the contents of m68kconf.h can be selectively overridden, meaning those using Musashi don't need to incorporate and change it or write their own from scratch and replace it.

Add prefixes to these preprocessor macros, so they’re properly namespaced like
the rest of the preprocessor macros are:

- `M68K_OPT_ON`
- `M68K_OPT_OFF`
- `M68K_OPT_SPECIFY_HANDLER`
- `M68K_ARRAY_LENGTH`

The `TRUE` and `FALSE` macros are kept as-is because they're so common in C
codebases and they're already properly protected from redefinition.
Right now, users of Musashi generally need to incorporate it into their code,
rather than just reference it, because it’s necessary to supply a custom
`m68kconf.h` file for each use.

By wrapping the preprocessor macros to control the options in `#ifdef` and
`#endif`, these options can also be controlled without having to edit
`m68kconf.h` while still having reasonable defaults.
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