fix compilation after merge with YaSp branch 55/12755/1
Antoine ELIAS [Mon, 30 Sep 2013 13:49:02 +0000 (15:49 +0200)]
Change-Id: Ifda3a07e003a094d66c49c66d9305eaf0df41001

scilab/Makefile.am
scilab/modules/core/Makefile.am
scilab/modules/core/includes/vmkit.h
scilab/modules/core/src/cpp/scilab.cpp
scilab/modules/core/src/cpp/vmkit.cpp [new file with mode: 0644]

index 3a6b941..44d2bae 100644 (file)
@@ -79,6 +79,7 @@ scilab_bin_CPPFLAGS = \
 -I$(top_srcdir)/modules/localization/includes/ \
 -I$(top_srcdir)/modules/core/src/c/ \
 -I$(top_srcdir)/modules/dynamic_link/includes/ \
+$(VMKIT_CPPFLAGS) \
 $(EIGEN_CPPFLAGS) \
 $(AM_CPPFLAGS) \
 -Wno-overloaded-virtual \
index 7e4e515..b18bf54 100644 (file)
@@ -72,7 +72,9 @@ src/cpp/tasks.cpp \
 src/cpp/getvariablesname.cpp \
 src/cpp/getmacrosname.cpp \
 src/cpp/getfunctionsname.cpp \
-src/cpp/InitScilab.cpp
+src/cpp/InitScilab.cpp \
+src/cpp/vmkit.cpp 
+
 
 
 if USE_DYNAMIC_STACK
@@ -175,13 +177,8 @@ GATEWAY_CPP_SOURCES =      \
        sci_gateway/cpp/sci_mode.cpp \
        sci_gateway/cpp/sci_typename.cpp \
        sci_gateway/cpp/sci_where.cpp \
-       sci_gateway/cpp/sci_getmemory.cpp \
-       sci_gateway/cpp/sci_format.cpp \
-       sci_gateway/cpp/sci_sciargs.cpp \
-       sci_gateway/cpp/sci_ieee.cpp \
-       sci_gateway/cpp/sci_funcprot.cpp \
-       sci_gateway/cpp/sci_mode.cpp
-
+       sci_gateway/cpp/sci_getmemory.cpp  
+       
 libscicore_la_CPPFLAGS = \
 -I$(srcdir)/includes/ \
 -I$(srcdir)/src/c/ \
@@ -216,6 +213,7 @@ libscicore_la_CPPFLAGS = \
 -I$(top_srcdir)/modules/graphics/includes/ \
 -I$(top_srcdir)/modules/system_env/includes/ \
 -I$(top_srcdir)/modules/jit/includes/ \
+$(VMKIT_CPPFLAGS) \
 $(EIGEN_CPPFLAGS) \
 $(XML_FLAGS) \
 $(AM_CPPFLAGS) \
index d32a310..acd8167 100644 (file)
@@ -1,8 +1,22 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2013-2013 - LIP6 - Peter Senna Tschudin
+ *
+ *  This file must be used under the terms of the CeCILL.
+ *  This source file is licensed as described in the file COPYING, which
+ *  you should have received as part of this distribution.  The terms
+ *  are also available at
+ *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
 #include "MutatorThread.h"
 #include "vmkit/System.h"
 #include "vmkit/Locks.h"
 #include "vmkit/Thread.h"
 #include "vmkit/VirtualMachine.h"
+#include "InitScilab.h"
+
 
 namespace VMKitScilab
 {
@@ -11,16 +25,12 @@ class ScilabVM;
 class ScilabThread : public vmkit::MutatorThread
 {
 private:
-    int argc, iFileIndex, iLangIndex, ret;
-    char **argv;
+    ScilabEngineInfo* pSEI;
 
 public:
-    void setArgs(int argc, char** argv, int iFileIndex, int iLangIndex);
+    void setArgs(ScilabEngineInfo* _pSEI);
     void setret(int ret);
-    int getargc();
-    int getiFileIndex();
-    int getiLangIndex();
-    char **getargv();
+    ScilabEngineInfo* getArgs();
     int getret();
 
     ScilabThread (ScilabVM* vm);
@@ -63,7 +73,7 @@ public:
 
     virtual void runApplication(int argc, char** argv) {}
 
-    virtual void runApplication(int argc, char** argv, int iFileIndex, int iLangIndex);
+    virtual void runApplication(ScilabEngineInfo *_pSEI);
 
     virtual void nullPointerException() {}
     virtual void stackOverflowError() {}
index f329172..65aaa10 100644 (file)
@@ -86,9 +86,6 @@ static int get_option(const int argc, char *argv[], ScilabEngineInfo* _pSEI)
 
     bool ASTrunVMKit = false;
 
-    using symbol::Context;
-    using std::string;
-
     for (i = 1; i < argc; ++i)
     {
         if (!strcmp("--parse-trace", argv[i]))
@@ -155,10 +152,10 @@ static int get_option(const int argc, char *argv[], ScilabEngineInfo* _pSEI)
             if (argc >= i)
             {
                 _pSEI->pstLang = argv[i];
-                //before calling YaspReader, try to call %onprompt function
+/*                //before calling YaspReader, try to call %onprompt function
                 callOnPrompt();
                 execAstTask(parser->getTree(), timed, ASTtimed, execVerbose, ASTrunVMKit);
-            }
+*/            }
         }
         else if (!strcmp("-nw", argv[i]))
         {
@@ -179,13 +176,6 @@ static int get_option(const int argc, char *argv[], ScilabEngineInfo* _pSEI)
         }
     }
 
-#ifdef DEBUG
-    if (*_piFileIndex >= 0)
-    {
-        std::cerr << "File : " << argv[*_piFileIndex] << std::endl;
-    }
-#endif
-
     ConfigVariable::setCommandLineArgs(argc, argv);
     return 0;
 }
