[pypy-commit] pypy py3k: rearrange a bit to fix compilation

pjenvey noreply at buildbot.pypy.org
Sat Oct 25 18:31:12 CEST 2014


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r74233:8f1cad01a693
Date: 2014-10-25 09:30 -0700
http://bitbucket.org/pypy/pypy/changeset/8f1cad01a693/

Log:	rearrange a bit to fix compilation

diff --git a/pypy/module/_codecs/locale.c b/pypy/module/_codecs/locale.c
--- a/pypy/module/_codecs/locale.c
+++ b/pypy/module/_codecs/locale.c
@@ -1,6 +1,7 @@
 /* From CPython 3.2.3's fileutils.c, and _Py_normalize_encoding from
    unicodeobject.c
 */
+#include "src/precommondefs.h"
 /*
 #include "Python.h"
 */
@@ -225,7 +226,7 @@
 
    Conversion errors should never happen, unless there is a bug in the C
    library. */
-wchar_t*
+RPY_EXPORTED_FOR_TESTS wchar_t*
 pypy_char2wchar(const char* arg, size_t *size)
 {
 #if 0 && defined(__APPLE__)
@@ -367,7 +368,7 @@
 
    If error_pos is not NULL: *error_pos is the index of the invalid character
    on conversion error, or (size_t)-1 otherwise. */
-char*
+RPY_EXPORTED_FOR_TESTS char*
 pypy_wchar2char(const wchar_t *text, size_t *error_pos)
 {
 #if 0 && defined(__APPLE__)
@@ -474,13 +475,13 @@
 #endif   /* __APPLE__ */
 }
 
-void
+RPY_EXPORTED_FOR_TESTS void
 pypy_char2wchar_free(wchar_t *text)
 {
     PyMem_Free(text);
 }
 
-void
+RPY_EXPORTED_FOR_TESTS void
 pypy_wchar2char_free(char *bytes)
 {
     PyMem_Free(bytes);
diff --git a/pypy/module/_codecs/locale.h b/pypy/module/_codecs/locale.h
deleted file mode 100644
--- a/pypy/module/_codecs/locale.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <stdlib.h>
-#include <wchar.h>
-#include "src/precommondefs.h"
-
-RPY_EXPORTED_FOR_TESTS wchar_t* pypy_char2wchar(const char* arg, size_t *size);
-RPY_EXPORTED_FOR_TESTS void pypy_char2wchar_free(wchar_t *text);
-RPY_EXPORTED_FOR_TESTS char* pypy_wchar2char(const wchar_t *text, size_t *error_pos);
-RPY_EXPORTED_FOR_TESTS void pypy_wchar2char_free(char *bytes);
diff --git a/pypy/module/_codecs/locale.py b/pypy/module/_codecs/locale.py
--- a/pypy/module/_codecs/locale.py
+++ b/pypy/module/_codecs/locale.py
@@ -15,8 +15,7 @@
 
 cwd = py.path.local(__file__).dirpath()
 eci = ExternalCompilationInfo(
-    includes=[cwd.join('locale.h')],
-    include_dirs=[str(cwd), cdir],
+    include_dirs=[cdir],
     separate_module_files=[cwd.join('locale.c')])
 
 def llexternal(*args, **kwargs):


More information about the pypy-commit mailing list