I have a struct I need to port from C but the size I’m getting in Pascal is 
wrong. From C sizeof(AAPLVertex) = 32 but in Pascal sizeof(AAPLVertex) = 24.

The alignment of the struct is on 32 bit bounds I think but how do I replicate 
this in Pascal so it behaves exactly like c? I tried using $align but it didn’t 
seem to have any effect.

{$align 32}
type
        TAAPLVertex = packed record
                position: vector_float2;
                color: vector_float4;
        end;


typedef struct
{
    vector_float2 position;
    vector_float4 color;
} AAPLVertex;


Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to