Skip to content
Browse files

Improved how RUBYSDLFFI_PATH and SDL_PATHS are processed.

  • Loading branch information...
1 parent 6df08e9 commit b3e54833ff63cd95794d8b38cb1f3ccc785fdb73 @jacius jacius committed Aug 7, 2010
Showing with 6 additions and 10 deletions.
  1. +6 −10 lib/ruby-sdl-ffi/sdl.rb
View
16 lib/ruby-sdl-ffi/sdl.rb
@@ -35,21 +35,17 @@ module SDL
extend NiceFFI::Library
unless defined? SDL::LOAD_PATHS
- # Check if the application has defined SDL_PATHS with some
- # paths to check first for SDL libraries.
+ SDL::LOAD_PATHS = NiceFFI::PathSet::DEFAULT.dup
rubysdlffi_path = ENV["RUBYSDLFFI_PATH"]
if rubysdlffi_path and not rubysdlffi_path.empty?
- rubysdlffi_path = rubysdlffi_path.split( File::PATH_SEPARATOR ).compact
+ paths = rubysdlffi_path.split( File::PATH_SEPARATOR ).compact
+ SDL::LOAD_PATHS.prepend!(paths)
end
- SDL::LOAD_PATHS = if rubysdlffi_path
- NiceFFI::PathSet::DEFAULT.prepend( rubysdlffi_path )
- elsif defined? ::SDL_PATHS
- NiceFFI::PathSet::DEFAULT.prepend( ::SDL_PATHS )
- else
- NiceFFI::PathSet::DEFAULT
- end
+ if defined? ::SDL_PATHS
+ SDL::LOAD_PATHS.prepend!(::SDL_PATHS)
+ end
end
load_library "SDL", SDL::LOAD_PATHS

0 comments on commit b3e5483

Please sign in to comment.
Something went wrong with that request. Please try again.