Search code examples
winapisetupapi

why is LogSeverity #defined as DWORD in windows SetupAPI


I see this #define in windows kit 10 SetupAPI.h in line 4871

#define LogSeverity DWORD

So I can't do something like

typedef int LogSeverity

This effectively makes LogSeverity like a reserved keyword if I dont want to redefine DWORD. Am I missing something here?


Solution

  • The windows API has a huge number of such identifiers, what I actually find surprising about this case is that it's a #define and not a typedef. Although with it being a define it does give you the option of #undefing it after the include in question. Although I would likely just accept that it is an already used identifier and choose another name for whatever I was creating.

    'Why' questions of this form generally don't have answers, only workarounds.

    #include <setupapi.h>
    #undef LogSeverity