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

Move cpuid.h -> cpu_id.h #87

Merged
merged 1 commit into from
Jul 14, 2024
Merged

Move cpuid.h -> cpu_id.h #87

merged 1 commit into from
Jul 14, 2024

Conversation

joerowell
Copy link
Contributor

What's this?

This PR fixes a build issue on some platforms (in particular, one of our nodes).

What's the exact issue?

The lookup mechanism for angle-bracketed include directives (i.e. #include <cpuid.h>) is implementation defined. In some settings, the lookup mechanism will search the current directory before any system paths. This can cause build issues for this project that look as follows:

cpuid.h:8:27: error: ‘__cpuid_count’ was not declared in this scope
          8 |   #define CPUID(info, x)  __cpuid_count(x, 0, info[0], info[1], info[2], info[3])
            |                           ^~~~~~~~~~~~~

The reason why is because the #include<cpuid.h> is seemingly including cpuid.h itself (the #pragma once probably guards this in a way that #ifndef wouldn't) and thus the __cpuid_count function is never defined.

It turns out that renaming cpuid.h to cpu_id.h is sufficient to fix the issue.

Signed-off-by: Joe Rowell <[email protected]>
Copy link
Collaborator

@vmarkovtsev vmarkovtsev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: another way to fix was to insert #include_next <cpuid.h> into our cpuid.h.

@vmarkovtsev vmarkovtsev merged commit 98003bf into src-d:master Jul 14, 2024
11 checks passed
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

Successfully merging this pull request may close these issues.

2 participants