Re: checking for endian-ness?

From: Julian Fong (c8h1@ugrad.cs.ubc.ca)
Date: 01/05/96


On Fri, 5 Jan 1996, Carl Tashian wrote:

> has anyone implemented code in circle to keep up with the endian-ness of the
> machine it's running on? It'd be neat, for example, to have a binary
> playerfile automatically convert itself when it goes between big- and
> little-endian machines.. :)

This would do the trick.

int end_type ()
{
  return (*(short *) "IM") & 255;
}



This archive was generated by hypermail 2b30 : 12/07/00 PST