Commit 4e8e2f39 authored by Alexander Scott-Johns's avatar Alexander Scott-Johns Committed by Alexandre Julliard

include/msvcrt: Define _TRUNCATE; use it in the tests.

parent 2663079c
......@@ -1215,22 +1215,22 @@ static void test_mbstowcs(void)
return;
}
err = pmbstowcs_s(&ret, wOut, 6, mSimple, -1/*_TRUNCATE*/);
err = pmbstowcs_s(&ret, wOut, 6, mSimple, _TRUNCATE);
ok(err == 0, "err = %d\n", err);
ok(ret == 5, "ret = %d\n", (int)ret);
ok(!memcmp(wOut, wSimple, sizeof(wSimple)), "wOut = %s\n", wine_dbgstr_w(wOut));
err = pmbstowcs_s(&ret, wOut, 6, mHiragana, -1/*_TRUNCATE*/);
err = pmbstowcs_s(&ret, wOut, 6, mHiragana, _TRUNCATE);
ok(err == 0, "err = %d\n", err);
ok(ret == 3, "ret = %d\n", (int)ret);
ok(!memcmp(wOut, wHiragana, sizeof(wHiragana)), "wOut = %s\n", wine_dbgstr_w(wOut));
err = pwcstombs_s(&ret, mOut, 6, wSimple, -1/*_TRUNCATE*/);
err = pwcstombs_s(&ret, mOut, 6, wSimple, _TRUNCATE);
ok(err == 0, "err = %d\n", err);
ok(ret == 5, "ret = %d\n", (int)ret);
ok(!memcmp(mOut, mSimple, sizeof(mSimple)), "mOut = %s\n", mOut);
err = pwcstombs_s(&ret, mOut, 6, wHiragana, -1/*_TRUNCATE*/);
err = pwcstombs_s(&ret, mOut, 6, wHiragana, _TRUNCATE);
ok(err == 0, "err = %d\n", err);
ok(ret == 5, "ret = %d\n", (int)ret);
ok(!memcmp(mOut, mHiragana, sizeof(mHiragana)), "mOut = %s\n", mOut);
......
......@@ -47,6 +47,8 @@ typedef struct
#define _MAX_PATH 260
#endif
/* Make the secure string functions (names end in "_s") truncate their output */
#define _TRUNCATE ((size_t)-1)
typedef struct _div_t {
int quot;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment