Re: how to declare C's static function?

2016-03-28 Thread aki via Digitalmars-d-learn
On Tuesday, 29 March 2016 at 01:04:50 UTC, Mike Parker wrote: On Monday, 28 March 2016 at 14:40:40 UTC, Adam D. Ruppe wrote: On Monday, 28 March 2016 at 04:53:19 UTC, aki wrote: So... You mean there are no way to declare functions without exporting the symbol? alas, no, even if it is private

Re: how to declare C's static function?

2016-03-28 Thread Mike Parker via Digitalmars-d-learn
On Monday, 28 March 2016 at 14:40:40 UTC, Adam D. Ruppe wrote: On Monday, 28 March 2016 at 04:53:19 UTC, aki wrote: So... You mean there are no way to declare functions without exporting the symbol? alas, no, even if it is private it can conflict on the outside (so stupid btw). Seems to

Re: how to declare C's static function?

2016-03-28 Thread aki via Digitalmars-d-learn
On Monday, 28 March 2016 at 14:40:40 UTC, Adam D. Ruppe wrote: On Monday, 28 March 2016 at 04:53:19 UTC, aki wrote: So... You mean there are no way to declare functions without exporting the symbol? alas, no, even if it is private it can conflict on the outside (so stupid btw). Is it all

Re: how to declare C's static function?

2016-03-28 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 28 March 2016 at 04:53:19 UTC, aki wrote: So... You mean there are no way to declare functions without exporting the symbol? alas, no, even if it is private it can conflict on the outside (so stupid btw). Is it all the same function being referenced? Just importing from there

Re: how to declare C's static function?

2016-03-28 Thread Jacob Carlborg via Digitalmars-d-learn
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? Can you declare the function as "package" in one module and import it into the other module? -- /Jacob Carlborg

Re: how to declare C's static function?

2016-03-27 Thread aki via Digitalmars-d-learn
On Monday, 28 March 2016 at 04:33:06 UTC, Rikki Cattermole wrote: You have two choices. Change the name in code (so manual mangling) or use pragma(mangle, ...) to change it instead. So... You mean there are no way to declare functions without exporting the symbol? There are so many instances

Re: how to declare C's static function?

2016-03-27 Thread Rikki Cattermole via Digitalmars-d-learn
On Monday, 28 March 2016 at 04:27:27 UTC, aki wrote: On Monday, 28 March 2016 at 04:12:56 UTC, Rikki Cattermole wrote: Do you need it to use extern(C)? Because if you don't, just drop that. D's mangling will fix it. Yes, I do need extern(C) for some reason like: alias Hook = extern(C) void

Re: how to declare C's static function?

2016-03-27 Thread aki via Digitalmars-d-learn
On Monday, 28 March 2016 at 04:12:56 UTC, Rikki Cattermole wrote: Do you need it to use extern(C)? Because if you don't, just drop that. D's mangling will fix it. Yes, I do need extern(C) for some reason like: alias Hook = extern(C) void function(); void sethook(Hook func) { ... } ...

Re: how to declare C's static function?

2016-03-27 Thread Rikki Cattermole via Digitalmars-d-learn
Do you need it to use extern(C)? Because if you don't, just drop that. D's mangling will fix it.

how to declare C's static function?

2016-03-27 Thread aki via Digitalmars-d-learn
ompilation unit. In D, the function foo() above conflicts even if it is private. How can I declare C's static function? Regards, Aki.