Alien endian-aware types



Word description
Defines a packed struct where endian-unaware types become big-endian types. Note that endian-aware types will override the big-endianness of this struct declaration; little-endian types will stay little-endian. On big-endian platforms, the endian-unaware types will not change since they are the correct endianness already.
! When run on a big-endian platform, this struct should prettyprint the same as defined ! The output of this example is from a little-endian platform USE: alien.endian BE-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 be32 initial: 0 } ;