Tests: limit the multi-character ungetc() test to glibc and Apple

The Windows C runtime only supports one pushed-back character, which
broke the Windows CI jobs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N5NasEsrzHhSNouxSoEwqz
This commit is contained in:
Claude committed 2026-11-06 22:35:01 +00:00
1 parent 704a324639
commit 6a6744004c
1 file changed
+4 -2
+4 -2
View File
@@ -303,10 +303,12 @@ TEST_CASE("parsing from a FILE*")
}
#endif
#if !defined(JSON_NOEXCEPTION)
// the C standard guarantees only one pushed-back character (and the
// Windows C runtime fails further calls to ungetc()), so this is limited
// to the C libraries that keep them in a separate buffer
#if !defined(JSON_NOEXCEPTION) && ((defined(__GLIBC__) && !defined(__UCLIBC__)) || defined(__APPLE__))
SECTION("characters pushed back with ungetc() before parsing")
{
// (glibc and Apple keep them in a separate buffer)
const file_ptr f = open_with(name, "2, 3]");
REQUIRE(f != nullptr);
REQUIRE(std::ungetc(',', f.get()) == ',');