public void load(final Ruby runtime, boolean wrap) throws IOException { if (!runtime.getInstanceConfig().isNativeEnabled()) { throw runtime.newLoadError("Native API access is disabled"); } if (!Platform.getPlatform().isSupported()) { throw runtime.newLoadError("Unsupported platform: " + Platform.getPlatform().getName()); } RubyModule ffi = runtime.defineModule("FFI"); try { Factory.getInstance().init(runtime, ffi); } catch (Exception e) { throw runtime.newLoadError("Could not load FFI Provider: " + e.getLocalizedMessage() + " See http://jira.codehaus.org/browse/JRUBY-4583"); } } }
public void load(final Ruby runtime, boolean wrap) throws IOException { if (!runtime.getInstanceConfig().isNativeEnabled()) { throw runtime.newLoadError("Native API access is disabled"); } if (!Platform.getPlatform().isSupported()) { throw runtime.newLoadError("Unsupported platform: " + Platform.getPlatform().getName()); } RubyModule ffi = runtime.defineModule("FFI"); try { Factory.getInstance().init(runtime, ffi); } catch (Exception e) { throw runtime.newLoadError("Could not load FFI Provider: " + e.getLocalizedMessage() + " See http://jira.codehaus.org/browse/JRUBY-4583"); } } }
public void load(final Ruby runtime, boolean wrap) throws IOException { if (!runtime.getInstanceConfig().isNativeEnabled()) { throw runtime.newLoadError("Native API access is disabled"); } if (!Platform.getPlatform().isSupported()) { throw runtime.newLoadError("Unsupported platform: " + Platform.getPlatform().getName()); } RubyModule ffi = runtime.defineModule("FFI"); try { Factory.getInstance().init(runtime, ffi); } catch (Exception e) { throw runtime.newLoadError("Could not load FFI Provider: " + e.getLocalizedMessage() + " See http://jira.codehaus.org/browse/JRUBY-4583"); } } }
public void load(final Ruby runtime, boolean wrap) throws IOException { if (!runtime.getInstanceConfig().isNativeEnabled()) { throw runtime.newLoadError("Native API access is disabled"); } if (!Platform.getPlatform().isSupported()) { throw runtime.newLoadError("Unsupported platform: " + Platform.getPlatform().getName()); } RubyModule ffi = runtime.defineModule("FFI"); try { Factory.getInstance().init(runtime, ffi); } catch (Exception e) { throw runtime.newLoadError("Could not load FFI Provider: " + e.getLocalizedMessage() + " See http://jira.codehaus.org/browse/JRUBY-4583"); } } }
@Override public void init(Ruby runtime, RubyModule ffi) { super.init(runtime, ffi); synchronized (ffi) { if (ffi.getClass("DynamicLibrary") == null) { DynamicLibrary.createDynamicLibraryClass(runtime, ffi); } if (ffi.getClass("Invoker") == null) { JFFIInvoker.createInvokerClass(runtime, ffi); } if (ffi.getClass("VariadicInvoker") == null) { VariadicInvoker.createVariadicInvokerClass(runtime, ffi); } if (ffi.getClass("Callback") == null) { CallbackManager.createCallbackClass(runtime, ffi); } if (ffi.getClass("Function") == null) { Function.createFunctionClass(runtime, ffi); } if (ffi.getClass("LastError") == null) { ffi.defineModuleUnder("LastError").defineAnnotatedMethods(LastError.class); } } runtime.setFFI(new FFI(ffi)); }
@Override public void init(Ruby runtime, RubyModule ffi) { super.init(runtime, ffi); synchronized (ffi) { if (ffi.getClass("DynamicLibrary") == null) { DynamicLibrary.createDynamicLibraryClass(runtime, ffi); } if (ffi.getClass("Invoker") == null) { JFFIInvoker.createInvokerClass(runtime, ffi); } if (ffi.getClass("VariadicInvoker") == null) { VariadicInvoker.createVariadicInvokerClass(runtime, ffi); } if (ffi.getClass("Callback") == null) { CallbackManager.createCallbackClass(runtime, ffi); } if (ffi.getClass("Function") == null) { Function.createFunctionClass(runtime, ffi); } if (ffi.getClass("LastError") == null) { ffi.defineModuleUnder("LastError").defineAnnotatedMethods(LastError.class); } } runtime.setFFI(new FFI(ffi)); }
@Override public void init(Ruby runtime, RubyModule ffi) { super.init(runtime, ffi); synchronized (ffi) { if (ffi.getClass("DynamicLibrary") == null) { DynamicLibrary.createDynamicLibraryClass(runtime, ffi); } if (ffi.getClass("Invoker") == null) { JFFIInvoker.createInvokerClass(runtime, ffi); } if (ffi.getClass("VariadicInvoker") == null) { VariadicInvoker.createVariadicInvokerClass(runtime, ffi); } if (ffi.getClass("Callback") == null) { CallbackManager.createCallbackClass(runtime, ffi); } if (ffi.getClass("Function") == null) { Function.createFunctionClass(runtime, ffi); } if (ffi.getClass("LastError") == null) { ffi.defineModuleUnder("LastError").defineAnnotatedMethods(LastError.class); } } runtime.setFFI(new FFI(ffi)); }
@Override public void init(Ruby runtime, RubyModule ffi) { super.init(runtime, ffi); synchronized (ffi) { if (ffi.getClass("DynamicLibrary") == null) { DynamicLibrary.createDynamicLibraryClass(runtime, ffi); } if (ffi.getClass("Invoker") == null) { JFFIInvoker.createInvokerClass(runtime, ffi); } if (ffi.getClass("VariadicInvoker") == null) { VariadicInvoker.createVariadicInvokerClass(runtime, ffi); } if (ffi.getClass("Callback") == null) { CallbackManager.createCallbackClass(runtime, ffi); } if (ffi.getClass("Function") == null) { Function.createFunctionClass(runtime, ffi); } if (ffi.getClass("LastError") == null) { ffi.defineModuleUnder("LastError").defineAnnotatedMethods(LastError.class); } } runtime.setFFI(new FFI(ffi)); }