__cplusplus
is defined for C++ code. It happens sometimes that you have to mix C code, and C++ code. There can be many reasons for that, e.g. you have a driver written long ago in C that you want to use in your brand new C++0x project.
Every function type and name has a language linkage. There's a difference between C adn C++ functions, since C does not have function names overloading, a function name can serve as a unique identifier in C, but can not in C++. This is called function mangling.
Since you don't need to mangle the name in C, using extern "C"
will make the compiler omit adding the parameter information for linkage.
The C++ standard explicitly states in 7.5 para 3:
Every implementation shall provide for linkage to functions written in
the C programming language, "C", and linkage to C++ functions, "C++".
complex sqrt(complex); //C++ linkage by default
extern "C" {
double sqrt(double);//C linkage
}