[libcxx] r225563 - Support Newlib as libc++'s C library [cstdio part, part 2]

Jonathan Roelofs jonathan at codesourcery.com
Fri Jan 9 16:08:00 PST 2015


Author: jroelofs
Date: Fri Jan  9 18:08:00 2015
New Revision: 225563

URL: http://llvm.org/viewvc/llvm-project?rev=225563&view=rev
Log:
Support Newlib as libc++'s C library [cstdio part, part 2]

Wrappers for clearerr, feof, ferror (which newlib implements as macros).

http://reviews.llvm.org/D5420

Modified:
    libcxx/trunk/include/cstdio

Modified: libcxx/trunk/include/cstdio
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/cstdio?rev=225563&r1=225562&r2=225563&view=diff
==============================================================================
--- libcxx/trunk/include/cstdio (original)
+++ libcxx/trunk/include/cstdio Fri Jan  9 18:08:00 2015
@@ -120,6 +120,24 @@ inline _LIBCPP_INLINE_VISIBILITY int __l
 inline _LIBCPP_INLINE_VISIBILITY int putc(int __c, FILE* __stream) {return __libcpp_putc(__c, __stream);}
 #endif  // putc
 
+#ifdef clearerr
+inline _LIBCPP_INLINE_VISIBILITY void __libcpp_clearerr(FILE* __stream) { return clearerr(__stream); }
+#undef clearerr
+inline _LIBCPP_INLINE_VISIBILITY void clearerr(FILE* __stream) { return __libcpp_clearerr(__stream); }
+#endif  // clearerr
+
+#ifdef feof
+inline _LIBCPP_INLINE_VISIBILITY int __libcpp_feof(FILE* __stream) { return feof(__stream); }
+#undef feof
+inline _LIBCPP_INLINE_VISIBILITY int feof(FILE* __stream) { return __libcpp_feof(__stream); }
+#endif  // feof
+
+#ifdef ferror
+inline _LIBCPP_INLINE_VISIBILITY int __libcpp_ferror(FILE* __stream) { return ferror(__stream); }
+#undef ferror
+inline _LIBCPP_INLINE_VISIBILITY int ferror(FILE* __stream) { return __libcpp_ferror(__stream); }
+#endif  // ferror
+
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 using ::FILE;





More information about the cfe-commits mailing list