UninterpretedBytes.st
changeset 3936 dd8cd28d4a9b
parent 3459 6cb151c3950c
child 4019 c9284ca27a4a
equal deleted inserted replaced
3935:1ab1b3f72222 3936:dd8cd28d4a9b
   148      byte first (MSB), false if least-sign.-first (LSB). 
   148      byte first (MSB), false if least-sign.-first (LSB). 
   149      I.e. false for vax, intel; true for m68k, sun."
   149      I.e. false for vax, intel; true for m68k, sun."
   150 
   150 
   151 %{  /* NOCONTEXT */
   151 %{  /* NOCONTEXT */
   152 
   152 
       
   153 #ifdef __MSBFIRST
       
   154     RETURN (true);
       
   155 #else
   153     /*
   156     /*
   154      * I dont like ifdefs - you always forget some ...
   157      * I dont like ifdefs - you always forget some ...
   155      * therefore we look into a structure at run-time.
   158      * therefore we look into a structure at run-time.
   156      * (also, there are CPUs around [mips], where the byteorder
   159      * (also, there are CPUs around [mips], where the byteorder
   157      *  is programmable, and which come in different flavours)
   160      *  is programmable, and which come in different flavours)
   166     } u;
   169     } u;
   167 
   170 
   168     u.u_l = 0x87654321;
   171     u.u_l = 0x87654321;
   169     if (u.u_c[0] == 0x21) RETURN (false);
   172     if (u.u_c[0] == 0x21) RETURN (false);
   170     RETURN (true);
   173     RETURN (true);
       
   174 #endif
   171 %}
   175 %}
   172     "
   176     "
   173      UninterpretedBytes isBigEndian
   177      UninterpretedBytes isBigEndian
   174     "
   178     "
   175 !
   179 !
  1952 ! !
  1956 ! !
  1953 
  1957 
  1954 !UninterpretedBytes class methodsFor:'documentation'!
  1958 !UninterpretedBytes class methodsFor:'documentation'!
  1955 
  1959 
  1956 version
  1960 version
  1957     ^ '$Header: /cvs/stx/stx/libbasic/UninterpretedBytes.st,v 1.30 1998-05-18 12:20:27 cg Exp $'
  1961     ^ '$Header: /cvs/stx/stx/libbasic/UninterpretedBytes.st,v 1.31 1998-11-24 17:04:36 cg Exp $'
  1958 ! !
  1962 ! !
  1959 UninterpretedBytes initialize!
  1963 UninterpretedBytes initialize!