home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / crypl200.zip / ENDIAN.C < prev    next >
Text File  |  1996-10-11  |  518b  |  19 lines

  1. /* This is a lowest-common-denominator program which should compile under
  2.    the default cc on any system, no matter how primitite (even the SunOS
  3.    one - note the use of 1970's-vintage octal escapes).  This is necessary
  4.    because it's compiled before we can try and select a decent compiler via
  5.    the makefile */
  6.  
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9.  
  10. int main()
  11.     {
  12.     if( *( long * ) "\200\0\0\0\0\0\0\0" < 0 )
  13.         printf( "-DBIG_ENDIAN" );
  14.     else
  15.         printf( "-DLITTLE_ENDIAN" );
  16.  
  17.     return( 0 );
  18.     }
  19.