If I have SOME_MACRO
which is defined as either __declspec(dllimport)
or __declspec(dllexport)
, is there a way to check at compile time which one is being used?
I.e. something like this:
#if SOME_MACRO == __declspec(dllimport)
// do something
#else
// do something else
#endif
UPD. Looking at the answers I'm getting I guess I should be more specific in why I need this.
I'm trying to compile a rather big 3rd party library, which has a function declared as dllexport
in most parts of their code where it's included. There's however one component in which it's a dllimport
.
I need to modify the declaration slighly for the dllimport
case. The switch between the two declarations is not very simple, it is a result of quite a deep tree of #ifdef
instructions spread across several files. In principle I could dig this info out form these instructions, but to be sure I did it correctly I'd have to try and compile the whole library under several different configurations (each compilation taking a couple hours).
If on the other hand there was a simple way check whether their SOME_MACRO
is evaluated to import or export, I could test this on a small program quickly and safely put that inside the library.