]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
32-bit compatibility for Python SWIG bindings 233/head
authorFlorian Weimer <fweimer@redhat.com>
Fri, 26 Jan 2024 10:57:03 +0000 (11:57 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 26 Jan 2024 10:57:03 +0000 (11:57 +0100)
The ssize_t type can be int instead of long, and the pointer
types are incompatible.

contrib/python/ldns.i

index 881ba5e858a73f5f8d7149d8190fb549c4e77506..b4a740820e120bfd863e88fce0c28ca54cb4f4be 100644 (file)
 %typemap(in, noblock=1) (ssize_t)
 {
   int $1_res = 0;
-  $1_res = SWIG_AsVal_long($input, &$1);
+  long val;
+  $1_res = SWIG_AsVal_long($input, &val);
   if (!SWIG_IsOK($1_res)) {
     SWIG_exception_fail(SWIG_ArgError($1_res), "in method '"
       "$symname" "', argument " "$argnum" " of type '"
       "$type""'");
   }
+  $1 = val;
 }