Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between __stdcall and _stdcal?

Tags:

visual-c++

What is the difference between __stdcall and _stdcal? And what is logic at all by putting variable counter of _ mark?

like image 400
vico Avatar asked Sep 20 '12 11:09

vico


1 Answers

There is no identifier or keyword named _stdcal. However, the MSVC compiler accepts both _stdcall and __stdcall, one or two underscores.

The single underscore is there because the language specification requires it. Vendor specific identifiers in the global namespace or non-standard keywords must be prefixed by an underscore.

The double underscore is there because a vendor forever loses the battle with programmers that think they should use a leading underscore themselves in their own code. Also present in other non-standard keywords, like __interface and __m128. And in other compilers, like gcc's __attribute__. Clearly you'll want to use the documented version, two underscores.

like image 87
Hans Passant Avatar answered Oct 16 '22 05:10

Hans Passant