|
@@ -22,6 +22,22 @@ del t
|
|
|
del _int_types
|
|
|
|
|
|
|
|
|
+def POINTER(obj):
|
|
|
+ p = ctypes.POINTER(obj)
|
|
|
+
|
|
|
+ # Convert None to a real NULL pointer to work around bugs
|
|
|
+ # in how ctypes handles None on 64-bit platforms
|
|
|
+ if not isinstance(p.from_param, classmethod):
|
|
|
+ def from_param(cls, x):
|
|
|
+ if x is None:
|
|
|
+ return cls()
|
|
|
+ else:
|
|
|
+ return x
|
|
|
+ p.from_param = classmethod(from_param)
|
|
|
+
|
|
|
+ return p
|
|
|
+
|
|
|
+
|
|
|
class UserString:
|
|
|
def __init__(self, seq):
|
|
|
if isinstance(seq, basestring):
|