lib/ffi-gdal/major_object.rb in ffi-gdal-0.0.3 vs lib/ffi-gdal/major_object.rb in ffi-gdal-0.0.4
- old
+ new
@@ -5,9 +5,14 @@
module MajorObject
include FFI::GDAL
# @return [Array<String>]
def metadata_domain_list
+ unless defined? FFI::GDAL::GDALGetMetadataDomainList
+ warn "GDALGetMetadataDomainList is't defined. GDAL::MajorObject#metadata_domain_list disabled."
+ return []
+ end
+
# I don't quite get it, but if #GDALGetMetadataDomainList isn't called
# twice, the last domain in the list sometimes doesn't get read.
GDALGetMetadataDomainList(c_pointer)
list_pointer = GDALGetMetadataDomainList(c_pointer)
return [] if list_pointer.null?