Purpose of uppercase VOID macro & INT typedef in winnt.h

Viewed 3649

Anyone any clue as to why there is an uppercase VOID macro defined in the winnt.h header?

To make matters more confusing, VOID is a macro, whereas CHAR, SHORT, INT, and LONG are typedefs.

See the relevant excerpt from winnt.h:

#ifndef VOID
#define VOID void
typedef char CHAR;
typedef short SHORT;
typedef long LONG;
#if !defined(MIDL_PASS)
typedef int INT;
#endif
#endif

A historical reason perhaps for doing VOID* pointer instead of void* pointer?

EDIT: What is even more troubling is to see people using VOID instead of void when doing Windows programming today. You can also see it as part of MSDN docs, e.g. http://msdn.microsoft.com/en-us/library/bb205867(v=vs.85).aspx

2 Answers
Related