I have:
 
  1. {$push}
  2. {$packrecords 4}
  3.         MIDIPacket = record
  4.                 timeStamp : MIDITimeStamp;
  5.                 length : UInt16;
  6.                 data : packed array [0..255] of Byte;
  7.         end;
  8.         MIDIPacketPtr = ^MIDIPacket;
  9. {$pop}
  10.  
this structure is 268 bytes long, this is correct


now i have:
 
  1. {$push}
  2. {$packrecords 4}
  3.         MIDIPacketList = record
  4.                 numPackets: UInt32;    
  5.                 packet: array [0..0] of MIDIPacket;
  6.         end;
  7. {$pop}
  8.  
this structure is now 280 byte long!

in the old FPC Trunk 3.3.1 [about half a year ago]
this structure was 272 bytes long, and this is the correct size!
so I can work with a ABI...
 
 
 
NOW!!!!   :
 
If you remove your push/pop then it works.
 
  1. type
  2.   MIDITimeStamp = qword;
  3.  
  4.   //{$push}
  5.   {$packrecords 4}
  6.           MIDIPacket = record
  7.                   timeStamp : MIDITimeStamp;
  8.                   length : UInt16;
  9.                   data : packed array [0..255] of Byte;
  10.           end;
  11.           MIDIPacketPtr = ^MIDIPacket;
  12.   //{$pop}
  13.  
  14.  
  15.   //{$push}
  16.   {$packrecords 4}
  17.           MIDIPacketList = record
  18.                   numPackets: UInt32;
  19.                   packet: array [0..0] of MIDIPacket;
  20.           end;
  21.    //{$pop}
  22.  
  23.  
  24. begin
  25.   writeln('sizeof midi = ', sizeof(MIDIPacket));
  26.   writeln('sizeof list = ', sizeof(MIDIPacketList));
 
 
  1.  
  2.  
  3.  
  4. sizeof midi = 268
  5.  
  6. sizeof list = 272
 
THIS can't be!
 
I thinkt it is an Error in the Compiler
 
 
 
Regards,
 Kirill
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to