* Bug #14150 fixed : The Windows SDK is not found on Windows 8.1 74/17174/6
Simon Marchetto [Thu, 10 Sep 2015 09:26:51 +0000 (11:26 +0200)]
Change-Id: I1915b702a4aecc6843772c468f65182d6c9269e8

scilab/CHANGES_6.0.X
scilab/modules/ast/includes/types/addfunction.h
scilab/modules/dynamic_link/macros/windows/dlwSetEnvCommonVc12.sci
scilab/modules/dynamic_link/tests/unit_tests/ilib_build_win_sdk.dia.ref [new file with mode: 0644]
scilab/modules/dynamic_link/tests/unit_tests/ilib_build_win_sdk.tst [new file with mode: 0644]

index c4b1905..53b0b42 100644 (file)
@@ -15,6 +15,8 @@ Deprecated Behaviors
 Scilab Bug Fixes
 ================
 
+* Bug #14150 fixed - The Windows SDK was not found on Windows 8.1.
+
 * Bug #13709 fixed - unique function sometimes returned wrong index values.
 
 * Bug #13750 fixed - Calling ss2ss function with flag = 2 returned an error.
index 66bd6b3..8075a28 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "dynlib_ast.h"
 
-EXTERN_AST void addCFunction(wchar_t* _wstName, OLDGW_FUNC _pFunc, wchar_t* _wstModule);
-EXTERN_AST void addMexFunction(wchar_t* _wstName, MEXGW_FUNC _pFunc, wchar_t* _wstModule);
+EXTERN_AST void addCFunction(const wchar_t* _wstName, OLDGW_FUNC _pFunc, const wchar_t* _wstModule);
+EXTERN_AST void addMexFunction(const wchar_t* _wstName, MEXGW_FUNC _pFunc, const wchar_t* _wstModule);
 
 #endif // __ADDFUNCTION_H__
index f4408a9..84e84b6 100644 (file)
@@ -95,6 +95,7 @@ function newLIB = getNewLIBx64(LIB, msvsPath, sdkPath, bIsExpress)
     newLIB = newLIB + ..
     sdkPath + "\lib\x64" + pathsep() + LIB + pathsep() + ..
     getenv("PROGRAMFILES(X86)") + "\Windows Kits\8.1\Lib\winv6.3\um\x64\;";
+    getenv("PROGRAMFILES(X86)") + "\Windows Kits\8.0\Lib\winv6.3\um\x64\;";
 endfunction
 //=============================================================================
 function newLIB = getNewLIBx86(LIB, msvsPath, sdkPath, bIsExpress)
@@ -107,6 +108,7 @@ function newLIB = getNewLIBx86(LIB, msvsPath, sdkPath, bIsExpress)
     sdkPath + filesep() + "lib" + pathsep() + ..
     LIB + pathsep() + ..
     getenv("PROGRAMFILES") + "\Windows Kits\8.1\Lib\winv6.3\um\x86\;";
+    getenv("PROGRAMFILES") + "\Windows Kits\8.0\Lib\winv6.3\um\x86\;";
 endfunction
 //=============================================================================
 function newPATH = getNewPATHx64(PATH, msvsPath, sdkPath, bIsExpress)
@@ -171,8 +173,9 @@ function newINCLUDE = getNewINCLUDEx64(INCLUDE, msvsPath, sdkPath, bIsExpress)
         msvsPath + "\VC\ATLMFC\INCLUDE" + pathsep();
     end
 
-    newINCLUDE = newINCLUDE + ..
-    sdkPath + "\include" + pathsep() + INCLUDE + ..
+    newINCLUDE = newINCLUDE + pathsep() + INCLUDE + ..
+    getenv("PROGRAMFILES(X86)") + "\Windows Kits\8.1\Include\um;" + ..
+    getenv("PROGRAMFILES(X86)") + "\Windows Kits\8.1\Include\shared;" + ..
     getenv("PROGRAMFILES(X86)") + "\Windows Kits\8.0\Include\um;" + ..
     getenv("PROGRAMFILES(X86)") + "\Windows Kits\8.0\Include\shared;";
 
@@ -185,9 +188,10 @@ function newINCLUDE = getNewINCLUDEx86(INCLUDE, msvsPath, sdkPath, bIsExpress)
         newINCLUDE = msvsPath + "\VC\ATLMFC\INCLUDE"  + pathsep();
     end
 
