Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r74259:c96101761312
Date: 2014-10-27 13:26 -0700
http://bitbucket.org/pypy/pypy/changeset/c96101761312/
Log: backout 8f1cad01a693 for -Ojit
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,7 +1,6 @@
/* From CPython 3.2.3's fileutils.c, and _Py_normalize_encoding from
unicodeobject.c
*/
-#include "src/precommondefs.h"
/*
#include "Python.h"
*/
@@ -226,7 +225,7 @@
Conversion errors should never happen, unless there is a bug in the C
library. */
-RPY_EXPORTED_FOR_TESTS wchar_t*
+wchar_t*
pypy_char2wchar(const char* arg, size_t *size)
{
#if 0 && defined(__APPLE__)
@@ -368,7 +367,7 @@
If error_pos is not NULL: *error_pos is the index of the invalid character
on conversion error, or (size_t)-1 otherwise. */
-RPY_EXPORTED_FOR_TESTS char*
+char*
pypy_wchar2char(const wchar_t *text, size_t *error_pos)
{
#if 0 && defined(__APPLE__)
@@ -475,13 +474,13 @@
#endif /* __APPLE__ */
}
-RPY_EXPORTED_FOR_TESTS void
+void
pypy_char2wchar_free(wchar_t *text)
{
PyMem_Free(text);
}
-RPY_EXPORTED_FOR_TESTS void
+void
pypy_wchar2char_free(char *bytes)
{
PyMem_Free(bytes);
diff --git a/pypy/module/_codecs/locale.h b/pypy/module/_codecs/locale.h
new file mode 100644
--- /dev/null
+++ b/pypy/module/_codecs/locale.h
@@ -0,0 +1,8 @@
+#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,7 +15,8 @@
cwd = py.path.local(__file__).dirpath()
eci = ExternalCompilationInfo(
- include_dirs=[cdir],
+ includes=[cwd.join('locale.h')],
+ include_dirs=[str(cwd), cdir],
separate_module_files=[cwd.join('locale.c')])
def llexternal(*args, **kwargs):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit