Saurabh
Saurabh

Reputation: 1065

Managed type/wrapper for extern keyword

I am writing a managed wrapper for a 3rd party API and I have access to only their header files and .lib file. In one of the header files there is a function:

extern "C" void functionName(unsigned int param);

To wrap this function, I can ignore the extern keyword right? It is just to tell the compiler to treat the declaration as if it were made in C, rather than C++ and I guess this shouldn't be an issue when writing a managed wrapper using C++/CLI?

Upvotes: 0

Views: 840

Answers (1)

bobbymcr
bobbymcr

Reputation: 24177

Using extern "C" in a function declaration specifies C linkage for the function (i.e. no name mangling); see here: In C++ source, what is the effect of extern "C"? . It should not adversely affect a C++/CLI caller.

Upvotes: 1

Related Questions