From d75c5b8ca2f4d0be8e3f85ef788101e1630ee71b Mon Sep 17 00:00:00 2001 From: Postmodern Date: Wed, 11 May 2011 18:55:01 -0700 Subject: [PATCH] Ignore when clearenv is not found (it is not available in OSX's libc). --- lib/ffi/libc/libc.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/ffi/libc/libc.rb b/lib/ffi/libc/libc.rb index 32a6ea8..9490006 100644 --- a/lib/ffi/libc/libc.rb +++ b/lib/ffi/libc/libc.rb @@ -33,7 +33,12 @@ module LibC attach_function :getenv, [:string], :string attach_function :putenv, [:string], :int attach_function :unsetenv, [:string], :int - attach_function :clearenv, [], :int + + begin + attach_function :clearenv, [], :int + rescue FFI::NotFoundError + # clearenv is not available on OSX + end # time.h attach_function :time, [:pointer], :time_t