I am currently working on a project (in C), and we use #defines for the default variables. These variables are used to build the structure of a buffered battery.
Now we have different customers who have different layouts. In the past, we would simply create a whole new piece of software.
Now we are trying to get away from this fragmentation and use the same code base.
We have a shared library (used in all projects) that has a set of #define and declares structures. We currently have a custom header file (which contains #defines for this project) and it compares them with #define in a shared library. If it is different, it throws an error.
We want to save a custom header file, but I'm trying to find a solution to replace #define in a shared library. One idea is to replace them with some variable, the other is to use a certain type of preprocessor.
In the past, we used ifdef , but the code is really cluttered and terrible, so we are also trying to get away from it.
Anyone have any solutions?
source share