diff options
author | darylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-06-15 19:58:39 +0000 |
---|---|---|
committer | darylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-06-15 19:58:39 +0000 |
commit | a7a8363d86ec8ad445fb73619b1ca5cac4e56a86 (patch) | |
tree | 2f395fe3d054f5036014cd7eb1f892d7d7333bb0 /StdLib/LibC/Stdio | |
parent | c7907ba2fa68a7515747385bf63b47f5e281c904 (diff) | |
download | edk2-platforms-a7a8363d86ec8ad445fb73619b1ca5cac4e56a86.tar.xz |
StdLib: Add multi-byte character support. The normal "narrow" character set is now UTF-8 instead of ASCII.
Add library classes which are required by StdLib, but not commonly defined in Platform DSC files, to StdLib.inc.
Modify MB_LEN_MAX to be 4, the maximum length of UTF-8 characters.
Adjust size of internal buffers to be multiples of MB_LEN_MAX instead of assuming 1-byte characters.
Make the XYoffset object public and move its declaration into EfiSysCall.h.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: daryl.mcdaniel@intel.com
Reviewed-by: erik.c.bjorge@intel.com
Reviewed-by: lee.g.rosenbaum@intel.com
Reviewed-by: leroy.p.leahy@intel.com
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13457 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'StdLib/LibC/Stdio')
-rw-r--r-- | StdLib/LibC/Stdio/fputwc.c | 3 | ||||
-rw-r--r-- | StdLib/LibC/Stdio/makebuf.c | 5 |
2 files changed, 4 insertions, 4 deletions
diff --git a/StdLib/LibC/Stdio/fputwc.c b/StdLib/LibC/Stdio/fputwc.c index 8bbd407362..76ed839203 100644 --- a/StdLib/LibC/Stdio/fputwc.c +++ b/StdLib/LibC/Stdio/fputwc.c @@ -1,5 +1,5 @@ /*
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License that accompanies this
distribution. The full text of the license may be found at
@@ -81,7 +81,6 @@ __fputwc_unlock(wchar_t wc, FILE *fp) size = wcrtomb(buf, wc, st);
if (size == (size_t)-1) {
- errno = EILSEQ;
return WEOF;
}
diff --git a/StdLib/LibC/Stdio/makebuf.c b/StdLib/LibC/Stdio/makebuf.c index 1b5991489c..684f0eebc1 100644 --- a/StdLib/LibC/Stdio/makebuf.c +++ b/StdLib/LibC/Stdio/makebuf.c @@ -1,7 +1,7 @@ /** @file
Implementation of internal file buffer allocation functions.
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License that accompanies this
distribution. The full text of the license may be found at
@@ -77,11 +77,12 @@ __smakebuf(FILE *fp) if (fp != NULL) {
if (fp->_flags & __SNBF) {
fp->_bf._base = fp->_p = fp->_nbuf;
- fp->_bf._size = 1;
+ fp->_bf._size = MB_LEN_MAX;
return;
}
flags = __swhatbuf(fp, &size, &couldbetty);
if ((p = malloc(size)) == NULL) {
+ // malloc failed, act unbuffered.
fp->_flags |= __SNBF;
fp->_bf._base = fp->_p = fp->_nbuf;
fp->_bf._size = 1;
|