[pypy-commit] pypy py3k: adapt to RPY_EXPORT_FOR_TESTS
pjenvey
noreply at buildbot.pypy.org
Sat Oct 25 03:14:37 CEST 2014
Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r74198:6c2b6168f56a
Date: 2014-10-24 18:13 -0700
http://bitbucket.org/pypy/pypy/changeset/6c2b6168f56a/
Log: adapt to RPY_EXPORT_FOR_TESTS
diff --git a/pypy/module/_codecs/locale.h b/pypy/module/_codecs/locale.h
--- a/pypy/module/_codecs/locale.h
+++ b/pypy/module/_codecs/locale.h
@@ -1,7 +1,8 @@
#include <stdlib.h>
#include <wchar.h>
+#include "src/precommondefs.h"
-wchar_t* pypy_char2wchar(const char* arg, size_t *size);
-void pypy_char2wchar_free(wchar_t *text);
-char* pypy_wchar2char(const wchar_t *text, size_t *error_pos);
-void pypy_wchar2char_free(char *bytes);
+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
@@ -10,14 +10,14 @@
from rpython.rlib.runicode import (code_to_unichr,
default_unicode_error_decode, default_unicode_error_encode)
from rpython.rtyper.lltypesystem import lltype, rffi
+from rpython.translator import cdir
from rpython.translator.tool.cbuild import ExternalCompilationInfo
cwd = py.path.local(__file__).dirpath()
eci = ExternalCompilationInfo(
includes=[cwd.join('locale.h')],
- separate_module_files=[cwd.join('locale.c')],
- export_symbols=['pypy_char2wchar', 'pypy_char2wchar_free',
- 'pypy_wchar2char', 'pypy_wchar2char_free'])
+ include_dirs=[str(cwd), cdir],
+ separate_module_files=[cwd.join('locale.c')])
def llexternal(*args, **kwargs):
kwargs.setdefault('compilation_info', eci)
diff --git a/pypy/module/_posixsubprocess/_posixsubprocess.c b/pypy/module/_posixsubprocess/_posixsubprocess.c
--- a/pypy/module/_posixsubprocess/_posixsubprocess.c
+++ b/pypy/module/_posixsubprocess/_posixsubprocess.c
@@ -1,5 +1,6 @@
/* This file is mostly a copy of CPython's Module/_posixsubprocess.c */
/* modified for PyPy: Removed dependency on Python API. */
+#include "src/precommondefs.h"
/* Authors: Gregory P. Smith & Jeffrey Yasskin */
#if defined(HAVE_PIPE2) && !defined(_GNU_SOURCE)
@@ -310,7 +311,7 @@
* This restriction is documented at
* http://www.opengroup.org/onlinepubs/009695399/functions/fork.html.
*/
-void
+RPY_EXPORTED_FOR_TESTS void
pypy_subprocess_child_exec(
char *const exec_array[],
char *const argv[],
@@ -475,7 +476,7 @@
}
-int
+RPY_EXPORTED_FOR_TESTS int
pypy_subprocess_cloexec_pipe(int *fds)
{
int res;
@@ -517,7 +518,7 @@
}
-void
+RPY_EXPORTED_FOR_TESTS void
pypy_subprocess_init(void)
{
#ifdef _SC_OPEN_MAX
diff --git a/pypy/module/_posixsubprocess/interp_subprocess.py b/pypy/module/_posixsubprocess/interp_subprocess.py
--- a/pypy/module/_posixsubprocess/interp_subprocess.py
+++ b/pypy/module/_posixsubprocess/interp_subprocess.py
@@ -3,6 +3,7 @@
from rpython.rtyper.lltypesystem import lltype, rffi
from rpython.rtyper.tool import rffi_platform as platform
+from rpython.translator import cdir
from rpython.translator.tool.cbuild import ExternalCompilationInfo
from pypy.interpreter.error import (
@@ -21,11 +22,8 @@
config = platform.configure(CConfig)
eci = ExternalCompilationInfo(
- separate_module_files=[thisdir.join('_posixsubprocess.c')],
- export_symbols=['pypy_subprocess_child_exec',
- 'pypy_subprocess_cloexec_pipe',
- 'pypy_subprocess_init',
- ])
+ include_dirs=[str(thisdir), cdir],
+ separate_module_files=[thisdir.join('_posixsubprocess.c')])
compile_extra = []
if config['HAVE_SYS_SYSCALL_H']:
diff --git a/pypy/module/posix/interp_nt.py b/pypy/module/posix/interp_nt.py
--- a/pypy/module/posix/interp_nt.py
+++ b/pypy/module/posix/interp_nt.py
@@ -2,6 +2,7 @@
from rpython.rtyper.lltypesystem import lltype, rffi
from rpython.rtyper.module.ll_win32file import make_win32_traits
from rpython.rtyper.module.support import UnicodeTraits
+from rpython.translator import cdir
from rpython.translator.tool.cbuild import ExternalCompilationInfo
@@ -21,12 +22,11 @@
"""
eci = ExternalCompilationInfo(
includes=['windows.h'],
+ include_dirs=[cdir],
post_include_bits=[
- "DWORD "
+ "RPY_EXPORTED_FOR_TESTS DWORD "
"pypy_GetFinalPathNameByHandle(FARPROC, HANDLE, LPTSTR, DWORD, DWORD);"],
- separate_module_sources=[separate_module_source],
- export_symbols=['pypy_GetFinalPathNameByHandle']
- )
+ separate_module_sources=[separate_module_source])
pypy_GetFinalPathNameByHandle = rffi.llexternal(
'pypy_GetFinalPathNameByHandle',
[rffi.VOIDP, rwin32.HANDLE, rffi.CWCHARP, rwin32.DWORD, rwin32.DWORD],
More information about the pypy-commit
mailing list