From a9a4b35841fe8ae6e89838437d82bb0a681c61c5 Mon Sep 17 00:00:00 2001 From: Maz Date: Fri, 29 Oct 2010 17:42:16 -0700 Subject: [PATCH] Ensured that the C Driver will not be loaded unless the platform supports it--it will only be loaded on little endian --- lib/bson.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/bson.rb b/lib/bson.rb index 0b71a57..9099b64 100644 --- a/lib/bson.rb +++ b/lib/bson.rb @@ -45,6 +45,8 @@ else begin # Need this for running test with and without c ext in Ruby 1.9. raise LoadError if ENV['TEST_MODE'] && !ENV['C_EXT'] + #raise LoadError unless little endian + raise LoadError unless [1,0,0,0].pack("i").bytes.first==1 require 'bson_ext/cbson' raise LoadError unless defined?(CBson::VERSION) if CBson::VERSION < MINIMUM_BSON_EXT_VERSION