On 7 Mar 2005 at 8:11, Rick Engebretson wrote:
Rick Engebretson wrote:
[...]
But one irony comes to mind. Early Windows(eg; 3.0) passed "pascal parameters" to C lib functions and required their declaration as such. So we have come full circle.
To quote from "Charles Petzold; Programming Windows 3.1," 1992, Microsoft Press, page 12.
/* You use these Windows functions in your Windows program the same way you use C library functions such as "strlen." However, there are some differences between the Windows functions and the standard C library functions. Windows functions are always declared as "far pascal" functions. The "far" keyword... The "pascal" keyword indicates the functions calling sequence is different than the normal C calling sequence. ... The "pascal" calling sequence is used in Windows because it is more efficient.*/
I don't know if later Windows is the same or not.
Win32 API functions mainly use the stdcall convention. But while this is an interesting discussion, none of this is what I was referring to in my original mail ;-). I was talking about gcc's (and now GPC's) ability to pass an arbitrary number of parameters to certain function pointers.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/