Skip to content

Commit c6de632

Browse files
committed
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.
1 parent 7f491ae commit c6de632

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

cmake/os/WindowsCache.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ SET(HAVE_PASE_ENVIRONMENT CACHE INTERNAL "")
131131
SET(HAVE_PATHS_H CACHE INTERNAL "")
132132
SET(HAVE_PCLOSE CACHE INTERNAL "")
133133
SET(HAVE_PERROR 1 CACHE INTERNAL "")
134+
SET(HAVE_PEERCRED CACHE INTERNAL "")
134135
SET(HAVE_POLL_H CACHE INTERNAL "")
135136
SET(HAVE_POPEN CACHE INTERNAL "")
136137
SET(HAVE_POLL CACHE INTERNAL "")

scripts/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ INSTALL(FILES
8484
IF(MALLOC_LIB)
8585
MESSAGE("Using tcmalloc '${MALLOC_LIB}'")
8686
INSTALL(FILES ${MALLOC_LIB} DESTINATION ${INSTALL_LIBDIR} OPTIONAL)
87-
ELSE()
88-
MESSAGE("No 'MALLOC_LIB' variable")
8987
ENDIF()
9088

9189
IF(CMAKE_GENERATOR MATCHES "Makefiles")

sql-common/client_plugin.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ mysql_load_plugin_v(MYSQL *mysql, const char *name, int type,
322322
char dlpath[FN_REFLEN+1];
323323
void *sym, *dlhandle;
324324
struct st_mysql_client_plugin *plugin;
325-
#ifdef WIN32
325+
#ifdef _WIN32
326326
char win_errormsg[2048];
327327
#endif
328328

@@ -364,10 +364,12 @@ mysql_load_plugin_v(MYSQL *mysql, const char *name, int type,
364364
#endif
365365

366366
DBUG_PRINT ("info", ("failed to dlopen"));
367-
#ifdef WIN32
368-
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
369-
0, GetLastError(), 0, win_errormsg, 2048, NULL);
370-
errormsg= win_errormsg;
367+
#ifdef _WIN32
368+
if(FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
369+
0, GetLastError(), 0, win_errormsg, 2048, NULL))
370+
errmsg= win_errormsg;
371+
else
372+
errmsg= "";
371373
#else
372374
errmsg= dlerror();
373375
#endif

0 commit comments

Comments
 (0)