-
-
Notifications
You must be signed in to change notification settings - Fork 421
importc: add alignof macro #3840
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request and interest in making D better, @ryuukk! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + druntime#3840" |
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.
Going off the link you gave, _Alignof
is C11, and alignof
is a convenience macro in stdalign.h
. However, you add alignof
directy to importc.h. I think that should be _Alignof
, alignof
should only work when stdalign.h
is included.
Done, i also added |
it seems dmd already handles this https://github.com/dlang/dmd/blob/master/src/dmd/cparse.d#L900 please determine if this is still needed (e.g. for |
I might have an outdated version of dmd, i'll try with latest master changes |
@ryuukk any progress? |
Adding the |
/**************************** | ||
* Define it to do what other C compilers do. | ||
*/ | ||
#define _Alignof(type) __builtin_offsetof(struct { char c; type member; }, member) |
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.
Remove this
It's valid C11: https://en.cppreference.com/w/c/language/_Alignof