[libcxx-commits] [PATCH] D119742: [libc++][nfc] Add TEST_HAS_NO_FGETPOS_FSETPOS.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Feb 14 10:50:15 PST 2022


Mordante created this revision.
Mordante requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

This avoids using an libc++ internal macro in our tests.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119742

Files:
  libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp
  libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp
  libcxx/test/support/test_macros.h


Index: libcxx/test/support/test_macros.h
===================================================================
--- libcxx/test/support/test_macros.h
+++ libcxx/test/support/test_macros.h
@@ -392,6 +392,10 @@
 #  define TEST_HAS_NO_FILESYSTEM_LIBRARY
 #endif
 
+#if defined(_LIBCPP_HAS_NO_FGETPOS_FSETPOS)
+#  define TEST_HAS_NO_FGETPOS_FSETPOS
+#endif
+
 #if defined(__GNUC__)
 #pragma GCC diagnostic pop
 #endif
Index: libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp
===================================================================
--- libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp
+++ libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp
@@ -122,11 +122,11 @@
     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(vp,0,0,fp)), std::size_t>::value), "");
-#ifndef _LIBCPP_HAS_NO_FGETPOS_FSETPOS
+#ifndef TEST_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
+#ifndef TEST_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), "");
Index: libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp
===================================================================
--- libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp
+++ libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp
@@ -156,11 +156,11 @@
     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
+#ifndef TEST_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
+#ifndef TEST_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), "");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119742.408508.patch
Type: text/x-patch
Size: 2507 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220214/af94398d/attachment.bin>


More information about the libcxx-commits mailing list