LE-PACKED-STRUCT:
Alien endian-aware types

Prev:BE-STRUCT:
Next:BE-PACKED-STRUCT:


Vocabulary
alien.endian

Word description
Defines a packed struct where endian-unaware types become little-endian types. Note that endian-aware types will override the little-endianness of this struct declaration; big-endian types will stay big-endian. On little-endian platforms, the endian-unaware types will not change since they are the correct endianness already.
! When run on a little-endian platform, this struct should prettyprint the same as defined ! The output of this example is from a little-endian platform USE: alien.endian LE-PACKED-STRUCT: s1 { a char[7] } { b int } ; \ s1 see
USING: alien.c-types alien.endian classes.struct ; IN: scratchpad STRUCT: s1 { a char[7] } { b int initial: 0 } ;


Definition