Implements fix for pointers on 32 bit devices

* mirrors: https://github.com/infinitered/rmq/pull/209
This commit is contained in:
David Larrabee
2015-03-20 08:34:52 -04:00
parent e2bf806ee6
commit ce67c6d2af

View File

@@ -1,7 +1,12 @@
class UIColor
def with(options)
r, g, b, a = Pointer.new('d'), Pointer.new('d'), Pointer.new('d'), Pointer.new('d')
self.getRed(r, green: g, blue: b, alpha: a)
begin
r, g, b, a = Pointer.new('d'), Pointer.new('d'), Pointer.new('d'), Pointer.new('d')
self.getRed(r, green: g, blue: b, alpha: a)
rescue
r, g, b, a = Pointer.new('f'), Pointer.new('f'), Pointer.new('f'), Pointer.new('f')
self.getRed(r, green: g, blue: b, alpha: a)
end
r = options[:r] || options[:red] || r.value
g = options[:g] || options[:green] || g.value