Hi EricWF, jfb, danalbert,

Shims for lib2l and logbl.

http://reviews.llvm.org/D5420

Files:
  include/cmath
  include/cstdio
  include/support/newlib/math.h
Index: include/cmath
===================================================================
--- include/cmath
+++ include/cmath
@@ -305,6 +305,10 @@
 #include "support/win32/math_win32.h"
 #endif
 
+#if defined(_NEWLIB_VERSION)
+#include "support/newlib/math.h"
+#endif
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
Index: include/cstdio
===================================================================
--- include/cstdio
+++ include/cstdio
@@ -172,8 +172,11 @@
 using ::fsetpos;
 using ::ftell;
 using ::rewind;
+#undef clearerr
 using ::clearerr;
+#undef feof
 using ::feof;
+#undef ferror
 using ::ferror;
 using ::perror;
 
Index: include/support/newlib/math.h
===================================================================
--- include/support/newlib/math.h
+++ include/support/newlib/math.h
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_NEWLIB_MATH_H
+#define _LIBCPP_SUPPORT_NEWLIB_MATH_H
+
+#if __cplusplus
+extern "C" {
+#endif
+
+#if defined(_NEWLIB_VERSION)
+inline _LIBCPP_INLINE_VISIBILITY long double log2l(long double __x) _NOEXCEPT {
+    return __builtin_log2(__x);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY long double logbl(long double __x) _NOEXCEPT {
+    return __builtin_logb(__x);
+}
+#endif
+
+#if __cplusplus
+}
+#endif
+
+#endif
+
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to