diff options
author | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-10-04 21:25:53 +0200 |
---|---|---|
committer | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-10-04 21:25:53 +0200 |
commit | a1fe23668fd2dd0c2dd9b8b14df88e216bfc4e0b (patch) | |
tree | d8098346f2eee2102f07c4c8cad7c340359968f3 | |
parent | 57bb4dee2e8c88688350d2ba1674edf984928191 (diff) | |
download | mariadb-git-a1fe23668fd2dd0c2dd9b8b14df88e216bfc4e0b.tar.gz |
Fix compile error on Windows after WL#1054 push.
The error was introduced by typo in variable name (errormsg instead of correct
errmsg)
- Also, precache HAVE_PEERCRED to OFF in cmake\os\WindowsCache.cmake
(to avoid useless system check).
- Also, add missing check for errors from FormatMessage().
- Also, remove annoying CMake debug printout of MALLOC_LIB if this is not set.
-rw-r--r-- | cmake/os/WindowsCache.cmake | 1 | ||||
-rw-r--r-- | scripts/CMakeLists.txt | 2 | ||||
-rw-r--r-- | sql-common/client_plugin.c | 12 |
3 files changed, 8 insertions, 7 deletions
diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake index 732f5d74181..4936ae369bc 100644 --- a/cmake/os/WindowsCache.cmake +++ b/cmake/os/WindowsCache.cmake @@ -131,6 +131,7 @@ SET(HAVE_PASE_ENVIRONMENT CACHE INTERNAL "") SET(HAVE_PATHS_H CACHE INTERNAL "") SET(HAVE_PCLOSE CACHE INTERNAL "") SET(HAVE_PERROR 1 CACHE INTERNAL "") +SET(HAVE_PEERCRED CACHE INTERNAL "") SET(HAVE_POLL_H CACHE INTERNAL "") SET(HAVE_POPEN CACHE INTERNAL "") SET(HAVE_POLL CACHE INTERNAL "") diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 9b4b598a682..0a8d4f9658d 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -84,8 +84,6 @@ INSTALL(FILES IF(MALLOC_LIB) MESSAGE("Using tcmalloc '${MALLOC_LIB}'") INSTALL(FILES ${MALLOC_LIB} DESTINATION ${INSTALL_LIBDIR} OPTIONAL) -ELSE() - MESSAGE("No 'MALLOC_LIB' variable") ENDIF() IF(CMAKE_GENERATOR MATCHES "Makefiles") diff --git a/sql-common/client_plugin.c b/sql-common/client_plugin.c index 858eb492d7a..bfeea40b401 100644 --- a/sql-common/client_plugin.c +++ b/sql-common/client_plugin.c @@ -322,7 +322,7 @@ mysql_load_plugin_v(MYSQL *mysql, const char *name, int type, char dlpath[FN_REFLEN+1]; void *sym, *dlhandle; struct st_mysql_client_plugin *plugin; -#ifdef WIN32 +#ifdef _WIN32 char win_errormsg[2048]; #endif @@ -364,10 +364,12 @@ mysql_load_plugin_v(MYSQL *mysql, const char *name, int type, #endif DBUG_PRINT ("info", ("failed to dlopen")); -#ifdef WIN32 - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, - 0, GetLastError(), 0, win_errormsg, 2048, NULL); - errormsg= win_errormsg; +#ifdef _WIN32 + if(FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, + 0, GetLastError(), 0, win_errormsg, 2048, NULL)) + errmsg= win_errormsg; + else + errmsg= ""; #else errmsg= dlerror(); #endif |