Archived

This topic is now archived and is closed to further replies.

__Daedalus__

long FAR PASCAL?

Recommended Posts

__Daedalus__    480
Can someone tell me why Jim uses "long FAR PASCAL" as a declaration for his windows message processor, in the book "Programming RPGs with DirectX", as opposed to ... I think: LRESULT CALLBACK WINAPI Is it just a legacy programming thing and Jim showing his age?

Share this post


Link to post
Share on other sites
Sneftel    1788
It''s the same thing. WINAPI CALLBACKs use the PASCAL calling convention. *shrug* it doesn''t matter either way.


But... but that''s what HITLER would say!!

Share this post


Link to post
Share on other sites
pan narrans    1284
Yes, according to my MSDN Library PASCAL is now obsolete, and the WINAPI macro, which translates to the appropriate calling convention for the target, is used instead.

I think it was just an oversight on Jim''s part. Someone correct me if I am wrong.


pan narrans | My Website | Study + Hard Work + Loud Profanity = Good Code

Share this post


Link to post
Share on other sites
Colin Jeanne    1114
quote:
Original post by Pipo DeClown
What does FAR mean?



It used to mean that the pointer was a far pointer (as opposed to a near pointer). Far pointers had a longer address than near pointers on 16 bit OSes (IIRC, far pointers were 32 bits while near pointers were 16 bits). These conventions are obsolete in Win32 and the windef.h defines NEAR and FAR now evaluate to empty strings (and thus are ignored).

500x4



Qui fut tout, et qui ne fut rien
Invader''s Realm

Share this post


Link to post
Share on other sites