// +build !linux,!darwin !cgo

package imports

import (
	"github.com/nitrogen-lang/nitrogen/src/eval"
	"github.com/nitrogen-lang/nitrogen/src/object"
	"github.com/nitrogen-lang/nitrogen/src/vm"
)

func init() {
	eval.RegisterBuiltin("module", importModule)
	eval.RegisterBuiltin("modulesSupported", moduleSupport)

	vm.RegisterBuiltin("module", importModule)
	vm.RegisterBuiltin("modulesSupported", moduleSupport)
}

func importModule(i object.Interpreter, env *object.Environment, args ...object.Object) object.Object {
	return object.NewException("Shared object modules are not supported in this build")
}

func moduleSupport(i object.Interpreter, env *object.Environment, args ...object.Object) object.Object {
	return object.NativeBoolToBooleanObj(false)
}

// +build !linux,!darwin !cgo

package imports

import (
	"github.com/nitrogen-lang/nitrogen/src/eval"
	"github.com/nitrogen-lang/nitrogen/src/moduleutils"
	"github.com/nitrogen-lang/nitrogen/src/object"
	"github.com/nitrogen-lang/nitrogen/src/vm"
)

func init() {
	eval.RegisterBuiltin("module", importModule)
	eval.RegisterBuiltin("modulesSupported", moduleSupport)

	vm.RegisterBuiltin("module", moduleutils.VMBuiltinWrapper(importModule))
	vm.RegisterBuiltin("modulesSupported", moduleutils.VMBuiltinWrapper(moduleSupport))
}

func importModule(i object.Interpreter, env *object.Environment, args ...object.Object) object.Object {
	return object.NewException("Shared object modules are not supported in this build")
}

func moduleSupport(i object.Interpreter, env *object.Environment, args ...object.Object) object.Object {
	return object.NativeBoolToBooleanObj(false)
}

--- 
+++ 
@@ -4,7 +4,6 @@
 
 import (
 	"github.com/nitrogen-lang/nitrogen/src/eval"
-	"github.com/nitrogen-lang/nitrogen/src/moduleutils"
 	"github.com/nitrogen-lang/nitrogen/src/object"
 	"github.com/nitrogen-lang/nitrogen/src/vm"
 )
@@ -13,8 +12,8 @@
 	eval.RegisterBuiltin("module", importModule)
 	eval.RegisterBuiltin("modulesSupported", moduleSupport)
 
-	vm.RegisterBuiltin("module", moduleutils.VMBuiltinWrapper(importModule))
-	vm.RegisterBuiltin("modulesSupported", moduleutils.VMBuiltinWrapper(moduleSupport))
+	vm.RegisterBuiltin("module", importModule)
+	vm.RegisterBuiltin("modulesSupported", moduleSupport)
 }
 
 func importModule(i object.Interpreter, env *object.Environment, args ...object.Object) object.Object {
Remove VM wrapper from module import stub
