[libcxx-commits] [libcxx] 50280c1 - Revert "Don't expose unavailable cstdio functions."
Dan Albert via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Apr 7 15:37:27 PDT 2020
Author: Dan Albert
Date: 2020-04-07T15:36:44-07:00
New Revision: 50280c18958bc152d77d6e69d14a53b8dbc8b395
URL: https://github.com/llvm/llvm-project/commit/50280c18958bc152d77d6e69d14a53b8dbc8b395
DIFF: https://github.com/llvm/llvm-project/commit/50280c18958bc152d77d6e69d14a53b8dbc8b395.diff
LOG: Revert "Don't expose unavailable cstdio functions."
Broke builders that emit different diagnostics. e.g.:
error: 'warning' diagnostics seen but not expected:
Line 13: alias declarations are a C++11 extension
Line 20: alias declarations are a C++11 extension
This reverts commit ff87813715ec32741ce230dd37c13d0ae6673f9c.
Added:
Modified:
libcxx/include/__config
libcxx/include/cstdio
libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp
libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp
Removed:
libcxx/test/libcxx/depr/depr.c.headers/no_fgetpos_fsetpos.fail.cpp
################################################################################
diff --git a/libcxx/include/__config b/libcxx/include/__config
index ba565d2b4256..ce7a9354c50a 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -1545,13 +1545,6 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
#define _LIBCPP_BUILTIN_CONSTANT_P(x) false
#endif
-// Support for _FILE_OFFSET_BITS=64 landed gradually in Android, so the full set
-// of functions used in cstdio may not be available for low API levels when
-// using 64-bit file offsets on LP32.
-#if defined(__BIONIC__) && defined(__USE_FILE_OFFSET64) && __ANDROID_API__ < 24
-#define _LIBCPP_HAS_NO_FGETPOS_FSETPOS
-#endif
-
#endif // __cplusplus
#endif // _LIBCPP_CONFIG
diff --git a/libcxx/include/cstdio b/libcxx/include/cstdio
index d0492a083505..0f3f42dac2da 100644
--- a/libcxx/include/cstdio
+++ b/libcxx/include/cstdio
@@ -131,13 +131,9 @@ using ::putc;
using ::ungetc;
using ::fread;
using ::fwrite;
-#ifndef _LIBCPP_HAS_NO_FGETPOS_FSETPOS
using ::fgetpos;
-#endif
using ::fseek;
-#ifndef _LIBCPP_HAS_NO_FGETPOS_FSETPOS
using ::fsetpos;
-#endif
using ::ftell;
using ::rewind;
using ::clearerr;
diff --git a/libcxx/test/libcxx/depr/depr.c.headers/no_fgetpos_fsetpos.fail.cpp b/libcxx/test/libcxx/depr/depr.c.headers/no_fgetpos_fsetpos.fail.cpp
deleted file mode 100644
index 7c28be0b944d..000000000000
--- a/libcxx/test/libcxx/depr/depr.c.headers/no_fgetpos_fsetpos.fail.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// REQUIRES: verify-support
-
-#include <cstdio>
-
-using T = decltype(::fgetpos);
-#ifdef _LIBCPP_HAS_NO_FGETPOS_FSETPOS
-// expected-error at -2 {{no such thing}}
-#else
-// expected-no-diagnostics
-#endif
-
-using U = decltype(::fsetpos);
-#ifdef _LIBCPP_HAS_NO_FGETPOS_FSETPOS
-// expected-error at -2 {{no such thing}}
-#else
-// expected-no-diagnostics
-#endif
diff --git a/libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp
index 43a0e292e15d..97ea0d41519b 100644
--- a/libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp
@@ -156,13 +156,9 @@ int main(int, char**)
static_assert((std::is_same<decltype(ungetc(0,fp)), int>::value), "");
static_assert((std::is_same<decltype(fread((void*)0,0,0,fp)), size_t>::value), "");
static_assert((std::is_same<decltype(fwrite((const void*)arr,1,0,fp)), size_t>::value), "");
-#ifndef _LIBCPP_HAS_NO_FGETPOS_FSETPOS
static_assert((std::is_same<decltype(fgetpos(fp, &fpos)), int>::value), "");
-#endif
static_assert((std::is_same<decltype(fseek(fp, 0,0)), int>::value), "");
-#ifndef _LIBCPP_HAS_NO_FGETPOS_FSETPOS
static_assert((std::is_same<decltype(fsetpos(fp, &fpos)), int>::value), "");
-#endif
static_assert((std::is_same<decltype(ftell(fp)), long>::value), "");
static_assert((std::is_same<decltype(rewind(fp)), void>::value), "");
static_assert((std::is_same<decltype(clearerr(fp)), void>::value), "");
diff --git a/libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp b/libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp
index bae82fec69b0..af8dc97a5e83 100644
--- a/libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp
@@ -120,13 +120,9 @@ int main(int, char**)
static_assert((std::is_same<decltype(std::ungetc(0,fp)), int>::value), "");
static_assert((std::is_same<decltype(std::fread((void*)0,0,0,fp)), std::size_t>::value), "");
static_assert((std::is_same<decltype(std::fwrite((const void*)0,0,0,fp)), std::size_t>::value), "");
-#ifndef _LIBCPP_HAS_NO_FGETPOS_FSETPOS
static_assert((std::is_same<decltype(std::fgetpos(fp, &fpos)), int>::value), "");
-#endif
static_assert((std::is_same<decltype(std::fseek(fp, 0,0)), int>::value), "");
-#ifndef _LIBCPP_HAS_NO_FGETPOS_FSETPOS
static_assert((std::is_same<decltype(std::fsetpos(fp, &fpos)), int>::value), "");
-#endif
static_assert((std::is_same<decltype(std::ftell(fp)), long>::value), "");
static_assert((std::is_same<decltype(std::rewind(fp)), void>::value), "");
static_assert((std::is_same<decltype(std::clearerr(fp)), void>::value), "");
More information about the libcxx-commits
mailing list