[libcxx-commits] [PATCH] D76093: Don't expose unavailable cstdio functions.

Eric Fiselier via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 13 13:29:24 PDT 2020


EricWF added a comment.

Could we add a `.fail.cpp` test that ensures when `_LIBCPP_HAS_NO_FGETPOS` is defined we don't actually have it?

Something like:

  using T = decltype(::fgetpos); 
  #ifdef _LIBCPP_HAS_NO_FGETPOS
  // expected-error at -2 {{no such thing}}
  #else
  // expected-no-diagnostics
  #endif



================
Comment at: libcxx/include/__config:1550
+// using 64-bit file offsets on LP32.
+#if !defined(__ANDROID__) || !defined(__USE_FILE_OFFSET64) ||                  \
+    (__ANDROID_API__ >= 24)
----------------
danalbert wrote:
> ldionne wrote:
> > I believe this would be easier to understand if it were instead `_LIBCPP_HAS_NO_FGETPOS`. The condition would become:
> > 
> > ```
> > #if defined(__ANDROID__) && defined(__USE_FILE_OFFSET64) && __ANDROID_API < 24
> > ```
> > 
> > Do you agree?
> Yep, SGTM. Also corrected `__ANDROID__` to `__BIONIC__`, not that there are any non-android bionic users old enough (or 32-bit enough) for this to be a problem.
Do we really need two macros for this? I would prefer one.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76093/new/

https://reviews.llvm.org/D76093





More information about the libcxx-commits mailing list