[libcxx-commits] [libcxx] 097f0fd - [libc++][nfc] Add TEST_HAS_NO_FGETPOS_FSETPOS.

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 15 08:51:02 PST 2022


Author: Mark de Wever
Date: 2022-02-15T17:50:56+01:00
New Revision: 097f0fd15863bfb0bf11f3e35d068c8698f2cdc4

URL: https://github.com/llvm/llvm-project/commit/097f0fd15863bfb0bf11f3e35d068c8698f2cdc4
DIFF: https://github.com/llvm/llvm-project/commit/097f0fd15863bfb0bf11f3e35d068c8698f2cdc4.diff

LOG: [libc++][nfc] Add TEST_HAS_NO_FGETPOS_FSETPOS.

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

Reviewed By: #libc, philnik, ldionne

Differential Revision: https://reviews.llvm.org/D119742

Added: 
    

Modified: 
    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

Removed: 
    


################################################################################
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 43a0e292e15d0..b279d4464f4c9 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,11 +156,11 @@ 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
+#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), "");

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 d6dc6b7667eb1..2ef6c2291e424 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
@@ -122,11 +122,11 @@ 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(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), "");

diff  --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h
index 272231da326be..dde0802c4c261 100644
--- a/libcxx/test/support/test_macros.h
+++ b/libcxx/test/support/test_macros.h
@@ -390,6 +390,10 @@ inline void DoNotOptimize(Tp const& value) {
 #  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


        


More information about the libcxx-commits mailing list