Skip to content

Commit 097f0fd

Browse files
committed
[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
1 parent ab6e02d commit 097f0fd

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

libcxx/test/std/depr/depr.c.headers/stdio_h.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ int main(int, char**)
156156
static_assert((std::is_same<decltype(ungetc(0,fp)), int>::value), "");
157157
static_assert((std::is_same<decltype(fread((void*)0,0,0,fp)), size_t>::value), "");
158158
static_assert((std::is_same<decltype(fwrite((const void*)arr,1,0,fp)), size_t>::value), "");
159-
#ifndef _LIBCPP_HAS_NO_FGETPOS_FSETPOS
159+
#ifndef TEST_HAS_NO_FGETPOS_FSETPOS
160160
static_assert((std::is_same<decltype(fgetpos(fp, &fpos)), int>::value), "");
161161
#endif
162162
static_assert((std::is_same<decltype(fseek(fp, 0,0)), int>::value), "");
163-
#ifndef _LIBCPP_HAS_NO_FGETPOS_FSETPOS
163+
#ifndef TEST_HAS_NO_FGETPOS_FSETPOS
164164
static_assert((std::is_same<decltype(fsetpos(fp, &fpos)), int>::value), "");
165165
#endif
166166
static_assert((std::is_same<decltype(ftell(fp)), long>::value), "");

libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ int main(int, char**)
122122
static_assert((std::is_same<decltype(std::ungetc(0,fp)), int>::value), "");
123123
static_assert((std::is_same<decltype(std::fread((void*)0,0,0,fp)), std::size_t>::value), "");
124124
static_assert((std::is_same<decltype(std::fwrite(vp,0,0,fp)), std::size_t>::value), "");
125-
#ifndef _LIBCPP_HAS_NO_FGETPOS_FSETPOS
125+
#ifndef TEST_HAS_NO_FGETPOS_FSETPOS
126126
static_assert((std::is_same<decltype(std::fgetpos(fp, &fpos)), int>::value), "");
127127
#endif
128128
static_assert((std::is_same<decltype(std::fseek(fp, 0,0)), int>::value), "");
129-
#ifndef _LIBCPP_HAS_NO_FGETPOS_FSETPOS
129+
#ifndef TEST_HAS_NO_FGETPOS_FSETPOS
130130
static_assert((std::is_same<decltype(std::fsetpos(fp, &fpos)), int>::value), "");
131131
#endif
132132
static_assert((std::is_same<decltype(std::ftell(fp)), long>::value), "");

libcxx/test/support/test_macros.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,10 @@ inline void DoNotOptimize(Tp const& value) {
390390
# define TEST_HAS_NO_FILESYSTEM_LIBRARY
391391
#endif
392392

393+
#if defined(_LIBCPP_HAS_NO_FGETPOS_FSETPOS)
394+
# define TEST_HAS_NO_FGETPOS_FSETPOS
395+
#endif
396+
393397
#if defined(__GNUC__)
394398
#pragma GCC diagnostic pop
395399
#endif

0 commit comments

Comments
 (0)