[Scipy-svn] r6727 - trunk/scipy/sparse/sparsetools

scipy-svn@scip... scipy-svn@scip...
Sat Sep 11 19:52:27 CDT 2010


Author: ptvirtan
Date: 2010-09-11 19:52:26 -0500 (Sat, 11 Sep 2010)
New Revision: 6727

Modified:
   trunk/scipy/sparse/sparsetools/py3k.h
Log:
3K: sparse: add py3k.h for sparsetools

Modified: trunk/scipy/sparse/sparsetools/py3k.h
===================================================================
--- trunk/scipy/sparse/sparsetools/py3k.h	2010-09-12 00:52:11 UTC (rev 6726)
+++ trunk/scipy/sparse/sparsetools/py3k.h	2010-09-12 00:52:26 UTC (rev 6727)
@@ -1,22 +1,23 @@
-#ifndef __STDC_FORMAT_MACROS
-#define __STDC_FORMAT_MACROS
-#include <inttypes.h>
-#error YOYOYO
+/*
+ * Undefine macros defined by SWIG
+ */
+#if PY_VERSION_HEX >= 0x03000000
+
+#ifdef PyInt_Check
+#undef PyInt_Check
 #endif
-#include <Python.h>
 
-#if PY_VERSION_HEX >= 0x03000000
-	#define PyString_Check PyUnicode_Check
-	static int __pyfile_check_guard(PyObject *x)
-	{
-		fprintf(stderr, "PY3K error: PyFile_Check called !\n");
-		return 0;
-	}
-	#define PyFile_Check(x) __pyfile_check_guard((x))
-	static int __pyinstance_check_guard(PyObject *x)
-	{
-		fprintf(stderr, "PY3K error: PyInstance_Check calleed !\n");
-		return 0;
-	}
-	#define PyInstance_Check(x) __pyinstance_check_guard((x))
+static int __pyfile_check_guard(PyObject *x)
+{
+    return 0;
+}
+#define PyFile_Check(x) __pyfile_check_guard((x))
+static int __pyinstance_check_guard(PyObject *x)
+{
+    return 0;
+}
+#define PyInstance_Check(x) __pyinstance_check_guard((x))
+
 #endif
+
+#include "numpy/npy_3kcompat.h"



More information about the Scipy-svn mailing list