File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -132,8 +132,12 @@ def ffi_managed_struct
132
132
end
133
133
end
134
134
135
- # :gtype will usually be 64-bit, but will be 32-bit on 32-bit Windows
136
- typedef :ulong , :GType
135
+ # we can't just use ulong, windows has different int sizing rules
136
+ if FFI ::Platform ::ADDRESS_SIZE == 64
137
+ typedef :uint64 , :GType
138
+ else
139
+ typedef :uint32 , :GType
140
+ end
137
141
end
138
142
139
143
module Vips
@@ -144,7 +148,11 @@ module Vips
144
148
GLib . set_log_domain ( LOG_DOMAIN )
145
149
146
150
# need to repeat this
147
- typedef :ulong , :GType
151
+ if FFI ::Platform ::ADDRESS_SIZE == 64
152
+ typedef :uint64 , :GType
153
+ else
154
+ typedef :uint32 , :GType
155
+ end
148
156
149
157
attach_function :vips_init , [ :string ] , :int
150
158
attach_function :vips_shutdown , [ ] , :void
Original file line number Diff line number Diff line change @@ -575,7 +575,12 @@ module Vips
575
575
LOG_DOMAIN = "VIPS"
576
576
GLib . set_log_domain LOG_DOMAIN
577
577
578
- typedef :ulong , :GType
578
+ # we can't just use ulong, windows has different int sizing rules
579
+ if FFI ::Platform ::ADDRESS_SIZE == 64
580
+ typedef :uint64 , :GType
581
+ else
582
+ typedef :uint32 , :GType
583
+ end
579
584
580
585
attach_function :vips_error_buffer , [ ] , :string
581
586
attach_function :vips_error_clear , [ ] , :void
You can’t perform that action at this time.
0 commit comments