Kaydet (Commit) a016ac16 authored tarafından Thorsten Behrens's avatar Thorsten Behrens

lokit: make this build on windows, silence extra warnings

Change-Id: I78d5ce58d55d27eaa0256a0c1ddffed3a5f2cf91
Reviewed-on: https://gerrit.libreoffice.org/36175Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst 724ddb91
......@@ -13,9 +13,11 @@
#include <stddef.h>
#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
# ifndef _WIN32
// the unstable API needs C99's bool
#include <stdbool.h>
#include <stdint.h>
# include <stdbool.h>
# endif
# include <stdint.h>
#endif
#include <LibreOfficeKit/LibreOfficeKitTypes.h>
......
......@@ -72,7 +72,7 @@ extern "C"
}
#else
#pragma warning(disable:4996)
#include <windows.h>
#define TARGET_LIB "sofficeapp" ".dll"
#define TARGET_MERGED_LIB "mergedlo" ".dll"
......@@ -124,15 +124,16 @@ extern "C"
size_t size_sEnvPath = 0;
if(sEnvPath)
size_sEnvPath = strlen(sEnvPath);
char* sNewPath = new char[size_sEnvPath + 2*strlen(pPath) + strlen(UNOPATH) + 4];
size_t buffer_size = size_sEnvPath + 2*strlen(pPath) + strlen(UNOPATH) + 4;
char* sNewPath = new char[buffer_size];
sNewPath[0] = L'\0';
strcat(sNewPath, pPath); // program to PATH
strcat(sNewPath, ";");
strcat(sNewPath, UNOPATH); // UNO to PATH
strcat_s(sNewPath, buffer_size, pPath); // program to PATH
strcat_s(sNewPath, buffer_size, ";");
strcat_s(sNewPath, buffer_size, UNOPATH); // UNO to PATH
if (size_sEnvPath > 0)
{
strcat(sNewPath, ";");
strcat(sNewPath, sEnvPath);
strcat_s(sNewPath, buffer_size, ";");
strcat_s(sNewPath, buffer_size, sEnvPath);
}
SetEnvironmentVariableA("PATH", sNewPath);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment