Skip to content

Commit

Permalink
Ignore when clearenv is not found (it is not available in OSX's libc).
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed May 12, 2011
1 parent d309512 commit d75c5b8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/ffi/libc/libc.rb
Expand Up @@ -33,7 +33,12 @@ module LibC
attach_function :getenv, [:string], :string attach_function :getenv, [:string], :string
attach_function :putenv, [:string], :int attach_function :putenv, [:string], :int
attach_function :unsetenv, [: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 # time.h
attach_function :time, [:pointer], :time_t attach_function :time, [:pointer], :time_t
Expand Down

0 comments on commit d75c5b8

Please sign in to comment.