summaryrefslogtreecommitdiff
path: root/testing/cffi0/snippets/setuptools_module/snip_setuptools_verify.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/cffi0/snippets/setuptools_module/snip_setuptools_verify.py')
-rw-r--r--testing/cffi0/snippets/setuptools_module/snip_setuptools_verify.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/testing/cffi0/snippets/setuptools_module/snip_setuptools_verify.py b/testing/cffi0/snippets/setuptools_module/snip_setuptools_verify.py
new file mode 100644
index 0000000..e8a867e
--- /dev/null
+++ b/testing/cffi0/snippets/setuptools_module/snip_setuptools_verify.py
@@ -0,0 +1,17 @@
+
+from cffi import FFI
+import sys
+
+ffi = FFI()
+ffi.cdef(""" // some declarations from the man page
+ struct passwd {
+ char *pw_name;
+ ...;
+ };
+ struct passwd *getpwuid(int uid);
+""")
+C = ffi.verify(""" // passed to the real C compiler
+#include <sys/types.h>
+#include <pwd.h>
+""", libraries=[], # or a list of libraries to link with
+ force_generic_engine=hasattr(sys, '_force_generic_engine_'))