This is bitTest.c in view mode; [Download] [Up]
#include <devkit/TokenType.h> #ifdef __BIG_ENDIAN__ struct _Token_w0 { enum TokenType tokenType:8; unsigned posInLine:8; // or high bits for Tok_line, Tok_posInLine unsigned line:16; }; #endif /* __BIG_ENDIAN__ */ #ifdef __LITTLE_ENDIAN__ struct _Token_w0 { unsigned line:16; unsigned posInLine:8; // or high bits for Tok_line, Tok_posInLine enum TokenType tokenType:8; }; #endif struct TokenStruct { struct _Token_w0 w0; union { char *string; int offset; } w1; }; int main() { #ifdef __BIG_ENDIAN__ struct TokenStruct tokenStruct = {{Tok_fileLine, 2, 1}}; #else struct TokenStruct tokenStruct = {{1, 2, Tok_fileLine}, "abc"}; #endif tokenStruct.w1.string = "abc"; return 1; }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.