summaryrefslogtreecommitdiff
path: root/src/modcontext.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2014-01-03 18:17:58 (GMT)
committerMarius Kintel <marius@kintel.net>2014-01-03 18:17:58 (GMT)
commitbee5233a916055d41bb4ee425f5df25b80f50f16 (patch)
tree7bfac9716f778ed685e62e2d0830d1905bc08fd2 /src/modcontext.cc
parentf093b53c3edb08ee0d64c5d6c2a1df723acfca2d (diff)
parentc5223417e3ffe965d09d971865797206080eb0ae (diff)
Merge branch 'vector-concat' of git://github.com/t-paul/openscad into t-paul-vector-concat
Conflicts: src/Preferences.ui
Diffstat (limited to 'src/modcontext.cc')
-rw-r--r--src/modcontext.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/modcontext.cc b/src/modcontext.cc
index 7941cf5..21b04fd 100644
--- a/src/modcontext.cc
+++ b/src/modcontext.cc
@@ -95,7 +95,12 @@ void ModuleContext::registerBuiltin()
const AbstractFunction *ModuleContext::findLocalFunction(const std::string &name) const
{
if (this->functions_p && this->functions_p->find(name) != this->functions_p->end()) {
- return this->functions_p->find(name)->second;
+ AbstractFunction *f = this->functions_p->find(name)->second;
+ if (!f->is_enabled()) {
+ PRINTB("WARNING: Experimental builtin function '%s' is not enabled.", name);
+ return NULL;
+ }
+ return f;
}
return NULL;
}
@@ -104,6 +109,10 @@ const AbstractModule *ModuleContext::findLocalModule(const std::string &name) co
{
if (this->modules_p && this->modules_p->find(name) != this->modules_p->end()) {
AbstractModule *m = this->modules_p->find(name)->second;
+ if (!m->is_enabled()) {
+ PRINTB("WARNING: Experimental builtin module '%s' is not enabled.", name);
+ return NULL;
+ }
std::string replacement = Builtins::instance()->isDeprecated(name);
if (!replacement.empty()) {
PRINTB("DEPRECATED: The %s() module will be removed in future releases. Use %s() instead.", name % replacement);
contact: Jan Huwald // Impressum