Some technically flawed operating systems may require usage of
some non-standard keywords in order to define certain
attributes of classes that must be specified in order to get
the wanted results.
Such OS's must be pretty rare, because I've not encountered
them. I've relatively little experience outside the Windows and
Unix worlds, but it's certainly not the case for Windows,
Solaris, AIX, HP-UX or Linux.
Different OS's do handle public declarations differently, and
Windows gives you a much finer granularity in managing what's
visible in a dynamically loaded object. (This is one place
where Windows is actually superior to Unix.) Which means that
you must somehow tell the program which builds the dynamic
object which symbols are exported, and which aren't. I believe
that some Windows compilers have an extension which allows doing
this in source code; I can imagine that in something like a GUI
library, such an extension might be very pratical, but I've
never really needed (or used) it for the DLL's I've written for
Windows; they typically only export a few symbols, so it's
easier to just tell the linker directly. (Actually, since you
have to give the linker the mangled name, I use a small script
to extract the mangled name from the object files. It's rather
easy to adapt the script to export individual functions, entire
classes, or only the public parts, or an entire namespace. In
my case, I usually export an entire namespace, but only from one
of the object files---a fassade---in the DLL. Or I export
nothing at all---the constructor of a static object registers
everything necessary with the global registry.)
Your library's configuration script will install the
appropriate definition of this macro, when your library is
installed on that particular operating system.
It's trickier than that, I think. If you do use the compiler
extensions, you need to define the macro differently when
compiling the code going into the dynamic object, than when
compiling it in code which uses the dynamic object. (This is
the main reason why I avoid such extensions.)