diff options
author | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-04-06 04:07:18 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-04-06 14:05:57 +0000 |
commit | a016ac1667cdf7fb81a78b51a6aaab455e376782 (patch) | |
tree | a0282aacadbeecb8368dceb453de9b536fdbe333 /include/LibreOfficeKit | |
parent | 724ddb9177fd38c80f60d3d957d7be4be813c069 (diff) |
lokit: make this build on windows, silence extra warnings
Change-Id: I78d5ce58d55d27eaa0256a0c1ddffed3a5f2cf91
Reviewed-on: https://gerrit.libreoffice.org/36175
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'include/LibreOfficeKit')
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.h | 6 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKitInit.h | 15 |
2 files changed, 12 insertions, 9 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index 2a5dbcabb817..a4035c7351f0 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -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> diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h b/include/LibreOfficeKit/LibreOfficeKitInit.h index 08b3e1c32947..0c9555afe174 100644 --- a/include/LibreOfficeKit/LibreOfficeKitInit.h +++ b/include/LibreOfficeKit/LibreOfficeKitInit.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); |