I’m having issues with Vala adding padding to struct values. Is there an equivalent to C’s #pragma pack(1) or C#’s [StructLayout(LayoutKind.Sequential, Pack=1)], or possibly a workaround for this? Thanks in advance.
~ Michael K.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not natively. You can define your packed structure in a separate C header file with the appropriate
#pragmaor__attribute__and then create a VAPI binding for it.It might be possible to abuse Vala’s code generation to do it (e.g., set the
[CCode(cname)]], but I would advise against it.