Linked by umad on Thu 25th Aug 2011 22:51 UTC
Thread beginning with comment 487019
To view parent comment, click here.
To read all comments associated with this story, please click here.
To view parent comment, click here.
To read all comments associated with this story, please click here.
And that's the reason Win32's calling convention is PASCAL: the original Mac toolbox was written in Pascal
Except its not... Win32's calling convention is stdcall and always has been.
Maybe you meant the 16-bit Windows API? Yes, this used pascal cc, but so did OS/2 and virtually every other 16-bit api on x86 at the time, and it certainly was not because of the ridiculous notion they were trying to be compatible with the Mac toolbox. Besides, Windows 1.0 was written in a mixture of assembly and C - Microsoft almost never used Pascal for development.
Hint: Using pascal calling convention has nothing at all to do with the Pascal language or compatibility with it - it was used because it was slightly faster than cdecl and more importantly it resulted in saving a few bytes of overhead relative to cdecl at every call point. The only thing you really lose is the ability to have optional parameters, but for most well designed APIs optional parameters are something you actively avoid.




Member since:
2006-03-20
And that's the reason Win32's calling convention is PASCAL: the original Mac toolbox was written in Pascal:
http://hintsforums.macworld.com/archive/index.php/t-97075.html