Revision: 13603
Author: [email protected]
Date: Wed Feb 6 02:59:50 2013
Log: Do not rely on secure API functions when using MinGW-w64
Windows XP does not provide secure API functions in msvcrt.dll but
newer versions of Windows do. Avoid using secure API functions for
compatibility with msvcrt.dll on Windows XP.
Contributed by [email protected]
BUGS=
TEST=
Review URL: https://chromiumcodereview.appspot.com/12189010
Patch from Jonathan Liu <[email protected]>.
http://code.google.com/p/v8/source/detail?r=13603
Modified:
/branches/bleeding_edge/src/platform-win32.cc
=======================================
--- /branches/bleeding_edge/src/platform-win32.cc Fri Dec 14 06:27:06 2012
+++ /branches/bleeding_edge/src/platform-win32.cc Wed Feb 6 02:59:50 2013
@@ -65,7 +65,13 @@
#endif // __MINGW64_VERSION_MAJOR
-#ifndef MINGW_HAS_SECURE_API
+#ifdef MINGW_HAS_SECURE_API
+#define localtime_s v8_localtime_s
+#define fopen_s v8_fopen_s
+#define _vsnprintf_s v8_vsnprintf_s
+#define strncpy_s v8_strncpy_s
+#endif // MINGW_HAS_SECURE_API
+
int localtime_s(tm* out_tm, const time_t* time) {
tm* posix_local_time_struct = localtime(time);
@@ -112,8 +118,6 @@
*dest = 0;
return 0;
}
-
-#endif // MINGW_HAS_SECURE_API
#endif // __MINGW32__
@@ -202,7 +206,7 @@
UNARY_MATH_FUNCTION(exp, CreateExpFunction())
UNARY_MATH_FUNCTION(sqrt, CreateSqrtFunction())
-#undef MATH_FUNCTION
+#undef UNARY_MATH_FUNCTION
void lazily_initialize_fast_exp() {
@@ -812,6 +816,13 @@
}
+#undef _TRUNCATE
+#undef STRUNCATE
+#undef localtime_s
+#undef fopen_s
+#undef _vsnprintf_s
+#undef strncpy_s
+
// We keep the lowest and highest addresses mapped as a quick way of
// determining that pointers are outside the heap (used mostly in
assertions
// and verification). The estimate is conservative, i.e., not all
addresses in
@@ -1217,6 +1228,11 @@
// NOTE: The modules are never unloaded and will stay around until the
// application is closed.
}
+
+#undef DBGHELP_FUNCTION_LIST
+#undef TLHELP32_FUNCTION_LIST
+#undef DLL_FUNC_VAR
+#undef DLL_FUNC_TYPE
// Load the symbols for generating stack traces.
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.