Jump to content
  • Advertisement
Sign in to follow this  
derek7

why do this

This topic is 4873 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Doing that simply creates an alias for __stdcall. Allowing you to write STDMETHODCALLTYPE or __stdcall in any place you would use __stdcall. If you have ever wrote a WinMain then you may of used "int WINAPI WinMain(...)", WINAPI is an alias to a calling convention defined in the same was as you have shown.

Basically it's just an alias and there are many reasons for using it. A few reasons could be: Giving it a more descriptive name, Keeping consistant naming in a library of some sort, Personal preference..

Share this post


Link to post
Share on other sites
I think one of the primary reasons is that they can change the calling convention if they ever need to.

_stdcall has a well defined meaning (not sure if it's actually an ISO-C++ keyword tho?) thus they couldn't easily change it.

Conversely, if you have STDMETHODCALLTYPE and everyone uses it, they could change just the one #define and force a recompile and voila! all sorted. Examples of this might be an optimization (or debug) switch or maybe a platform switch (e.g. Win32->Win64)...

hth
Jack

Share this post


Link to post
Share on other sites
Quote:
Original post by jollyjeffers
_stdcall has a well defined meaning (not sure if it's actually an ISO-C++ keyword tho?) thus they couldn't easily change it.

All identifiers starting with double underscores are vendor-specific extensions.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!