summaryrefslogtreecommitdiff
path: root/win
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2018-02-20 21:17:36 +0000
committerVladislav Vaintroub <wlad@mariadb.com>2018-02-20 21:17:36 +0000
commit56e7b7eaede52e8d2123e909d7d42220f8c63143 (patch)
tree73e1dc4b2e53d68c3a9d5269f9140142ef08c187 /win
parent9d97e6010ebdeab0579a8371d01f34118c518b30 (diff)
downloadmariadb-git-56e7b7eaede52e8d2123e909d7d42220f8c63143.tar.gz
Make possible to use clang on Windows (clang-cl)
-DWITH_ASAN can be used as well now, on x64 Fix many clang-cl warnings.
Diffstat (limited to 'win')
-rw-r--r--win/packaging/ca/CustomAction.cpp8
-rw-r--r--win/upgrade_wizard/CMakeLists.txt4
2 files changed, 7 insertions, 5 deletions
diff --git a/win/packaging/ca/CustomAction.cpp b/win/packaging/ca/CustomAction.cpp
index 025c4da4592..71c24e96f92 100644
--- a/win/packaging/ca/CustomAction.cpp
+++ b/win/packaging/ca/CustomAction.cpp
@@ -90,7 +90,7 @@ static void EscapeCommandLine(const wchar_t *in, wchar_t *out, size_t buflen)
bool needs_escaping= false;
size_t pos;
- for(int i=0; i< sizeof(special_chars) -1; i++)
+ for(size_t i=0; i< sizeof(special_chars) -1; i++)
{
if (wcschr(in, special_chars[i]))
{
@@ -271,7 +271,7 @@ bool IsPortFree(short port)
struct sockaddr_in sin;
SOCKET sock;
sock = socket(AF_INET, SOCK_STREAM, 0);
- if(sock == -1)
+ if(sock == INVALID_SOCKET)
{
return false;
}
@@ -871,8 +871,6 @@ extern "C" UINT __stdcall CheckServiceUpgrades(MSIHANDLE hInstall)
{
HRESULT hr = S_OK;
UINT er = ERROR_SUCCESS;
- wchar_t* service= 0;
- wchar_t* dir= 0;
wchar_t installerVersion[MAX_VERSION_PROPERTY_SIZE];
char installDir[MAX_PATH];
DWORD size =MAX_VERSION_PROPERTY_SIZE;
@@ -882,7 +880,7 @@ extern "C" UINT __stdcall CheckServiceUpgrades(MSIHANDLE hInstall)
DWORD bufsize;
int index;
BOOL ok;
- SC_HANDLE scm;
+ SC_HANDLE scm = NULL;
hr = WcaInitialize(hInstall, __FUNCTION__);
WcaLog(LOGMSG_STANDARD, "Initialized.");
diff --git a/win/upgrade_wizard/CMakeLists.txt b/win/upgrade_wizard/CMakeLists.txt
index dc4ef67387d..1285a5f41b7 100644
--- a/win/upgrade_wizard/CMakeLists.txt
+++ b/win/upgrade_wizard/CMakeLists.txt
@@ -1,6 +1,10 @@
IF(NOT MSVC)
RETURN()
ENDIF()
+IF(CMAKE_C_COMPILER_ID MATCHES Clang)
+ # MFC stuff does not compile with clang
+ RETURN()
+ENDIF()
IF(CMAKE_USING_VC_FREE_TOOLS)
# No MFC, so it cannot be built
RETURN()