[Python-checkins] r80138 - in python/branches/py3k: Include/Python.h Modules/python.c

collin.winter python-checkins at python.org
Sat Apr 17 02:20:57 CEST 2010


Author: collin.winter
Date: Sat Apr 17 02:20:57 2010
New Revision: 80138

Log:
Fix the --with-cxx-main build.

Modified:
   python/branches/py3k/Include/Python.h
   python/branches/py3k/Modules/python.c

Modified: python/branches/py3k/Include/Python.h
==============================================================================
--- python/branches/py3k/Include/Python.h	(original)
+++ python/branches/py3k/Include/Python.h	Sat Apr 17 02:20:57 2010
@@ -120,11 +120,17 @@
 #include "pystrcmp.h"
 #include "dtoa.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 /* _Py_Mangle is defined in compile.c */
 PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name);
 
 /* _Py_char2wchar lives in python.c */
 PyAPI_FUNC(wchar_t *) _Py_char2wchar(char *);
+#ifdef __cplusplus
+}
+#endif
 
 /* Convert a possibly signed character to a nonnegative int */
 /* XXX This assumes characters are 8 bits wide */

Modified: python/branches/py3k/Modules/python.c
==============================================================================
--- python/branches/py3k/Modules/python.c	(original)
+++ python/branches/py3k/Modules/python.c	Sat Apr 17 02:20:57 2010
@@ -57,7 +57,7 @@
 	/* Overallocate; as multi-byte characters are in the argument, the
 	   actual output could use less memory. */
 	argsize = strlen(arg) + 1;
-	res = PyMem_Malloc(argsize*sizeof(wchar_t));
+	res = (wchar_t*)PyMem_Malloc(argsize*sizeof(wchar_t));
 	if (!res) goto oom;
 	in = (unsigned char*)arg;
 	out = res;


More information about the Python-checkins mailing list