Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

c++ syntax question

Name: Anonymous 2012-02-20 2:14

Hi /prog
When working with some other C++ libraries, I often see a class declaration like so:

class LIBRARYNAME_API ClassName
{};

Could someone please explain what the "LIBRARYNAME_API" part actually does?

Name: Anonymous 2012-02-20 5:55

>>1

When I've seen this used, it was a macro that expands to something that tells the linker to treat the symbol in some special way, like including the symbol and allowing it to be accessed from outside the library, or not including the symbol, making it accessibly only to other functions defined within the library. This is what happens when a language fails to provide a better way to manage such things, either as a built in future, or with a sufficiently powerful macro system.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List