File: ctypes-codegen.patch

package info (click to toggle)
teem 1.12.0~20160122-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,444 kB
  • sloc: ansic: 152,549; python: 10,748; perl: 281; sh: 58; makefile: 41; cpp: 26
file content (20 lines) | stat: -rw-r--r-- 1,068 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Index: ctypeslib-gccxml-0.9/ctypeslib/codegen/codegenerator.py
===================================================================
--- ctypeslib-gccxml-0.9/ctypeslib/codegen/codegenerator.py	(revision 75605)
+++ ctypeslib-gccxml-0.9/ctypeslib/codegen/codegenerator.py	(working copy)
@@ -451,6 +451,15 @@
         self._variables += 1
         if tp.init is None:
             # wtypes.h contains IID_IProcessInitControl, for example
+            dllname = self.find_dllname(tp)
+            if dllname:
+                libname = self.get_sharedlib(dllname, "cdecl")
+                self.generate(tp.typ)
+                print >> self.stream, "%s = (%s).in_dll(%s, %r)" % (tp.name,
+                                                                    self.type_name(tp.typ, True),
+                                                                    libname,
+                                                                    tp.name)
+                self.names.add(tp.name)
             return
         try:
             value = self.initialize(tp.typ, tp.init)