From cc02abbb20df1b12ebe5609b9575e9f62b27baf9 Mon Sep 17 00:00:00 2001 From: Viktor Kutuzov Date: Tue, 8 Jul 2014 08:52:57 +0000 Subject: [PATCH] Support building floating-point facilities on FreeBSD 9.2 in 32-bit mode Differential Revision: http://reviews.llvm.org/D3909 llvm-svn: 212518 --- compiler-rt/lib/builtins/fp_lib.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/compiler-rt/lib/builtins/fp_lib.h b/compiler-rt/lib/builtins/fp_lib.h index 7b905181c93f..faebb99ecd5e 100644 --- a/compiler-rt/lib/builtins/fp_lib.h +++ b/compiler-rt/lib/builtins/fp_lib.h @@ -26,6 +26,18 @@ #include #include "int_lib.h" +// x86_64 FreeBSD prior v9.3 define fixed-width types incorrectly in +// 32-bit mode. +#if defined(__FreeBSD__) && defined(__i386__) +# include +# if __FreeBSD_version < 903000 // v9.3 +# define uint64_t unsigned long long +# define int64_t long long +# undef UINT64_C +# define UINT64_C(c) (c ## ULL) +# endif +#endif + #if defined SINGLE_PRECISION typedef uint32_t rep_t;