Mercurial > cpython-lru_cache-weakref
diff Objects/exceptions.c @ 38999:75bdb1eb0766 legacy-trunk
Fix build problems with the platform SDK on windows. It is not sufficient to test for the C compiler version when determining if we have the secure CRT from microsoft. Must test with an undocumented macro, __STDC_SECURE_LIB__ too.
| author | Kristján Valur Jónsson <kristjan@ccpgames.com> |
|---|---|
| date | Mon, 03 Jul 2006 14:59:05 +0000 |
| parents | 4c74ec831a6c |
| children | 635b09b1f542 |
line wrap: on
line diff
--- a/Objects/exceptions.c Mon Jul 03 14:16:09 2006 +0000 +++ b/Objects/exceptions.c Mon Jul 03 14:59:05 2006 +0000 @@ -1967,7 +1967,7 @@ if (PyDict_SetItemString(bdict, # TYPE, PyExc_ ## TYPE)) \ Py_FatalError("Module dictionary insertion problem."); -#if defined _MSC_VER && _MSC_VER >= 1400 +#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__) /* crt variable checking in VisualStudio .NET 2005 */ #include <crtdbg.h> @@ -2120,7 +2120,7 @@ Py_DECREF(bltinmod); -#if defined _MSC_VER && _MSC_VER >= 1400 +#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__) /* Set CRT argument error handler */ prevCrtHandler = _set_invalid_parameter_handler(InvalidParameterHandler); /* turn off assertions in debug mode */ @@ -2133,7 +2133,7 @@ { Py_XDECREF(PyExc_MemoryErrorInst); PyExc_MemoryErrorInst = NULL; -#if defined _MSC_VER && _MSC_VER >= 1400 +#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__) /* reset CRT error handling */ _set_invalid_parameter_handler(prevCrtHandler); _CrtSetReportMode(_CRT_ASSERT, prevCrtReportMode);
