From 8e613cf342b369f7985135dbe11ebdbf8c736157 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Wed, 11 Jun 2014 14:17:35 -0700 Subject: [PATCH] Remove declaration for putw(3)/getw(3). These were both removed from POSIX 2004, and we don't define an implementation for getw(3). Keep the definition of put(3) on LP32 for binary compatibility. Bug: 13935372 Change-Id: Iba384b45093ac6d2d7c2d81f7980cd7701dd6f56 --- libc/Android.mk | 1 - libc/arch-arm/arm.mk | 1 + libc/arch-mips/mips.mk | 1 + libc/arch-x86/x86.mk | 1 + libc/include/stdio.h | 2 -- tests/stdio_test.cpp | 4 ---- 6 files changed, 3 insertions(+), 7 deletions(-) diff --git a/libc/Android.mk b/libc/Android.mk index cd5cb024d..8d1cc968e 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -418,7 +418,6 @@ libc_upstream_openbsd_src_files := \ upstream-openbsd/lib/libc/stdio/putc.c \ upstream-openbsd/lib/libc/stdio/putchar.c \ upstream-openbsd/lib/libc/stdio/puts.c \ - upstream-openbsd/lib/libc/stdio/putw.c \ upstream-openbsd/lib/libc/stdio/putwc.c \ upstream-openbsd/lib/libc/stdio/putwchar.c \ upstream-openbsd/lib/libc/stdio/refill.c \ diff --git a/libc/arch-arm/arm.mk b/libc/arch-arm/arm.mk index 7c423ab89..260d72ef5 100644 --- a/libc/arch-arm/arm.mk +++ b/libc/arch-arm/arm.mk @@ -5,6 +5,7 @@ libc_common_src_files_arm := \ bionic/legacy_32_bit_support.cpp \ bionic/ndk_cruft.cpp \ bionic/time64.c \ + upstream-openbsd/lib/libc/stdio/putw.c \ # These are shared by all the 32-bit targets, but not the 64-bit ones. libc_bionic_src_files_arm := \ diff --git a/libc/arch-mips/mips.mk b/libc/arch-mips/mips.mk index 64b0fb2b4..c964e67fe 100644 --- a/libc/arch-mips/mips.mk +++ b/libc/arch-mips/mips.mk @@ -5,6 +5,7 @@ libc_common_src_files_mips := \ bionic/legacy_32_bit_support.cpp \ bionic/ndk_cruft.cpp \ bionic/time64.c \ + upstream-openbsd/lib/libc/stdio/putw.c \ # These are shared by all the 32-bit targets, but not the 64-bit ones. libc_bionic_src_files_mips += \ diff --git a/libc/arch-x86/x86.mk b/libc/arch-x86/x86.mk index 0f2216996..3dc71d15b 100644 --- a/libc/arch-x86/x86.mk +++ b/libc/arch-x86/x86.mk @@ -5,6 +5,7 @@ libc_common_src_files_x86 := \ bionic/legacy_32_bit_support.cpp \ bionic/ndk_cruft.cpp \ bionic/time64.c \ + upstream-openbsd/lib/libc/stdio/putw.c \ # Fortify implementations of libc functions. libc_common_src_files_x86 += \ diff --git a/libc/include/stdio.h b/libc/include/stdio.h index 90f595c9e..d6cad33ee 100644 --- a/libc/include/stdio.h +++ b/libc/include/stdio.h @@ -339,8 +339,6 @@ int asprintf(char ** __restrict, const char * __restrict, ...) __printflike(2, 3); char *fgetln(FILE * __restrict, size_t * __restrict); int fpurge(FILE *); -int getw(FILE *); -int putw(int, FILE *); void setbuffer(FILE *, char *, int); int setlinebuf(FILE *); int vasprintf(char ** __restrict, const char * __restrict, diff --git a/tests/stdio_test.cpp b/tests/stdio_test.cpp index e291f52fe..18dae9c2f 100644 --- a/tests/stdio_test.cpp +++ b/tests/stdio_test.cpp @@ -531,10 +531,6 @@ TEST(stdio, cantwrite_EBADF) { EXPECT_EQ(EBADF, errno); #endif - errno = 0; - EXPECT_EQ(EOF, putw(1234, fp)); - EXPECT_EQ(EBADF, errno); - errno = 0; EXPECT_EQ(0U, fwrite("hello", 1, 2, fp)); EXPECT_EQ(EBADF, errno);