Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Somehow integrate ruby to the library. That's ... crude, but I don't feel like changi...
[simgrid.git] / src / simix / smx_context.c
index 0c13874..ac7c324 100644 (file)
 #include "xbt/log.h"
 #include "xbt/swag.h"
 #include "private.h"
+#define HAVE_RUBY /* HACK HACK */
+
+#ifdef HAVE_RUBY
+extern void SIMIX_ctx_ruby_factory_init(smx_context_factory_t *factory);
+#endif
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_context, simix, "Context switching mecanism");
 
@@ -116,7 +121,19 @@ void SIMIX_context_init_factory_by_name(smx_context_factory_t * factory,
       THROW0(not_found_error, 0, "Factory 'sysv' does not exist: no System V thread support under Windows");
   #endif
     else if (!strcmp(name, "lua"))
+#ifdef HAVE_LUA
       SIMIX_ctx_lua_factory_init(factory);
+#else
+
+    THROW0(not_found_error, 0, "Factory 'lua' does not exist: Lua support was not compiled in the SimGrid library");
+#endif /* HAVE_LUA */
+
+    else if (!strcmp(name,"ruby"))
+#ifdef HAVE_RUBY
+      SIMIX_ctx_ruby_factory_init(factory);
+#else
+     THROW0(not_found_error, 0, "Factory 'ruby' does not exist: Ruby support was not compiled in the SimGrid library");
+#endif
   else
     THROW1(not_found_error, 0, "Factory '%s' does not exist", name);
 }