@@ -207,85 +197,6 @@ static void TermPrintf(char *text)
     printf("%s", text);
 }
 
-#if defined(VMKIT_ENABLED)
-namespace VMKitScilab
-{
-void ScilabThread::setArgs(int argc, char** argv, int iFileIndex, int iLangIndex)
-{
-    this->argc = argc;
-    this->argv = argv;
-    this->iFileIndex = iFileIndex;
-    this->iLangIndex = iLangIndex;
-}
-void ScilabThread::setret(int ret)
-{
-    this->ret = ret;
-}
-int ScilabThread::getargc()
-{
-    return argc;
-}
-int ScilabThread::getiFileIndex()
-{
-    return iFileIndex;
-}
-int ScilabThread::getiLangIndex()
-{
-    return iLangIndex;
-}
-char **ScilabThread::getargv()
-{
-    return argv;
-}
-int ScilabThread::getret()
-{
-    return ret;
-}
-ScilabThread::ScilabThread (ScilabVM* vm) : vmkit::MutatorThread()
-{
-    MyVM = (vmkit::VirtualMachine*)vm;
-}
-ScilabVM* ScilabThread::vm()
-{
-    return (ScilabVM *)MyVM;
-}
-void ScilabThread::execute()
-{
-    setret(StartScilabEngine(getargc(), getargv(), getiFileIndex(), getiLangIndex()));
-}
-
-void ScilabVM::mainStart(ScilabThread* thread)
-{
-    ScilabVM* vm = thread->vm();
-    printf("\nVMKitThread: Create\n\n");
-
-    thread->execute();
-
-    vm->setret(thread->getret());
-
-    printf("\nVMKitThread: Exit\n\n");
-    vm->exit();
-}
-void ScilabVM::runApplication(int argc, char** argv, int iFileIndex, int iLangIndex)
-{
-    VMKitScilab::ScilabThread * mainThread = new VMKitScilab::ScilabThread(this);
-
-    mainThread->setArgs(argc, argv, iFileIndex, iLangIndex);
-
-    mainThread->start((void (*)(vmkit::Thread *))mainStart);
-}
-
-int ScilabVM::getret()
-{
-    return ret;
-}
-
-void ScilabVM::setret(int ret)
-{
-    this->ret = ret;
-}
-}
-#endif
 
 /*
 ** -*- MAIN -*-
@@ -366,19 +277,18 @@ int main(int argc, char *argv[])
 
     VMKitScilab::ScilabVM* vm = new(Allocator, "VM") VMKitScilab::ScilabVM (Allocator, frametables);
 
-    vm->runApplication(argc, argv, iFileIndex, iLangIndex);
+    vm->runApplication(pSEI);
 
     vm->waitForExit();
 
     return vm->getret();
 
 #else
-    return StartScilabEngine(argc, argv, iFileIndex, iLangIndex);
-#endif // ifdef VMKIT_ENABLED
-#endif // defined(WITHOUT_GUI)
-
     StartScilabEngine(pSEI);
     iRet = RunScilabEngine(pSEI);
     StopScilabEngine(pSEI);
     return iRet;
+#endif // ifdef VMKIT_ENABLED
+#endif // defined(WITHOUT_GUI)
+
 }
diff --git a/scilab/modules/core/src/cpp/vmkit.cpp b/scilab/modules/core/src/cpp/vmkit.cpp
new file mode 100644 (file)
index 0000000..34e6ba6
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2013-2013 - LIP6 - Peter Senna Tschudin
+ *
+ *  This file must be used under the terms of the CeCILL.
+ *  This source file is licensed as described in the file COPYING, which
+ *  you should have received as part of this distribution.  The terms
+ *  are also available at
+ *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#if defined(VMKIT_ENABLED)
+namespace VMKitScilab
+{
+void ScilabThread::setArgs(ScilabEngineInfo* _pSEI)
+{
+    this->pSEI = _pSEI;
+}
+
+void ScilabThread::setret(int ret)
+{
+    this->ret = ret;
+}
+
+int ScilabThread::getArgs()
+{
+    return pSEI;
+}
+
+int ScilabThread::getret()
+{
+    return ret;
+}
+
+ScilabThread::ScilabThread (ScilabVM* vm) : vmkit::MutatorThread()
+{
+    MyVM = (vmkit::VirtualMachine*)vm;
+}
+
+ScilabVM* ScilabThread::vm()
+{
+    return (ScilabVM *)MyVM;
+}
+
+void ScilabThread::execute()
+{
+    setret(StartScilabEngine(getargc(), getargv(), getiFileIndex(), getiLangIndex()));
+}
+
+void ScilabVM::mainStart(ScilabThread* thread)
+{
+    ScilabVM* vm = thread->vm();
+    printf("\nVMKitThread: Create\n\n");
+
+    thread->execute();
+
+    vm->setret(thread->getret());
+
+    printf("\nVMKitThread: Exit\n\n");
+    vm->exit();
+}
+
+void ScilabVM::runApplication(ScilabEngineInfo* _pSEI)
+{
+    VMKitScilab::ScilabThread * mainThread = new VMKitScilab::ScilabThread(this);
+
+    mainThread->setArgs(_pSEI);
+
+    mainThread->start((void (*)(vmkit::Thread *))mainStart);
+}
+
+int ScilabVM::getret()
+{
+    return ret;
+}
+
+void ScilabVM::setret(int ret)
+{
+    this->ret = ret;
+}
+
+}
+#endif