-    newINCLUDE = newINCLUDE + ..
-    msvsPath + "\VC\INCLUDE"  + pathsep() + ..
-    sdkPath + "\include" + pathsep() + INCLUDE + ..
+    newINCLUDE = newINCLUDE + msvsPath + ..
+    "\VC\INCLUDE" + pathsep() + INCLUDE + ..
+    getenv("PROGRAMFILES") + "\Windows Kits\8.1\Include\um;" + ..
+    getenv("PROGRAMFILES") + "\Windows Kits\8.1\Include\shared;" +  ..
     getenv("PROGRAMFILES") + "\Windows Kits\8.0\Include\um;" + ..
     getenv("PROGRAMFILES") + "\Windows Kits\8.0\Include\shared;";
     ;
diff --git a/scilab/modules/dynamic_link/tests/unit_tests/ilib_build_win_sdk.dia.ref b/scilab/modules/dynamic_link/tests/unit_tests/ilib_build_win_sdk.dia.ref
new file mode 100644 (file)
index 0000000..b65b817
--- /dev/null
@@ -0,0 +1,36 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2015 - Scilab Enterprises
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- WINDOWS ONLY -->
+// <-- CLI SHELL MODE -->
+//
+// Checks dynamic link on a code using Windows SDK
+source = [
+"#define __USE_DEPRECATED_STACK_FUNCTIONS__"
+"#include <windows.h>"
+"#include <api_scilab.h>"
+"int sci_getWindowsDirectory(char *fname, void* pvApiCtx)"
+"{"
+"    char buf[MAX_PATH];"
+"    CheckRhs(0, 0);"
+"    CheckLhs(0, 1);"
+"    GetWindowsDirectoryA(buf, MAX_PATH);"
+"    createSingleString(pvApiCtx, Rhs + 1, buf);"
+"    LhsVar(1) = Rhs + 1;"
+"    return 0;"
+"}"
+];
+test_dir = fullfile(TMPDIR, 'ilib_build_win_sdk');
+mkdir(test_dir);
+mputl(source, fullfile(test_dir, 'ilib_build_win_sdk.c'));
+orig_path = pwd();
+chdir(test_dir);
+ilib_verbose(0);
+ilib_build("test_c_lib", ["getWindowsDirectory", "sci_getWindowsDirectory"], ["ilib_build_win_sdk.c"], []);
+exec("loader.sce");
+assert_checkequal(getWindowsDirectory(), getenv("WINDIR"));
+chdir(orig_path);
+rmdir(test_dir, 's');
diff --git a/scilab/modules/dynamic_link/tests/unit_tests/ilib_build_win_sdk.tst b/scilab/modules/dynamic_link/tests/unit_tests/ilib_build_win_sdk.tst
new file mode 100644 (file)
index 0000000..a4fc3b0
--- /dev/null
@@ -0,0 +1,42 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2015 - Scilab Enterprises
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- WINDOWS ONLY -->
+// <-- CLI SHELL MODE -->
+//
+// Checks dynamic link on a code using Windows SDK
+
+source = [
+"#define __USE_DEPRECATED_STACK_FUNCTIONS__"
+"#include <windows.h>"
+"#include <api_scilab.h>"
+"int sci_getWindowsDirectory(char *fname, void* pvApiCtx)"
+"{"
+"    char buf[MAX_PATH];"
+"    CheckRhs(0, 0);"
+"    CheckLhs(0, 1);"
+"    GetWindowsDirectoryA(buf, MAX_PATH);"
+"    createSingleString(pvApiCtx, Rhs + 1, buf);"
+"    LhsVar(1) = Rhs + 1;"
+"    return 0;"
+"}"
+];
+
+test_dir = fullfile(TMPDIR, 'ilib_build_win_sdk');
+mkdir(test_dir);
+mputl(source, fullfile(test_dir, 'ilib_build_win_sdk.c'));
+orig_path = pwd();
+chdir(test_dir);
+
+ilib_verbose(0);
+ilib_build("test_c_lib", ["getWindowsDirectory", "sci_getWindowsDirectory"], ["ilib_build_win_sdk.c"], []);
+exec("loader.sce");
+
+assert_checkequal(getWindowsDirectory(), getenv("WINDIR"));
+
+chdir(orig_path);
+rmdir(test_dir, 's');