When building a shared library, you must (Windows) / can (Linux) decide which classes/functions/variables are exported, and which are not. For example, on Windows, you must use the __declspec(dllexport) keyword in front of everything that you want to export. But when you want to use the compiled library, you have to use a different keyword, __declspec(dllimport), because you import the class/function/variables from the DLL.
So, as the keyword can change according to the platform, and according to whether you build or use the library, it's hidden behind a macro. All the magic stuff with lots of preprocessor expressions is done in the definition of the macro.