'How can I check whether a function is extern-C?

In C++, can I check whether a certain function has been declared "extern C" or not?

  • I don't mind checks restricted to the current translation unit.
  • I'd like to check this at compile-time, but if this is somehow possible only at run-time, that's useful too.
  • Non-standard, compiler-extension-based solutions are relevant.


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source