-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fix compilation error for old version of GCC #48
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a tiny note, but overall it LGTM, thanks for looking into this!
ddcommon-ffi/cbindgen.toml
Outdated
@@ -22,12 +22,23 @@ after_includes = """ | |||
/* NOTE: Compilation fails if you pass in a char* instead of a literal */ ((ddog_CharSlice){ .ptr = "" string, .len = sizeof(string) - 1 }) | |||
#endif | |||
|
|||
#if defined __GNUC__ | |||
# define DDOG_GNUC_VERSION(major) __GNUC__ >= 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
major
never gets used -- was the intention to use __GNUC__ >= major
in the macro? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yeah, good one. Will fix it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 114ba3c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, attribute fences seems like a good fix--thank you!
# define DDOG_GNUC_VERSION(major) (0) | ||
#endif | ||
|
||
#if defined __has_attribute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very reasonable--nice!
What does this PR do?
This PR fixes the C/C++ macro in the common.h file.
Motivation
This PR fixes the issue #47 for old GCC version.
How to test the change?
What I have done to validate the fix:
common.h
with a newer version of GCC (10.2.1)common.h
(what you have in the fix)