How do I solve this kind of conflict?

Adam D. Ruppe destructionator at gmail.com
Sun Jan 21 19:07:14 UTC 2018


On Sunday, 21 January 2018 at 16:22:33 UTC, Marc wrote:
> But libraries has this defined:
>
>> extern(C) int callback(void*, int, char** , char**){

Just rename one of the functions. It is really bad form to have 
extern(C) functions have a common word like this exactly because 
they share a namespace and make conflicts likely.

I'd name one like `callback_lib_name` and the other 
`callback_other_lib`. You might even be able to do `alias 
callback = callback_lib_name;` after the definition to keep all 
the D code compiling with no other changes.



More information about the Digitalmars-d-learn mailing list