ffi/ffi — pull request #195 by emboss (2012-02-29 10:37:00+00:00)
Title: Allow comparison of FFI::Pointer::NULL with nil

'FFI::Pointer::NULL == nil' currently raises an ArgumentError. Trunk versions of Rubinius and JRuby return 'true' when comparing a NULL pointer with nil. This patch fixes the issue with the ArgumentError and introduces the same behavior that JRuby and Rubinius ffi support. Also added a spec for this.

Without this, trying to be platform-independent, I have to use awkward comparisons like

```ruby
if nil == ptr || ptr.null?
#do something about it
end
```

instead of a simple 'if ptr == nil'.

Regards,
Martin