From 13e2966c91c8661d08de347e143c3c5be8c3c68d Mon Sep 17 00:00:00 2001 From: Jonathan Roelofs Date: Sat, 10 Jan 2015 00:08:00 +0000 Subject: [PATCH] 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 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225563 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/cstdio | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/cstdio b/include/cstdio index ce3af4d91..37814ef11 100644 --- a/include/cstdio +++ b/include/cstdio @@ -120,6 +120,24 @@ inline _LIBCPP_INLINE_VISIBILITY int __libcpp_putc(int __c, FILE* __stream) {ret 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;