Sys.Signals module for a Variant type of signals (and a set_signal function that...
[ocaml.git] / config / auto-aux / endian.c
blobdef617f0f5c0fcd1be2c45c09df4174119cab485
1 /***********************************************************************/
2 /* */
3 /* Objective Caml */
4 /* */
5 /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
6 /* */
7 /* Copyright 1996 Institut National de Recherche en Informatique et */
8 /* en Automatique. All rights reserved. This file is distributed */
9 /* under the terms of the GNU Library General Public License, with */
10 /* the special exception on linking described in file ../../LICENSE. */
11 /* */
12 /***********************************************************************/
14 /* $Id$ */
16 #include "m.h"
18 #ifndef ARCH_SIXTYFOUR
19 long intval = 0x41424344L;
20 char * bigendian = "ABCD";
21 char * littleendian = "DCBA";
22 #else
23 long intval = 0x4142434445464748L;
24 char * bigendian = "ABCDEFGH";
25 char * littleendian = "HGFEDCBA";
26 #endif
28 main(void)
30 long n[2];
31 char * p;
33 n[0] = intval;
34 n[1] = 0;
35 p = (char *) n;
36 if (strcmp(p, bigendian) == 0)
37 exit(0);
38 if (strcmp(p, littleendian) == 0)
39 exit(1);
40 exit(2);