1 /*============================================================================
2 Kitware Information Macro Library
3 Copyright 2010-2011 Kitware, Inc.
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License for more information.
11 ============================================================================*/
20 static int test_ABI_endian(void)
24 #if defined(@KWIML@_ABI_ENDIAN_ID)
26 union { short s; unsigned char c[sizeof(short)]; } x;
28 expect = (x.c[0] == 1 ?
29 @KWIML@_ABI_ENDIAN_ID_LITTLE : @KWIML@_ABI_ENDIAN_ID_BIG);
30 printf(LANG "@KWIML@_ABI_ENDIAN_ID: expected [%d], got [%d]",
31 expect, @KWIML@_ABI_ENDIAN_ID);
32 if(@KWIML@_ABI_ENDIAN_ID == expect)
42 printf(LANG "@KWIML@_ABI_ENDIAN_ID: unknown, FAILED\n");