Author: hhinnant
Date: Thu Jul 26 15:01:13 2012
New Revision: 160799
URL: http://llvm.org/viewvc/llvm-project?rev=160799&view=rev
Log:
Patch by Andrew C. Morrow: shims to work around macroized getc and putc on
linux. On my eglibc 2.13 based Debian system 'getc' is a macro defined in
/usr/include/stdio.h. This decision to make it a macro doesn't seem to
be guarded by any feature test macro as far as I can see.
Modified:
libcxx/trunk/include/cstdio
Modified: libcxx/trunk/include/cstdio
URL:
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/cstdio?rev=160799&r1=160798&r2=160799&view=diff
==============================================================================
--- libcxx/trunk/include/cstdio (original)
+++ libcxx/trunk/include/cstdio Thu Jul 26 15:01:13 2012
@@ -103,6 +103,18 @@
#pragma GCC system_header
#endif
+#ifdef getc
+inline _LIBCPP_INLINE_VISIBILITY int __libcpp_getc(FILE* __stream) {return
getc(__stream);}
+#undef getc
+inline _LIBCPP_INLINE_VISIBILITY int getc(FILE* __stream) {return
__libcpp_getc(__stream);}
+#endif // getc
+
+#ifdef putc
+inline _LIBCPP_INLINE_VISIBILITY int __libcpp_putc(int __c, FILE* __stream)
{return putc(__c, __stream);}
+#undef putc
+inline _LIBCPP_INLINE_VISIBILITY int putc(int __c, FILE* __stream) {return
__libcpp_putc(__c, __stream);}
+#endif // putc
+
_LIBCPP_BEGIN_NAMESPACE_STD
using ::FILE;
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits