1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

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)
This commit is contained in:
Vladislav Vaintroub
2021-06-06 13:21:03 +02:00
parent 06dd151bb8
commit 3d6eb7afcf
132 changed files with 303 additions and 379 deletions

View File

@@ -88,7 +88,7 @@ extern "C" {
#endif /* defined(HAVE_CURSES_H) && defined(HAVE_TERM_H) */
#undef bcmp // Fix problem with new readline
#if defined(__WIN__)
#if defined(_WIN32)
#include <conio.h>
#else
#include <readline.h>
@@ -1587,7 +1587,7 @@ static struct my_option my_long_options[] =
{"password", 'p',
"Password to use when connecting to server. If password is not given it's asked from the tty.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#ifdef __WIN__
#ifdef _WIN32
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
@@ -1893,7 +1893,7 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
set_if_bigger(opt_silent,1); // more silent
break;
case 'W':
#ifdef __WIN__
#ifdef _WIN32
opt_protocol = MYSQL_PROTOCOL_PIPE;
opt_protocol_type= "pipe";
@@ -2026,7 +2026,7 @@ static int get_options(int argc, char **argv)
static int read_and_execute(bool interactive)
{
#if defined(__WIN__)
#if defined(_WIN32)
String tmpbuf;
String buffer;
#endif
@@ -2106,7 +2106,7 @@ static int read_and_execute(bool interactive)
if (opt_outfile && glob_buffer.is_empty())
fflush(OUTFILE);
#if defined(__WIN__)
#if defined(_WIN32)
tee_fputs(prompt, stdout);
if (!tmpbuf.is_alloced())
tmpbuf.alloc(65535);
@@ -2139,7 +2139,7 @@ static int read_and_execute(bool interactive)
if (line)
free(line);
line= readline(prompt);
#endif /* defined(__WIN__) */
#endif /* defined(_WIN32) */
/*
When Ctrl+d or Ctrl+z is pressed, the line may be NULL on some OS
@@ -2194,7 +2194,7 @@ static int read_and_execute(bool interactive)
}
}
#if defined(__WIN__)
#if defined(_WIN32)
buffer.free();
tmpbuf.free();
#else