I wonder why so many Win API functions determine only their actual implementation in MinGW.
Example:
MessageBox() , as described in the MSDN documenation :
int WINAPI MessageBox( _In_opt_ HWND hWnd, _In_opt_ LPCTSTR lpText, _In_opt_ LPCTSTR lpCaption, _In_ UINT uType );
And here is the implementation of MinGW ( winuser.h ):
#define MessageBox MessageBoxA WINUSERAPI int WINAPI MessageBoxA(HWND,LPCSTR,LPCSTR,UINT);
So MessageBox not a function, it is just a definition for a real function.
Another (taken from winbase.h :
#define GetVersionEx GetVersionExA WINBASEAPI BOOL WINAPI GetVersionExA(LPOSVERSIONINFOA);
As you can see, in most cases functions are implemented as macros for their real implementation.
Is there a reason for this? And why aren't they implemented as "real" functions (using their real name)?
source share