summaryrefslogtreecommitdiff
diff options
-rw-r--r--spec/mspec/lib/mspec/runner/actions/leakchecker.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/mspec/lib/mspec/runner/actions/leakchecker.rb b/spec/mspec/lib/mspec/runner/actions/leakchecker.rb
index 9cf5cefa3f..71797b9815 100644
--- a/spec/mspec/lib/mspec/runner/actions/leakchecker.rb
+++ b/spec/mspec/lib/mspec/runner/actions/leakchecker.rb
@@ -345,10 +345,13 @@ class LeakCheckerAction
begin
libc = Fiddle.dlopen(nil)
+ # Older versions of fiddle don't have Fiddle::Type (and instead rely on Fiddle::TYPE_)
+ # Even older versions of fiddle don't have CONST_STRING,
+ string_type = defined?(Fiddle::TYPE_CONST_STRING) ? Fiddle::TYPE_CONST_STRING : Fiddle::TYPE_VOIDP
nss_configure_lookup = Fiddle::Function.new(
libc['__nss_configure_lookup'],
- [Fiddle::Types::CONST_STRING, Fiddle::Types::CONST_STRING],
- Fiddle::Types::INT
+ [string_type, string_type],
+ Fiddle::TYPE_INT
)
rescue Fiddle::DLError
# We're not running with glibc - no need to do this.