diff options
author | Edward O'Callaghan <eocallaghan@auroraux.org> | 2009-08-05 19:06:50 +0000 |
---|---|---|
committer | Edward O'Callaghan <eocallaghan@auroraux.org> | 2009-08-05 19:06:50 +0000 |
commit | 1fcb40b79d8fbfcc9acb0966d5f9bba09431f832 (patch) | |
tree | fce65563d921b10e2ee3780b17a6b020e61afccf /lib/int_lib.h | |
parent | 2bf62728b8ce00e295c7bf0fb328427496cc85aa (diff) | |
download | compiler-rt-1fcb40b79d8fbfcc9acb0966d5f9bba09431f832.tar.gz compiler-rt-1fcb40b79d8fbfcc9acb0966d5f9bba09431f832.tar.bz2 compiler-rt-1fcb40b79d8fbfcc9acb0966d5f9bba09431f832.tar.xz |
Next batch of C++ to C comment style changes. Also improve and factor out endianness pre-processor code.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@78226 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/int_lib.h')
-rw-r--r-- | lib/int_lib.h | 47 |
1 files changed, 1 insertions, 46 deletions
diff --git a/lib/int_lib.h b/lib/int_lib.h index 6ef7b8e3..2557244c 100644 --- a/lib/int_lib.h +++ b/lib/int_lib.h @@ -20,58 +20,13 @@ /* Assumption: right shift of signed negative is arithmetic shift */ #include <limits.h> +#include "endianness.h" #include <math.h> #if !defined(INFINITY) && defined(HUGE_VAL) #define INFINITY HUGE_VAL #endif -/* TODO: Improve this to minimal pre-processor hackish'ness. */ -#if defined (__SVR4) && defined (__sun) -/* config.h build via CMake. */ -/* #include <config.h> */ - -/* Solaris header for endian and byte swap */ -/* #if defined HAVE_SYS_BYTEORDER_H */ -#include <sys/byteorder.h> - -/* Solaris defines endian by setting _LITTLE_ENDIAN or _BIG_ENDIAN */ -#ifdef _BIG_ENDIAN -# define IS_BIG_ENDIAN -#endif -#ifdef _LITTLE_ENDIAN -# define IS_LITTLE_ENDIAN -#endif - -#ifdef IS_BIG_ENDIAN -#define __BIG_ENDIAN__ 1 -#define __LITTLE_ENDIAN__ 0 -#endif -#ifdef IS_LITTLE_ENDIAN -#define __BIG_ENDIAN__ 0 -#define __LITTLE_ENDIAN__ 1 -#endif - -#endif /* End of Solaris ifdef. */ - -#ifdef __LITTLE_ENDIAN__ -#if __LITTLE_ENDIAN__ -#define _YUGA_LITTLE_ENDIAN 1 -#define _YUGA_BIG_ENDIAN 0 -#endif -#endif - -#ifdef __BIG_ENDIAN__ -#if __BIG_ENDIAN__ -#define _YUGA_LITTLE_ENDIAN 0 -#define _YUGA_BIG_ENDIAN 1 -#endif -#endif - -#if !defined(_YUGA_LITTLE_ENDIAN) || !defined(_YUGA_BIG_ENDIAN) -#error unable to determine endian -#endif - typedef int si_int; typedef unsigned su_int; |