Author: Armin Rigo <[email protected]>
Branch:
Changeset: r2353:613c9d67d629
Date: 2015-10-21 11:04 +0200
http://bitbucket.org/cffi/cffi/changeset/613c9d67d629/
Log: Backed out changeset fbe55ed7e5e2
It's probably better written in the docs instead.
diff --git a/cffi/cparser.py b/cffi/cparser.py
--- a/cffi/cparser.py
+++ b/cffi/cparser.py
@@ -29,8 +29,6 @@
_r_stdcall1 = re.compile(r"\b(__stdcall|WINAPI)\b")
_r_stdcall2 = re.compile(r"[(]\s*(__stdcall|WINAPI)\b")
_r_cdecl = re.compile(r"\b__cdecl\b")
-_r_SAL = re.compile(r"([(,]\s*)(_In_|_Inout_|_Out_|_Outptr_|"
- r"_In_opt_|_Inout_opt_|_Out_opt_|_Outptr_opt_)\b")
def _get_parser():
global _parser_cache
@@ -57,8 +55,6 @@
csource = _r_stdcall2.sub(' volatile volatile const(', csource)
csource = _r_stdcall1.sub(' volatile volatile const ', csource)
csource = _r_cdecl.sub(' ', csource)
- if sys.platform == 'win32':
- csource = _r_SAL.sub(r'\1 ', csource)
# Replace "[...]" with "[__dotdotdotarray__]"
csource = _r_partial_array.sub('[__dotdotdotarray__]', csource)
# Replace "...}" with "__dotdotdotNUM__}". This construction should
diff --git a/doc/source/whatsnew.rst b/doc/source/whatsnew.rst
--- a/doc/source/whatsnew.rst
+++ b/doc/source/whatsnew.rst
@@ -32,12 +32,6 @@
which had unwanted side-effects. Try saying ``import setuptools``
first, which patches distutils...
-* Windows: basic SAL annotations can be given in the cdef() and are
- ignored. More precisely, ``_In_``, ``_Inout_``, ``_Out_``,
- ``_Outptr_``, ``In_opt_``, ``_Inout_opt_``, ``_Out_opt_`` and
- ``_Outptr_opt_`` are ignored if they are following a ``(`` or a
- ``,`` (which is where function parameters are).
-
.. _`ffi.memmove()`: using.html#memmove
.. __: https://bugs.python.org/issue23246
.. __:
https://bitbucket.org/cffi/cffi/pull-requests/65/remove-_hack_at_distutils-which-imports/diff
diff --git a/testing/cffi0/test_parsing.py b/testing/cffi0/test_parsing.py
--- a/testing/cffi0/test_parsing.py
+++ b/testing/cffi0/test_parsing.py
@@ -384,10 +384,3 @@
"<ctype 'int(*)(int(%s*)(int), "
"long(*)(), "
"short(%s*)(short))'>" % (stdcall, stdcall))
-
-def test_basic_SAL_annotations_on_windows():
- if sys.platform != 'win32':
- py.test.skip("Only for Windows")
- ffi = FFI()
- tp = ffi.typeof("int(*)(_In_ int *abc, _Out_opt_ int *bcd)")
- assert str(tp) == "<ctype 'int(*)(int *, int *)'>"
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit