]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix build problems with the platform SDK on windows. It is not sufficient to test...
authorKristján Valur Jónsson <kristjan@ccpgames.com>
Mon, 3 Jul 2006 14:59:05 +0000 (14:59 +0000)
committerKristján Valur Jónsson <kristjan@ccpgames.com>
Mon, 3 Jul 2006 14:59:05 +0000 (14:59 +0000)
Modules/timemodule.c
Objects/exceptions.c
Objects/fileobject.c

index 2133273872544dad48c59188f80d9ddc0aed6c13..402e349b42045baaffd903dd0c7cf7f055a2e1e8 100644 (file)
@@ -467,7 +467,7 @@ time_strftime(PyObject *self, PyObject *args)
                        return ret;
                }
                free(outbuf);
-#if defined _MSC_VER && _MSC_VER >= 1400
+#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__)
                /* VisualStudio .NET 2005 does this properly */
                if (buflen == 0 && errno == EINVAL) {
                        PyErr_SetString(PyExc_ValueError, "Invalid format string");
index 38d7350cfe3e8da12b61020aed0bab77658a30a5..be9627c4a60d45fe70115e6ac27ed96a3a10a2fd 100644 (file)
@@ -1967,7 +1967,7 @@ static PyMethodDef functions[] = {
     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 @@ _PyExc_Init(void)
 
     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 @@ _PyExc_Fini(void)
 {
     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);
index 050146ae7773ce68916acd5dd181f7dd4300f125..76b7da641950399bb85c330842a0832c970258de 100644 (file)
@@ -241,7 +241,7 @@ open_the_file(PyFileObject *f, char *name, char *mode)
        }
 
        if (f->f_fp == NULL) {
-#if defined  _MSC_VER && _MSC_VER < 1400
+#if defined  _MSC_VER && (_MSC_VER < 1400 || !defined(__STDC_SECURE_LIB__))
                /* MSVC 6 (Microsoft) leaves errno at 0 for bad mode strings,
                 * across all Windows flavors.  When it sets EINVAL varies
                 * across Windows flavors, the exact conditions aren't