A dedicated module for one include file?

Hey there!

I have a header file with structs that are used in more than one module. Where would you put it, in a dedicated module?

Thanks!

Personally I have a module that has all sorts of common stuff in it. Some people don’t like the idea of a “utils” plugin that many plugins are dependent on. It depends on how common those structs are.

Another alternative would be to duplicate the header with different structure names so that they’re unique to each use case. That may sound crazy, but sometimes “common” things aren’t only so superficially so it can be helpful to have unique implementations in each system.

The fact that the header is shared, may also mean that the things you have broken up across multiple modules should actually be in a single one.

But creating a module for one header doesn’t sound too outrageous. Especially if it’s within the plugin that the other modules are in.

1 Like

Yup, I have a plugin that just has enums and structs in it with only header files. I set it up that way because those structs and enums are used in my game code, as well as some of my other plugins.