[pypy-svn] pypy default: cpyext: Fix definition for old DL_EXPORT macros
amauryfa
commits-noreply at bitbucket.org
Fri Dec 17 19:00:03 CET 2010
Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch:
Changeset: r40092:65c025e13881
Date: 2010-11-05 17:38 +0000
http://bitbucket.org/pypy/pypy/changeset/65c025e13881/
Log: cpyext: Fix definition for old DL_EXPORT macros
+ unconditionally define HAVE_WCHAR_H
(transplanted from 77f53ce2fe976cd0b34b8d11b34179be10aedd6f)
diff --git a/pypy/module/cpyext/include/Python.h b/pypy/module/cpyext/include/Python.h
--- a/pypy/module/cpyext/include/Python.h
+++ b/pypy/module/cpyext/include/Python.h
@@ -34,7 +34,23 @@
# endif
# define Py_LOCAL_INLINE(type) static __inline type __fastcall
#endif
-#define DL_IMPORT(RTYPE) PyAPI_FUNC(RTYPE)
+
+/* Deprecated DL_IMPORT and DL_EXPORT macros */
+#ifdef _WIN32
+# if defined(Py_BUILD_CORE)
+# define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE
+# define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
+# else
+# define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE
+# define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
+# endif
+#endif
+#ifndef DL_EXPORT
+# define DL_EXPORT(RTYPE) RTYPE
+#endif
+#ifndef DL_IMPORT
+# define DL_IMPORT(RTYPE) RTYPE
+#endif
#include <stdlib.h>
@@ -57,10 +73,6 @@
#define Py_CHARMASK(c) ((unsigned char)((c) & 0xff))
#endif
-#ifndef DL_EXPORT /* declarations for DLL import/export */
-#define DL_EXPORT(RTYPE) RTYPE
-#endif
-
#define statichere static
#define Py_MEMCPY memcpy
diff --git a/pypy/module/cpyext/include/pyconfig.h b/pypy/module/cpyext/include/pyconfig.h
--- a/pypy/module/cpyext/include/pyconfig.h
+++ b/pypy/module/cpyext/include/pyconfig.h
@@ -15,6 +15,7 @@
#define WITH_DOC_STRINGS
#define HAVE_UNICODE
#define WITHOUT_COMPLEX
+#define HAVE_WCHAR_H 1
/* PyPy supposes Py_UNICODE == wchar_t */
#define HAVE_USABLE_WCHAR_T 1
More information about the Pypy-commit
mailing list