summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine ELIAS <antoine.elias@scilab-enterprises.com>2016-11-10 08:35:10 +0100
committerAntoine ELIAS <antoine.elias@scilab-enterprises.com>2016-11-10 08:35:10 +0100
commit9a0b127082e2395fd922c459e66763809a2f941e (patch)
tree87062a1f06fb9c3f5f8533b524299587408db916
parentd45ae4b8bc18b259999263ed090d8a1d879e35e0 (diff)
downloadscilab-9a0b127082e2395fd922c459e66763809a2f941e.zip
scilab-9a0b127082e2395fd922c459e66763809a2f941e.tar.gz
utf: dynamic_link 2
Change-Id: I60581fed0b5c58612a0f310e28abecd3cb9082d0
-rw-r--r--scilab/modules/dynamic_link/macros/ilib_gen_gateway.sci19
-rw-r--r--scilab/modules/dynamic_link/sci_gateway/cpp/sci_link.cpp4
-rw-r--r--scilab/modules/dynamic_link/src/cpp/dynamic_link.cpp1
3 files changed, 11 insertions, 13 deletions
diff --git a/scilab/modules/dynamic_link/macros/ilib_gen_gateway.sci b/scilab/modules/dynamic_link/macros/ilib_gen_gateway.sci
index 6b3d466..34bb1dd 100644
--- a/scilab/modules/dynamic_link/macros/ilib_gen_gateway.sci
+++ b/scilab/modules/dynamic_link/macros/ilib_gen_gateway.sci
@@ -86,17 +86,16 @@ function gateway_filename = ilib_gen_gateway(name,tables)
86 "#include """ + tname + ".h"""; 86 "#include """ + tname + ".h""";
87 "}"; 87 "}";
88 ""; 88 "";
89 "#define MODULE_NAME L""" + tname + """"; 89 "#define MODULE_NAME """ + tname + """";
90 ""; 90 "";
91 "int " + tname + "(wchar_t* _pwstFuncName)"; 91 "int " + tname + "(const char* _pstFuncName)";
92 "{"; 92 "{";
93 " if(wcscmp(_pwstFuncName, L""" + table(:,1) + """) == 0){ " + "symbol::Context::getInstance()->addFunction(types::Function::createFunction(L""" + table(:,1) + """, &" + names(:) + ", MODULE_NAME)); }"; 93 " if(strcmp(_pstFuncName, """ + table(:,1) + """) == 0){ " + "symbol::Context::getInstance()->addFunction(types::Function::createFunction(""" + table(:,1) + """, &" + names(:) + ", MODULE_NAME)); }";
94 ""; 94 "";
95 " return 1;"; 95 " return 1;";
96 "}"]; 96 "}"];
97 else 97 else
98 t = [ 98 t = [
99 "#include <wchar.h>";
100 "#include """ + tname + ".hxx"""; 99 "#include """ + tname + ".hxx""";
101 "extern ""C"""; 100 "extern ""C""";
102 "{"; 101 "{";
@@ -104,21 +103,21 @@ function gateway_filename = ilib_gen_gateway(name,tables)
104 "#include ""addfunction.h"""; 103 "#include ""addfunction.h""";
105 "}"; 104 "}";
106 ""; 105 "";
107 "#define MODULE_NAME L""" + tname + """"; 106 "#define MODULE_NAME """ + tname + """";
108 ""; 107 "";
109 "int " + tname + "(wchar_t* _pwstFuncName)"; 108 "int " + tname + "(char* _pstFuncName)";
110 "{";]; 109 "{";];
111 110
112 for kGw = 1:size(names, "*") 111 for kGw = 1:size(names, "*")
113 if or(table(kGw, 3) == ["cmex" "fmex" "Fmex"]) then 112 if or(table(kGw, 3) == ["cmex" "fmex" "Fmex"]) then
114 t = [t; 113 t = [t;
115 " if(wcscmp(_pwstFuncName, L""" + table(kGw,1) + """) == 0){ " + "addMexFunction(L""" + table(kGw,1) + """, &" + names(kGw) + ", MODULE_NAME); }"]; 114 " if(strcmp(_pstFuncName, """ + table(kGw,1) + """) == 0){ " + "addMexFunction(""" + table(kGw,1) + """, &" + names(kGw) + ", MODULE_NAME); }"];
116 elseif table(kGw, 3) == "csci6" then 115 elseif table(kGw, 3) == "csci6" then
117 t = [t; 116 t = [t;
118 " if(wcscmp(_pwstFuncName, L""" + table(kGw,1) + """) == 0){ " + "addCFunction(L""" + table(kGw,1) + """, &" + names(kGw) + ", MODULE_NAME); }"]; 117 " if(strcmp(_pstFuncName, """ + table(kGw,1) + """) == 0){ " + "addCFunction(""" + table(kGw,1) + """, &" + names(kGw) + ", MODULE_NAME); }"];
119 else 118 else
120 t = [t; 119 t = [t;
121 " if(wcscmp(_pwstFuncName, L""" + table(kGw,1) + """) == 0){ " + "addCStackFunction(L""" + table(kGw,1) + """, &" + names(kGw) + ", MODULE_NAME); }"]; 120 " if(strcmp(_pstFuncName, """ + table(kGw,1) + """) == 0){ " + "addCStackFunction(""" + table(kGw,1) + """, &" + names(kGw) + ", MODULE_NAME); }"];
122 end 121 end
123 end 122 end
124 123
@@ -163,7 +162,7 @@ function gateway_filename = ilib_gen_gateway(name,tables)
163 "#define " + TNAME + "_GW_IMPEXP"; 162 "#define " + TNAME + "_GW_IMPEXP";
164 "#endif"; 163 "#endif";
165 ""; 164 "";
166 "extern ""C"" " + TNAME + "_GW_IMPEXP int " + tname + "(wchar_t* _pwstFuncName);"; 165 "extern ""C"" " + TNAME + "_GW_IMPEXP int " + tname + "(const char* _pstFuncName);";
167 ""; 166 "";
168 unique(gate(:, 2)); 167 unique(gate(:, 2));
169 ""; 168 "";
diff --git a/scilab/modules/dynamic_link/sci_gateway/cpp/sci_link.cpp b/scilab/modules/dynamic_link/sci_gateway/cpp/sci_link.cpp
index 6f3cbf1..c404607 100644
--- a/scilab/modules/dynamic_link/sci_gateway/cpp/sci_link.cpp
+++ b/scilab/modules/dynamic_link/sci_gateway/cpp/sci_link.cpp
@@ -86,7 +86,7 @@ types::Function::ReturnValue sci_link(types::typed_list &in, int _iRetCount, typ
86 } 86 }
87 else 87 else
88 { 88 {
89 Scierror(999, _("%ls Wrong value for input argument #%d: '%s' or '%s' expected.\n"), "link", 3, "f", "c"); 89 Scierror(999, _("%s Wrong value for input argument #%d: '%s' or '%s' expected.\n"), "link", 3, "f", "c");
90 return types::Function::Error; 90 return types::Function::Error;
91 } 91 }
92 92
@@ -210,7 +210,7 @@ void displayDynLibInfo(void)
210 { 210 {
211 if (getIlibVerboseLevel() != ILIB_VERBOSE_NO_OUTPUT) 211 if (getIlibVerboseLevel() != ILIB_VERBOSE_NO_OUTPUT)
212 { 212 {
213 sciprint(_("Entry point %ls in shared library %d.\n"), (*it)->pstEntryPointName, (*it)->iLibIndex); 213 sciprint(_("Entry point %s in shared library %d.\n"), (*it)->pstEntryPointName, (*it)->iLibIndex);
214 } 214 }
215 } 215 }
216} 216}
diff --git a/scilab/modules/dynamic_link/src/cpp/dynamic_link.cpp b/scilab/modules/dynamic_link/src/cpp/dynamic_link.cpp
index bc3877f..4a2b729 100644
--- a/scilab/modules/dynamic_link/src/cpp/dynamic_link.cpp
+++ b/scilab/modules/dynamic_link/src/cpp/dynamic_link.cpp
@@ -223,7 +223,6 @@ int Sci_dlsym(const char* _pstEntryPointName, int _iLibID, BOOL _bFortran)
223 223
224 ConfigVariable::setEntryPointName(pEP, _pstEntryPointName); 224 ConfigVariable::setEntryPointName(pEP, _pstEntryPointName);
225 ConfigVariable::addEntryPoint(pEP); 225 ConfigVariable::addEntryPoint(pEP);
226 FREE(pstEntryPointName);
227 return 0; 226 return 0;
228} 227}
229/*---------------------------------------------------------------------------*/ 228/*---------------------------------------------------------------------------*/