Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Unified Diff: source/io/ufile.c

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/io/io.vcxproj.filters ('k') | source/io/unicode/ustdio.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/io/ufile.c
diff --git a/source/io/ufile.c b/source/io/ufile.c
index a8d8f0a3a60a6b7e9d0bf76b950925dad7923ff2..ab9f70a3d5cd8490edbd60cf66f9302d3adb61f7 100644
--- a/source/io/ufile.c
+++ b/source/io/ufile.c
@@ -1,7 +1,7 @@
/*
******************************************************************************
*
-* Copyright (C) 1998-2014, International Business Machines
+* Copyright (C) 1998-2015, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@@ -63,7 +63,19 @@ finit_owner(FILE *f,
uprv_memset(result, 0, sizeof(UFILE));
result->fFileno = fileno(f);
-#if U_PLATFORM_USES_ONLY_WIN32_API
+#if U_PLATFORM_USES_ONLY_WIN32_API && _MSC_VER < 1900
+ /*
+ * Below is a very old workaround (ICU ticket:231).
+ *
+ * Previously, 'FILE*' from inside and outside ICU's DLL
+ * were different, because they pointed into local copies
+ * of the io block. At least by VS 2015 the implementation
+ * is something like:
+ * stdio = _acrt_iob_func(0)
+ * .. which is a function call, so should return the same pointer
+ * regardless of call site.
+ * As of _MSC_VER 1900 this patch is retired, at 16 years old.
+ */
if (0 <= result->fFileno && result->fFileno <= 2) {
/* stdin, stdout and stderr need to be special cased for Windows 98 */
#if _MSC_VER >= 1400
« no previous file with comments | « source/io/io.vcxproj.filters ('k') | source/io/unicode/ustdio.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698