Sorry for the bad title, I'll try to describe my problem a bit better..
I work with a real-time OS. Since I have the task to test a new feature and our main RTOS does not support it yet, I will make a prototype based on another (until now not used) RTOS. This new RTOS brings its own header files which hosts many typedefs to generate abbreviations like ULONG, BOOL, INT, etc...
In our code-base there are typedefs that shall guarantee that, for example, an unsigned long is exactly 4 Bytes. And according to our styleguide those new types shall be used for any interface we produce.
Those typedefs unfortunately are named the same as the ones from the new RTOS (ULONG, INT, BOOL, ...).
The build-breaking thing is, that BOOL for example is once declared as unsigned char and once as int.
This leads to corruption of some function-headers where BOOL and other different types are used.
My question is, how can I make one of those two the "main" header and thus prefer it's typedefs over the ones of the other header-file?
And what other ways do you see to divide those two headers?
Since I only implement a prototype on the new RTOS, changing our base-types is seen as a less favored solution. Any help is appreciated and if you need further clarification, just let know!
edit:
ok, here's some code for further clarification:
RTOS_typedefs.h
...
typedef void VOID;
typedef unsigned char BOOL;
typedef int INT;
...
ownCodeBase_typedefs.h
...
#define void VOID
typedef int BOOL;
typedef int INT;
Now as you can see, the INT typedef is the same and causes no trouble.
The Void define collides with the void typedef in some files and the preprocessor produces the following:
typedef void void;
... which generates a compiler error.
The Bool typedef destroys my function-headers since in one file the RTOS-version is used and in the other file the typedef from our code base is used. The compiler generates two different signatures and the linker can't find the definition for one of them. -> another error is thrown