From 491fd7cc5aefff8064039d073331b41a2f606a63 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Tue, 27 Jun 2017 11:15:37 -1000 Subject: Funcs macros gone (#3695) * No more FUNCS/MACROS distinction * change the docs to not talk about MACROS since they're gone * remove out of date comment --- src/_cffi_src/utils.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/_cffi_src/utils.py') diff --git a/src/_cffi_src/utils.py b/src/_cffi_src/utils.py index 3a4dd773..d3dd18a4 100644 --- a/src/_cffi_src/utils.py +++ b/src/_cffi_src/utils.py @@ -18,8 +18,7 @@ def build_ffi_for_binding(module_name, module_prefix, modules, libraries=[], * ``INCLUDES``: A string containing C includes. * ``TYPES``: A string containing C declarations for types. - * ``FUNCTIONS``: A string containing C declarations for functions. - * ``MACROS``: A string containing C declarations for any macros. + * ``FUNCTIONS``: A string containing C declarations for functions & macros. * ``CUSTOMIZATIONS``: A string containing arbitrary top-level C code, this can be used to do things like test for a define and provide an alternate implementation based on that. @@ -27,34 +26,23 @@ def build_ffi_for_binding(module_name, module_prefix, modules, libraries=[], types = [] includes = [] functions = [] - macros = [] customizations = [] for name in modules: __import__(module_prefix + name) module = sys.modules[module_prefix + name] types.append(module.TYPES) - macros.append(module.MACROS) functions.append(module.FUNCTIONS) includes.append(module.INCLUDES) customizations.append(module.CUSTOMIZATIONS) - # We include functions here so that if we got any of their definitions - # wrong, the underlying C compiler will explode. In C you are allowed - # to re-declare a function if it has the same signature. That is: - # int foo(int); - # int foo(int); - # is legal, but the following will fail to compile: - # int foo(int); - # int foo(short); verify_source = "\n".join( includes + - functions + customizations ) ffi = build_ffi( module_name, - cdef_source="\n".join(types + functions + macros), + cdef_source="\n".join(types + functions), verify_source=verify_source, libraries=libraries, extra_compile_args=extra_compile_args, -- cgit v1.2.3