Fix Windows toolbox compilation
[scilab.git] / scilab / modules / dynamic_link / macros / ilib_gen_gateway.sci
index 82cb725..6158922 100644 (file)
@@ -66,8 +66,15 @@ function gateway_filename = ilib_gen_gateway(name,tables)
         if ( nt <> 3 ) then
             error(msprintf(gettext("%s: Wrong size for input argument #%d: %d expected.\n"),"ilib_gen_gateway",2,3));
         end
-        [gate,names,cppCompilation] = new_names(table);
+
         global cppCompilation;
+        if isempty(cppCompilation) then
+            cppCompilation = %f;
+        end
+
+        [gate,names,cpp] = new_names(table);
+        cppCompilation = cppCompilation | cpp;
+
         //generate cpp interface file
         if  cppCompilation then
             t = [
@@ -153,9 +160,11 @@ function gateway_filename = ilib_gen_gateway(name,tables)
         "#define " + TNAME + "_GW_IMPEXP";
         "#endif";
         "";
+        "#include <cpp_gateway_prototype.hxx>";
+        "";
         "extern ""C"" " + TNAME + "_GW_IMPEXP int " + tname + "(wchar_t* _pwstFuncName);";
         "";
-        gate(:, 2);
+        unique(gate(:, 2));
         "";
         "#endif /* __" + TNAME + "_GW_HXX__ */"];
 
@@ -182,7 +191,7 @@ function gateway_filename = ilib_gen_gateway(name,tables)
         "";
         "#include ""c_gateway_prototype.h""";
         "";
-        gate(:, 1);
+        unique(gate(:, 1));
         "";
         "#endif /* __" + TNAME + "_GW_H__ */"];