bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

wcstok: work around wrong signature on native Windows


From: Bruno Haible
Subject: wcstok: work around wrong signature on native Windows
Date: Sun, 24 Nov 2019 13:17:57 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-166-generic; KDE/5.18.0; x86_64; ; )

On mingw and older MSVC versions (fixed in MSVC 14), the wcstok function takes
only 2 arguments (like strtok, not multithread-safe).

The first patch works around it. The second patch verifies it through a unit
test.


2019-11-24  Bruno Haible  <address@hidden>

        wcstok: Work around wrong signature on native Windows.
        * lib/wchar.in.h (wcstok): Override when REPLACE_WCSTOK is 1.
        * m4/wcstok.m4 (gl_FUNC_WCSTOK): Check for signature of wcstok. Set
        REPLACE_WCSTOK.
        * m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize REPLACE_WCSTOK.
        * modules/wchar (Makefile.am): Substitute REPLACE_WCSTOK.
        * modules/wcstok (Depends-on, configure.ac): Consider REPLACE_WCSTOK.
        * doc/posix-functions/wcstok.texi: Mention the problem.

2019-11-24  Bruno Haible  <address@hidden>

        wcstok: Add tests.
        * tests/test-wcstok.c: New file.
        * modules/wcstok-tests: New file.

Attachment: 0001-wcstok-Work-around-wrong-signature-on-native-Windows.patch
Description: Text Data

Attachment: 0002-wcstok-Add-tests.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]