Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error in ndis.h #665

Open
johngladp opened this issue Nov 1, 2021 · 0 comments
Open

Compilation error in ndis.h #665

johngladp opened this issue Nov 1, 2021 · 0 comments

Comments

@johngladp
Copy link

Note: Not sure where else to report this issue to Microsoft?

When using clang-tidy to validate code in a project that includes ndis.h the following clang error is reported:

C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\ndis.h(428,6): error GC68FF2EE: invalid suffix 'xNDIS_MINIPORT_MAJOR_VERSION' on integer constant [clang-diagnostic-error]
#if !NDIS_API_VERSION_AVAILABLE(NDIS_MINIPORT_MAJOR_VERSION, NDIS_MINIPORT_MINOR_VERSION)
^
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\ndis.h:355:53: note: expanded from macro 'NDIS_API_VERSION_AVAILABLE'
#define NDIS_API_VERSION_AVAILABLE(major,minor) ((((0x ## major) << 8) + (0x ## minor)) >= NDIS_MIN_API)

This appears to be caused by a C pre-processor issue.

This can be fixed by changing the NDIS_API_VERSION_AVAILABLE macro as follows:
#define NDIS_CONCAT(x, y) x ## y
#define NDIS_API_VERSION_AVAILABLE(major,minor) ((((NDIS_CONCAT(0x, major)) << 8) + (NDIS_CONCAT(0x,minor))) >= NDIS_MIN_API)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant