Skip to content

Commit 4059f4c

Browse files
committed
properly infer functions that return char* on platforms with unsigned chars
1 parent 2acfbdb commit 4059f4c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

pixie/ffi-infer.pxi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,10 @@ return 0;
9797

9898
(defmethod edn-to-ctype :pointer
9999
[{:keys [of-type] :as ptr} in-struct?]
100+
(println ptr in-struct?)
100101
(cond
101-
(and (= of-type {:signed? true :size 1 :type :int})
102+
(and (= (:size of-type) 1)
103+
(= (:type of-type) :int)
102104
(not in-struct?)) 'pixie.stdlib/CCharP
103105
(= (:type of-type) :function) (callback-type of-type in-struct?)
104106
:else 'pixie.stdlib/CVoidP))

0 commit comments

Comments
 (0)