how to declare C's static function?

aki via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Mar 27 21:02:34 PDT 2016


Hello,

When I porting legacy app. written in C to D,
I have a problem.

file a.d:
extern (C) private void foo() {}

file b.d:
extern (C) private void foo() {}

  Error 1: Previous Definition Different : _foo

In C language, "static void foo(){}" does not
export the symbol out side the compilation unit.
In D, the function foo() above conflicts even if
it is private. How can I declare C's static function?

Regards,
Aki.



More information about the Digitalmars-d-learn mailing list