I am linking a project to a library. Depending on the version of the library, some API and typedef are different.
There is no way to extract the library version. I would like at compile time to determine the version of this library and define a corresponding preprocessor variable.
More precisely, I would like something as following
#ifdef size_type
#define LIBRARY_VERSION 1.0
#else
#define LIBRARY_VERSION 2.0
#endif
The problem is that size_type is not a macro but a type defined using a typedef. How can I do it?
Use an accompanying macro at the location where the typedef is defined.
You will need to write an additional line, but only once.