[D-runtime] [D-Programming-Language/druntime] eddc04: Merge branch 'master' of git://github.com/ibuclaw/...

Walter Bright walter at digitalmars.com
Sun Feb 6 23:27:07 PST 2011



Jonathan M Davis wrote:
> It makes it _really_ annoying when writing cross-platform code in C++, since 
> often the function is on both Linux and Windows and does exactly the same thing 
> on both except that for some reason Microsoft decided to put an underscore on 
> the front of it. So, you end up having to write wrapper functions all over the 
> place if you don't want your code to have #ifdef WIN32 and the like spread 
> throughout.
>
>   

The "some reason" is so that you can write assembler code that can call 
any C function. Without the leading _, any C function that has the same 
spelling as a macro assembler pseudo-op or register will fail to assemble.

Linux avoided that problem by having a really ugly asm syntax that won't 
conflict with C names. Linux assembler format really sucks all the joy 
out of writing in assembler.


More information about the D-runtime mailing list