Permalink
Browse files

Ignore when clearenv is not found (it is not available in OSX's libc).

  • Loading branch information...
1 parent d309512 commit d75c5b8ca2f4d0be8e3f85ef788101e1630ee71b @postmodern committed May 12, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/ffi/libc/libc.rb
View
@@ -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

0 comments on commit d75c5b8

Please sign in to comment.