What is the D equivalent to the C __attribute__((packed))
What is the D equivalent to the C __attribute__((packed))
How would you tell the D compiler you want a struct '__attribute__((packed))' ?
Re: What is the D equivalent to the C __attribute__((packed))
Glad to see someone else is interested in D, though I'd advise someone to get really comfortable with the language before starting OSDev with it.
Anyway, alignment is done using the align() attribute. For an entire struct to have packed alignment, you'd do align(1) struct {...}. More info can be found at the D specification site, specifically here.
Hope this helps!
Anyway, alignment is done using the align() attribute. For an entire struct to have packed alignment, you'd do align(1) struct {...}. More info can be found at the D specification site, specifically here.
Hope this helps!
"Sufficiently advanced stupidity is indistinguishable from malice."
Re: What is the D equivalent to the C __attribute__((packed))
Very true, regardless of the language.Zenith wrote:I'd advise someone to get really comfortable with the language before starting OSDev with it.
Every good solution is obvious once you've found it.
Re: What is the D equivalent to the C __attribute__((packed))
Thanks. And yeh I know lol I should have played around with D a little more before jumping into a kernel but...temptation gets you hha.