简体   繁体   English

从C转换为Delphi:结构字段对齐

[英]Translate from C to Delphi : struct fields align

Please help me, how I can do this in delphi? 请帮助我,如何在delphi中做到这一点? thanks. 谢谢。

struct x
{
uint32 a : 32;
unsigned int b : 20;
unsigned int c : 4;
};

that struct uses a C feature called bitfields where integers can have widths of fractional bytes. 该结构使用一种称为位域的C功能,其中整数可以具有小数字节的宽度。 bitfields are not available in Delphi, see this answers to this question for details of how to do it using an object 位域在Delphi中不可用,有关如何使用对象执行此操作的详细信息,请参见此问题的答案

How to simulate bit-fields in Delphi records? 如何在Delphi记录中模拟位域?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM