summaryrefslogtreecommitdiff
path: root/libmysqld
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2021-06-06 13:21:03 +0200
committerVladislav Vaintroub <wlad@mariadb.com>2021-06-06 13:21:03 +0200
commit3d6eb7afcfb47cb432f790d0b25c8c1f4ec5bcf3 (patch)
tree0915add6039e740b9ab08baf215e435480c44526 /libmysqld
parent06dd151bb86ad5b87d4d46011f36da1289c01074 (diff)
downloadmariadb-git-3d6eb7afcfb47cb432f790d0b25c8c1f4ec5bcf3.tar.gz
MDEV-25602 get rid of __WIN__ in favor of standard _WIN32
This fixed the MySQL bug# 20338 about misuse of double underscore prefix __WIN__, which was old MySQL's idea of identifying Windows Replace it by _WIN32 standard symbol for targeting Windows OS (both 32 and 64 bit) Not that connect storage engine is not fixed in this patch (must be fixed in "upstream" branch)
Diffstat (limited to 'libmysqld')
-rw-r--r--libmysqld/lib_sql.cc2
-rw-r--r--libmysqld/libmysql.c16
-rw-r--r--libmysqld/libmysqld.c11
3 files changed, 11 insertions, 18 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index 3d0482d1cd5..5374c420fac 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -578,7 +578,7 @@ int init_embedded_server(int argc, char **argv, char **groups)
/* Get default temporary directory */
opt_mysql_tmpdir=getenv("TMPDIR"); /* Use this if possible */
-#if defined(__WIN__)
+#if defined(_WIN32)
if (!opt_mysql_tmpdir)
opt_mysql_tmpdir=getenv("TEMP");
if (!opt_mysql_tmpdir)
diff --git a/libmysqld/libmysql.c b/libmysqld/libmysql.c
index 2c954cea390..09ae52aedee 100644
--- a/libmysqld/libmysql.c
+++ b/libmysqld/libmysql.c
@@ -35,7 +35,7 @@
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
-#if !defined(__WIN__)
+#if !defined(_WIN32)
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -46,7 +46,7 @@
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
-#endif /* !defined(__WIN__) */
+#endif /* !defined(_WIN32) */
#if defined(HAVE_POLL_H)
#include <poll.h>
#elif defined(HAVE_SYS_POLL_H)
@@ -55,7 +55,7 @@
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif
-#if !defined(__WIN__)
+#if !defined(_WIN32)
#include <my_pthread.h> /* because of signal() */
#endif
#ifndef INADDR_NONE
@@ -78,13 +78,13 @@ ulong max_allowed_packet= 1024L*1024L*1024L;
my_bool net_flush(NET *net);
#endif
-#if defined(__WIN__)
+#if defined(_WIN32)
/* socket_errno is defined in my_global.h for all platforms */
#define perror(A)
#else
#include <errno.h>
#define SOCKET_ERROR -1
-#endif /* __WIN__ */
+#endif /* _WIN32 */
/*
If allowed through some configuration, then this needs to
@@ -167,7 +167,7 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
if (!mysql_unix_port)
{
char *env;
-#ifdef __WIN__
+#ifdef _WIN32
mysql_unix_port = (char*) MYSQL_NAMEDPIPE;
#else
mysql_unix_port = (char*) MYSQL_UNIX_ADDR;
@@ -176,7 +176,7 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
mysql_unix_port = env;
}
mysql_debug(NullS);
-#if defined(SIGPIPE) && !defined(__WIN__)
+#if defined(SIGPIPE) && !defined(_WIN32)
(void) signal(SIGPIPE, SIG_IGN);
#endif
#ifdef EMBEDDED_LIBRARY
@@ -421,7 +421,7 @@ struct passwd *getpwuid(uid_t);
char* getlogin(void);
#endif
-#if !defined(__WIN__)
+#if !defined(_WIN32)
void read_user_name(char *name)
{
diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c
index d29126467e2..774b687f0e2 100644
--- a/libmysqld/libmysqld.c
+++ b/libmysqld/libmysqld.c
@@ -32,7 +32,7 @@
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
-#if !defined(__WIN__)
+#if !defined(_WIN32)
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -54,7 +54,7 @@
extern ulong net_buffer_length;
extern ulong max_allowed_packet;
-#if defined(__WIN__)
+#if defined(_WIN32)
#define ERRNO WSAGetLastError()
#define perror(A)
#else
@@ -69,13 +69,6 @@ struct passwd *getpwuid(uid_t);
char* getlogin(void);
#endif
-#ifdef __WIN__
-static my_bool is_NT(void)
-{
- char *os=getenv("OS");
- return (os && !strcmp(os, "Windows_NT")) ? 1 : 0;
-}
-#endif
int mysql_init_character_set(MYSQL *mysql);