[PATCH] Support building floating-point facilities on FreeBSD 9.2 in 32-bit mode

Viktor Kutuzov vkutuzov at accesssoftek.com
Mon May 26 04:05:55 PDT 2014


Hi joerg, ddunbar,

http://reviews.llvm.org/D3909

Files:
  lib/builtins/fp_lib.h

Index: lib/builtins/fp_lib.h
===================================================================
--- lib/builtins/fp_lib.h
+++ lib/builtins/fp_lib.h
@@ -26,6 +26,18 @@
 #include <limits.h>
 #include "int_lib.h"
 
+// x86_64 FreeBSD 9.2 and older define fixed-width types incorrectly in
+// 32-bit mode.
+#if defined(__FreeBSD__) && defined(__i386__)
+#include <sys/param.h>
+# if __FreeBSD_version <= 902001  // v9.2
+#  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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3909.9800.patch
Type: text/x-patch
Size: 614 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140526/19922116/attachment.bin>


More information about the llvm-commits mailing list