<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jul 10, 2014 at 1:43 AM, Viktor Kutuzov <span dir="ltr"><<a href="mailto:vkutuzov@accesssoftek.com" target="_blank">vkutuzov@accesssoftek.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Author: vkutuzov<br>
Date: Thu Jul 10 03:43:39 2014<br>
New Revision: 212689<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=212689&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=212689&view=rev</a><br>
Log:<br>
Add clang headers that fix machine-dependent definitions on FreeBSD 9.2<br></blockquote><div><br></div><div>This change has broken Darwin:</div><div><br></div><div><a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-July/038129.html">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-July/038129.html</a><br>
</div><div><br></div><div>Please revert for now, and we can discuss a way to get this to work for both platforms.</div><div><br></div><div>I'm also not sure why this patch makes any sense: it seems you're trying to work around FreeBSD's broken /usr/include files? That doesn't seem like something we should be doing to me, but maybe I'm missing some background here?</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Differential Revision: <a href="http://reviews.llvm.org/D3908" target="_blank">http://reviews.llvm.org/D3908</a><br>
<br>
Added:<br>
cfe/trunk/lib/Headers/machine/<br>
cfe/trunk/lib/Headers/machine/_stdint.h<br>
cfe/trunk/lib/Headers/machine/_types.h<br>
Modified:<br>
cfe/trunk/lib/Headers/CMakeLists.txt<br>
<br>
Modified: cfe/trunk/lib/Headers/CMakeLists.txt<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/CMakeLists.txt?rev=212689&r1=212688&r2=212689&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/CMakeLists.txt?rev=212689&r1=212688&r2=212689&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Headers/CMakeLists.txt (original)<br>
+++ cfe/trunk/lib/Headers/CMakeLists.txt Thu Jul 10 03:43:39 2014<br>
@@ -1,4 +1,6 @@<br>
set(files<br>
+ machine/_stdint.h<br>
+ machine/_types.h<br>
altivec.h<br>
ammintrin.h<br>
arm_acle.h<br>
<br>
Added: cfe/trunk/lib/Headers/machine/_stdint.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/machine/_stdint.h?rev=212689&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/machine/_stdint.h?rev=212689&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Headers/machine/_stdint.h (added)<br>
+++ cfe/trunk/lib/Headers/machine/_stdint.h Thu Jul 10 03:43:39 2014<br>
@@ -0,0 +1,71 @@<br>
+/*===---- _stdint.h - C99 type-related definitions on FreeBSD -------------===*\<br>
+ *<br>
+ * Permission is hereby granted, free of charge, to any person obtaining a copy<br>
+ * of this software and associated documentation files (the "Software"), to deal<br>
+ * in the Software without restriction, including without limitation the rights<br>
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br>
+ * copies of the Software, and to permit persons to whom the Software is<br>
+ * furnished to do so, subject to the following conditions:<br>
+ *<br>
+ * The above copyright notice and this permission notice shall be included in<br>
+ * all copies or substantial portions of the Software.<br>
+ *<br>
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br>
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br>
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br>
+ * THE SOFTWARE.<br>
+ *<br>
+\*===----------------------------------------------------------------------===*/<br>
+<br>
+#ifndef __MACHINE_XSTDINT_H<br>
+#define __MACHINE_XSTDINT_H<br>
+<br>
+#include_next <machine/_stdint.h><br>
+<br>
+/* Fix some definitions on x86-64 FreeBSD 9.2 in 32-bit mode. */<br>
+#if defined(__FreeBSD__) && defined(__i386__)<br>
+# include <osreldate.h><br>
+# if __FreeBSD_version <= 902001 // v9.2<br>
+# if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)<br>
+# undef INT64_C<br>
+# define INT64_C(c) (c ## LL)<br>
+<br>
+# undef UINT64_C<br>
+# define UINT64_C(c) (c ## ULL)<br>
+# endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */<br>
+<br>
+# if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)<br>
+# undef INT64_MIN<br>
+# define INT64_MIN (-0x7fffffffffffffffLL-1)<br>
+<br>
+# undef INT64_MAX<br>
+# define INT64_MAX 0x7fffffffffffffffLL<br>
+<br>
+# undef UINT64_MAX<br>
+# define UINT64_MAX 0xffffffffffffffffULL<br>
+<br>
+# undef INTPTR_MIN<br>
+# define INTPTR_MIN INT32_MIN<br>
+<br>
+# undef INTPTR_MAX<br>
+# define INTPTR_MAX INT32_MAX<br>
+<br>
+# undef UINTPTR_MAX<br>
+# define UINTPTR_MAX UINT32_MAX<br>
+<br>
+# undef PTRDIFF_MIN<br>
+# define PTRDIFF_MIN INT32_MIN<br>
+<br>
+# undef PTRDIFF_MAX<br>
+# define PTRDIFF_MAX INT32_MAX<br>
+<br>
+# undef SIZE_MAX<br>
+# define SIZE_MAX UINT32_MAX<br>
+# endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */<br>
+# endif /* __FreeBSD_version <= 902001 */<br>
+#endif /* defined(__FreeBSD__) && defined(__i386__) */<br>
+<br>
+#endif /* !__MACHINE_XSTDINT_H */<br>
<br>
Added: cfe/trunk/lib/Headers/machine/_types.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/machine/_types.h?rev=212689&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/machine/_types.h?rev=212689&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Headers/machine/_types.h (added)<br>
+++ cfe/trunk/lib/Headers/machine/_types.h Thu Jul 10 03:43:39 2014<br>
@@ -0,0 +1,145 @@<br>
+/*===---- _types.h - Machine-dependent type definitions on FreeBSD --------===*\<br>
+ *<br>
+ * Permission is hereby granted, free of charge, to any person obtaining a copy<br>
+ * of this software and associated documentation files (the "Software"), to deal<br>
+ * in the Software without restriction, including without limitation the rights<br>
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br>
+ * copies of the Software, and to permit persons to whom the Software is<br>
+ * furnished to do so, subject to the following conditions:<br>
+ *<br>
+ * The above copyright notice and this permission notice shall be included in<br>
+ * all copies or substantial portions of the Software.<br>
+ *<br>
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br>
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br>
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br>
+ * THE SOFTWARE.<br>
+ *<br>
+\*===----------------------------------------------------------------------===*/<br>
+<br>
+#ifndef __MACHINE_XTYPES_H<br>
+#define __MACHINE_XTYPES_H<br>
+<br>
+/* Fix some definitions on x86-64 FreeBSD 9.2 in 32-bit mode. */<br>
+#if defined(__FreeBSD__) && defined(__i386__)<br>
+# include <osreldate.h><br>
+# if __FreeBSD_version <= 902001 // v9.2<br>
+# define __FIX_FREEBSD_9_2_DEFINITIONS<br>
+# endif /* __FreeBSD_version <= 902001 */<br>
+#endif /* defined(__FreeBSD__) && defined(__i386__) */<br>
+<br>
+#if defined(__FIX_FREEBSD_9_2_DEFINITIONS)<br>
+#define __int64_t __broken_int64_t<br>
+#define __uint64_t __broken_uint64_t<br>
+#define __critical_t __broken_critical_t<br>
+#define __intfptr_t __broken_intfptr_t<br>
+#define __intptr_t __broken_intptr_t<br>
+#define __intmax_t __broken_intmax_t<br>
+#define __int_fast64_t __broken_int_fast64_t<br>
+#define __int_least64_t __broken_int_least64_t<br>
+#define __ptrdiff_t __broken_ptrdiff_t<br>
+#define __register_t __broken_register_t<br>
+#define __segsz_t __broken_segsz_t<br>
+#define __size_t __broken_size_t<br>
+#define __ssize_t __broken_ssize_t<br>
+#define __time_t __broken_time_t<br>
+#define __uintfptr_t __broken_uintfptr_t<br>
+#define __uintptr_t __broken_uintptr_t<br>
+#define __uintmax_t __broken_uintmax_t<br>
+#define __uint_fast64_t __broken_uint_fast64_t<br>
+#define __uint_least64_t __broken_uint_least64_t<br>
+#define __u_register_t __broken_u_register_t<br>
+#define __vm_offset_t __broken_vm_offset_t<br>
+#define __vm_paddr_t __broken_vm_paddr_t<br>
+#define __vm_size_t __broken_vm_size_t<br>
+#define __vm_ooffset_t __broken_vm_ooffset_t<br>
+#define __vm_pindex_t __broken_vm_pindex_t<br>
+#endif // defined(__FIX_FREEBSD_9_2_DEFINITIONS)<br>
+<br>
+#include_next <machine/_types.h><br>
+<br>
+#if defined(__FIX_FREEBSD_9_2_DEFINITIONS)<br>
+#undef __int64_t<br>
+typedef long long __int64_t;<br>
+<br>
+#undef __uint64_t<br>
+typedef unsigned long long __uint64_t;<br>
+<br>
+#undef __critical_t<br>
+typedef __int32_t __critical_t;<br>
+<br>
+#undef __intfptr_t<br>
+typedef __int32_t __intfptr_t;<br>
+<br>
+#undef __intptr_t<br>
+typedef __int32_t __intptr_t;<br>
+<br>
+#undef __intmax_t<br>
+typedef __int64_t __intmax_t;<br>
+<br>
+#undef __int_fast64_t<br>
+typedef __int64_t __int_fast64_t;<br>
+<br>
+#undef __int_least64_t<br>
+typedef __int64_t __int_least64_t;<br>
+<br>
+#undef __ptrdiff_t<br>
+typedef __int32_t __ptrdiff_t;<br>
+<br>
+#undef __register_t<br>
+typedef __int64_t __register_t;<br>
+<br>
+#undef __segsz_t<br>
+typedef __int32_t __segsz_t;<br>
+<br>
+#undef __size_t<br>
+typedef __uint32_t __size_t;<br>
+<br>
+#undef __ssize_t<br>
+typedef __int32_t __ssize_t;<br>
+<br>
+#undef __time_t<br>
+typedef __int32_t __time_t;<br>
+<br>
+#undef __uintfptr_t<br>
+typedef __uint32_t __uintfptr_t;<br>
+<br>
+#undef __uintptr_t<br>
+typedef __uint32_t __uintptr_t;<br>
+<br>
+#undef __uintmax_t<br>
+typedef __uint64_t __uintmax_t;<br>
+<br>
+#undef __uint_fast64_t<br>
+typedef __uint64_t __uint_fast64_t;<br>
+<br>
+#undef __uint_least64_t<br>
+typedef __uint64_t __uint_least64_t;<br>
+<br>
+#undef __u_register_t<br>
+typedef __uint32_t __u_register_t;<br>
+<br>
+#undef __vm_offset_t<br>
+typedef __uint32_t __vm_offset_t;<br>
+<br>
+#undef __vm_paddr_t<br>
+#ifdef PAE<br>
+typedef __uint64_t __vm_paddr_t;<br>
+#else<br>
+typedef __uint32_t __vm_paddr_t;<br>
+#endif<br>
+<br>
+#undef __vm_size_t<br>
+typedef __uint32_t __vm_size_t;<br>
+<br>
+#undef __vm_ooffset_t<br>
+typedef __int64_t __vm_ooffset_t;<br>
+<br>
+#undef __vm_pindex_t<br>
+typedef __uint64_t __vm_pindex_t;<br>
+#endif // defined(__FIX_FREEBSD_9_2_DEFINITIONS)<br>
+<br>
+#endif /* !__MACHINE_XTYPES_H */<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>