summaryrefslogtreecommitdiff
path: root/storage/maria
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 /storage/maria
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 'storage/maria')
-rw-r--r--storage/maria/aria_chk.c2
-rw-r--r--storage/maria/aria_dump_log.c2
-rw-r--r--storage/maria/aria_read_log.c4
-rw-r--r--storage/maria/ma_control_file.c4
-rw-r--r--storage/maria/ma_create.c6
-rw-r--r--storage/maria/ma_info.c2
-rw-r--r--storage/maria/ma_locking.c4
-rw-r--r--storage/maria/ma_loghandler.c4
-rw-r--r--storage/maria/ma_open.c6
-rw-r--r--storage/maria/ma_pagecache.c6
-rw-r--r--storage/maria/ma_sort.c2
-rw-r--r--storage/maria/unittest/ma_pagecache_consist.c2
-rw-r--r--storage/maria/unittest/ma_pagecache_rwconsist.c2
-rw-r--r--storage/maria/unittest/ma_pagecache_rwconsist2.c2
-rw-r--r--storage/maria/unittest/ma_pagecache_single.c2
-rw-r--r--storage/maria/unittest/ma_test_loghandler-t.c2
-rw-r--r--storage/maria/unittest/ma_test_loghandler_first_lsn-t.c2
-rw-r--r--storage/maria/unittest/ma_test_loghandler_max_lsn-t.c2
-rw-r--r--storage/maria/unittest/ma_test_loghandler_multithread-t.c2
-rw-r--r--storage/maria/unittest/ma_test_loghandler_noflush-t.c2
-rw-r--r--storage/maria/unittest/ma_test_loghandler_nologs-t.c2
-rw-r--r--storage/maria/unittest/ma_test_loghandler_pagecache-t.c2
-rw-r--r--storage/maria/unittest/ma_test_loghandler_purge-t.c2
-rw-r--r--storage/maria/unittest/test_file.c2
24 files changed, 30 insertions, 38 deletions
diff --git a/storage/maria/aria_chk.c b/storage/maria/aria_chk.c
index cd679a1c80f..728b574c98c 100644
--- a/storage/maria/aria_chk.c
+++ b/storage/maria/aria_chk.c
@@ -505,7 +505,7 @@ static void usage(void)
maria_chk very silent.\n\
-t, --tmpdir=path Path for temporary files. Multiple paths can be\n\
specified, separated by ");
-#if defined( __WIN__) || defined(__NETWARE__)
+#if defined( _WIN32)
printf("semicolon (;)");
#else
printf("colon (:)");
diff --git a/storage/maria/aria_dump_log.c b/storage/maria/aria_dump_log.c
index 8e065e9ff9d..17af368c424 100644
--- a/storage/maria/aria_dump_log.c
+++ b/storage/maria/aria_dump_log.c
@@ -19,7 +19,7 @@ extern void translog_example_table_init();
static const char *load_default_groups[]= { "aria_dump_log",0 };
static void get_options(int *argc,char * * *argv);
#ifndef DBUG_OFF
-#if defined(__WIN__)
+#if defined(_WIN32)
const char *default_dbug_option= "d:t:i:O,\\aria_dump_log.trace";
#else
const char *default_dbug_option= "d:t:i:o,/tmp/aria_dump_log.trace";
diff --git a/storage/maria/aria_read_log.c b/storage/maria/aria_read_log.c
index 51bfa879702..c0c76ed5590 100644
--- a/storage/maria/aria_read_log.c
+++ b/storage/maria/aria_read_log.c
@@ -24,7 +24,7 @@
static const char *load_default_groups[]= { "aria_read_log",0 };
static void get_options(int *argc,char * * *argv);
#ifndef DBUG_OFF
-#if defined(__WIN__)
+#if defined(_WIN32)
const char *default_dbug_option= "d:t:O,\\aria_read_log.trace";
#else
const char *default_dbug_option= "d:t:o,/tmp/aria_read_log.trace";
@@ -273,7 +273,7 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"tmpdir", 't', "Path for temporary files. Multiple paths can be specified, "
"separated by "
-#if defined( __WIN__) || defined(__NETWARE__)
+#if defined( _WIN32)
"semicolon (;)"
#else
"colon (:)"
diff --git a/storage/maria/ma_control_file.c b/storage/maria/ma_control_file.c
index 65b8b0922aa..d71f92c2eac 100644
--- a/storage/maria/ma_control_file.c
+++ b/storage/maria/ma_control_file.c
@@ -226,7 +226,7 @@ static int lock_control_file(const char *name, my_bool do_retry)
@todo BUG We should explore my_sopen(_SH_DENYWRD) to open or create the
file under Windows.
*/
-#ifndef __WIN__
+#ifndef _WIN32
uint retry= 0;
uint retry_count= do_retry ? MARIA_MAX_CONTROL_FILE_LOCK_RETRY : 0;
@@ -581,7 +581,7 @@ int ma_control_file_end(void)
if (control_file_fd < 0) /* already closed */
DBUG_RETURN(0);
-#ifndef __WIN__
+#ifndef _WIN32
(void) my_lock(control_file_fd, F_UNLCK, 0L, F_TO_EOF,
MYF(MY_SEEK_NOT_DONE | MY_FORCE_LOCK));
#endif
diff --git a/storage/maria/ma_create.c b/storage/maria/ma_create.c
index a7ade46f8a4..df189c61043 100644
--- a/storage/maria/ma_create.c
+++ b/storage/maria/ma_create.c
@@ -23,12 +23,8 @@
#include "trnman.h"
#include "ma_crypt.h"
-#if defined(MSDOS) || defined(__WIN__)
-#ifdef __WIN__
+#ifdef _WIN32
#include <fcntl.h>
-#else
-#include <process.h> /* Prototype for getpid */
-#endif
#endif
#include <m_ctype.h>
diff --git a/storage/maria/ma_info.c b/storage/maria/ma_info.c
index f0b04e020c2..f31113d8384 100644
--- a/storage/maria/ma_info.c
+++ b/storage/maria/ma_info.c
@@ -16,7 +16,7 @@
/* Return useful base information for an open table */
#include "maria_def.h"
-#ifdef __WIN__
+#ifdef _WIN32
#include <sys/stat.h>
#endif
diff --git a/storage/maria/ma_locking.c b/storage/maria/ma_locking.c
index 200a728626f..d8f815b2a50 100644
--- a/storage/maria/ma_locking.c
+++ b/storage/maria/ma_locking.c
@@ -220,7 +220,7 @@ int maria_lock_database(MARIA_HA *info, int lock_type)
break; /* Impossible */
}
}
-#ifdef __WIN__
+#ifdef _WIN32
else
{
/*
@@ -320,7 +320,7 @@ int _ma_writeinfo(register MARIA_HA *info, uint operation)
&share->state,
MA_STATE_INFO_WRITE_DONT_MOVE_OFFSET)))
olderror=my_errno;
-#ifdef __WIN__
+#ifdef _WIN32
if (maria_flush)
{
_commit(share->kfile.file);
diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c
index e2956d7ca3c..11bdd68fc03 100644
--- a/storage/maria/ma_loghandler.c
+++ b/storage/maria/ma_loghandler.c
@@ -29,7 +29,7 @@
Also there is no need to flush filesystem changes ,i.e to sync()
directories.
*/
-#ifdef __WIN__
+#ifdef _WIN32
#define sync_dir(A,B) 0
#else
#define sync_dir(A,B) mysql_file_sync(A,B)
@@ -3673,7 +3673,7 @@ my_bool translog_init_with_table(const char *directory,
/* Directory to store files */
unpack_dirname(log_descriptor.directory, directory);
-#ifndef __WIN__
+#ifndef _WIN32
if ((log_descriptor.directory_fd= my_open(log_descriptor.directory,
O_RDONLY, MYF(MY_WME))) < 0)
{
diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c
index 49fd0dcc7af..f84f0b8e938 100644
--- a/storage/maria/ma_open.c
+++ b/storage/maria/ma_open.c
@@ -26,12 +26,8 @@
#include "ma_crypt.h"
#include "s3_func.h"
-#if defined(MSDOS) || defined(__WIN__)
-#ifdef __WIN__
+#ifdef _WIN32
#include <fcntl.h>
-#else
-#include <process.h> /* Prototype for getpid */
-#endif
#endif
static void setup_key_functions(MARIA_KEYDEF *keyinfo);
diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c
index bf646115bd9..986cacddf0c 100644
--- a/storage/maria/ma_pagecache.c
+++ b/storage/maria/ma_pagecache.c
@@ -589,7 +589,7 @@ static my_thread_id pagecache_thread_id;
((uint) (((char*)(h)-(char *) p->hash_link_root)/ \
sizeof(PAGECACHE_HASH_LINK)))
-#if (defined(PAGECACHE_TIMEOUT) && !defined(__WIN__)) || defined(PAGECACHE_DEBUG)
+#if (defined(PAGECACHE_TIMEOUT) && !defined(_WIN32)) || defined(PAGECACHE_DEBUG)
static int pagecache_pthread_cond_wait(mysql_cond_t *cond,
mysql_mutex_t *mutex);
#else
@@ -5561,7 +5561,7 @@ static void pagecache_dump(PAGECACHE *pagecache)
#endif /* defined(PAGECACHE_TIMEOUT) */
-#if defined(PAGECACHE_TIMEOUT) && !defined(__WIN__)
+#if defined(PAGECACHE_TIMEOUT) && !defined(_WIN32)
static int pagecache_pthread_cond_wait(mysql_cond_t *cond,
@@ -5623,7 +5623,7 @@ static int pagecache_pthread_cond_wait(mysql_cond_t *cond,
return rc;
}
#endif
-#endif /* defined(PAGECACHE_TIMEOUT) && !defined(__WIN__) */
+#endif /* defined(PAGECACHE_TIMEOUT) && !defined(_WIN32) */
#if defined(PAGECACHE_DEBUG)
diff --git a/storage/maria/ma_sort.c b/storage/maria/ma_sort.c
index 8153ec701a0..b9d6fffda86 100644
--- a/storage/maria/ma_sort.c
+++ b/storage/maria/ma_sort.c
@@ -20,7 +20,7 @@
#include "ma_fulltext.h"
#include <my_check_opt.h>
-#if defined(MSDOS) || defined(__WIN__)
+#if defined(_WIN32)
#include <fcntl.h>
#else
#include <stddef.h>
diff --git a/storage/maria/unittest/ma_pagecache_consist.c b/storage/maria/unittest/ma_pagecache_consist.c
index 29fa29ca035..ff4a2bcb33a 100644
--- a/storage/maria/unittest/ma_pagecache_consist.c
+++ b/storage/maria/unittest/ma_pagecache_consist.c
@@ -339,7 +339,7 @@ int main(int argc __attribute__((unused)),
MY_INIT(argv[0]);
#ifndef DBUG_OFF
-#if defined(__WIN__)
+#if defined(_WIN32)
default_dbug_option= "d:t:i:O,\\test_pagecache_consist.trace";
#else
default_dbug_option= "d:t:i:o,/tmp/test_pagecache_consist.trace";
diff --git a/storage/maria/unittest/ma_pagecache_rwconsist.c b/storage/maria/unittest/ma_pagecache_rwconsist.c
index a3303eb65a4..24c30245bac 100644
--- a/storage/maria/unittest/ma_pagecache_rwconsist.c
+++ b/storage/maria/unittest/ma_pagecache_rwconsist.c
@@ -210,7 +210,7 @@ int main(int argc __attribute__((unused)),
MY_INIT(argv[0]);
#ifndef DBUG_OFF
-#if defined(__WIN__)
+#if defined(_WIN32)
default_dbug_option= "d:t:i:O,\\test_pagecache_consist.trace";
#else
default_dbug_option= "d:t:i:O,/tmp/test_pagecache_consist.trace";
diff --git a/storage/maria/unittest/ma_pagecache_rwconsist2.c b/storage/maria/unittest/ma_pagecache_rwconsist2.c
index 2a0f76b478f..c92bec3ca41 100644
--- a/storage/maria/unittest/ma_pagecache_rwconsist2.c
+++ b/storage/maria/unittest/ma_pagecache_rwconsist2.c
@@ -206,7 +206,7 @@ int main(int argc __attribute__((unused)),
MY_INIT(argv[0]);
#ifndef DBUG_OFF
-#if defined(__WIN__)
+#if defined(_WIN32)
default_dbug_option= "d:t:i:O,\\test_pagecache_consist.trace";
#else
default_dbug_option= "d:t:i:O,/tmp/test_pagecache_consist.trace";
diff --git a/storage/maria/unittest/ma_pagecache_single.c b/storage/maria/unittest/ma_pagecache_single.c
index 4cd62c52d86..c4e2c53d235 100644
--- a/storage/maria/unittest/ma_pagecache_single.c
+++ b/storage/maria/unittest/ma_pagecache_single.c
@@ -730,7 +730,7 @@ int main(int argc __attribute__((unused)),
MY_INIT(argv[0]);
#ifndef DBUG_OFF
-#if defined(__WIN__)
+#if defined(_WIN32)
default_dbug_option= "d:t:i:O,\\test_pagecache_single.trace";
#else
default_dbug_option= "d:t:i:o,/tmp/test_pagecache_single.trace";
diff --git a/storage/maria/unittest/ma_test_loghandler-t.c b/storage/maria/unittest/ma_test_loghandler-t.c
index 198ea5b2afb..ccda66af755 100644
--- a/storage/maria/unittest/ma_test_loghandler-t.c
+++ b/storage/maria/unittest/ma_test_loghandler-t.c
@@ -185,7 +185,7 @@ int main(int argc __attribute__((unused)), char *argv[])
bzero(long_tr_id, 6);
#ifndef DBUG_OFF
-#if defined(__WIN__)
+#if defined(_WIN32)
default_dbug_option= "d:t:i:O,\\ma_test_loghandler.trace";
#else
default_dbug_option= "d:t:i:o,/tmp/ma_test_loghandler.trace";
diff --git a/storage/maria/unittest/ma_test_loghandler_first_lsn-t.c b/storage/maria/unittest/ma_test_loghandler_first_lsn-t.c
index 8806571cabf..21f6b7d7b44 100644
--- a/storage/maria/unittest/ma_test_loghandler_first_lsn-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_first_lsn-t.c
@@ -54,7 +54,7 @@ int main(int argc __attribute__((unused)), char *argv[])
bzero(long_tr_id, 6);
#ifndef DBUG_OFF
-#if defined(__WIN__)
+#if defined(_WIN32)
default_dbug_option= "d:t:i:O,\\ma_test_loghandler.trace";
#else
default_dbug_option= "d:t:i:o,/tmp/ma_test_loghandler.trace";
diff --git a/storage/maria/unittest/ma_test_loghandler_max_lsn-t.c b/storage/maria/unittest/ma_test_loghandler_max_lsn-t.c
index 65b926376ae..391d785159a 100644
--- a/storage/maria/unittest/ma_test_loghandler_max_lsn-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_max_lsn-t.c
@@ -52,7 +52,7 @@ int main(int argc __attribute__((unused)), char *argv[])
bzero(long_tr_id, 6);
#ifndef DBUG_OFF
-#if defined(__WIN__)
+#if defined(_WIN32)
default_dbug_option= "d:t:i:O,\\ma_test_loghandler.trace";
#else
default_dbug_option= "d:t:i:o,/tmp/ma_test_loghandler.trace";
diff --git a/storage/maria/unittest/ma_test_loghandler_multithread-t.c b/storage/maria/unittest/ma_test_loghandler_multithread-t.c
index cb4d2bc70ba..ec097ede036 100644
--- a/storage/maria/unittest/ma_test_loghandler_multithread-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_multithread-t.c
@@ -292,7 +292,7 @@ int main(int argc __attribute__((unused)),
long_buffer[i]= (i & 0xFF);
#ifndef DBUG_OFF
-#if defined(__WIN__)
+#if defined(_WIN32)
default_dbug_option= "d:t:i:O,\\ma_test_loghandler.trace";
#else
default_dbug_option= "d:t:i:o,/tmp/ma_test_loghandler.trace";
diff --git a/storage/maria/unittest/ma_test_loghandler_noflush-t.c b/storage/maria/unittest/ma_test_loghandler_noflush-t.c
index 3aafe5db9b4..46b3a8e71aa 100644
--- a/storage/maria/unittest/ma_test_loghandler_noflush-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_noflush-t.c
@@ -53,7 +53,7 @@ int main(int argc __attribute__((unused)), char *argv[])
bzero(long_tr_id, 6);
#ifndef DBUG_OFF
-#if defined(__WIN__)
+#if defined(_WIN32)
default_dbug_option= "d:t:i:O,\\ma_test_loghandler.trace";
#else
default_dbug_option= "d:t:i:o,/tmp/ma_test_loghandler.trace";
diff --git a/storage/maria/unittest/ma_test_loghandler_nologs-t.c b/storage/maria/unittest/ma_test_loghandler_nologs-t.c
index 913bd4ef5b6..b95d8bee24c 100644
--- a/storage/maria/unittest/ma_test_loghandler_nologs-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_nologs-t.c
@@ -54,7 +54,7 @@ int main(int argc __attribute__((unused)), char *argv[])
bzero(long_tr_id, 6);
#ifndef DBUG_OFF
-#if defined(__WIN__)
+#if defined(_WIN32)
default_dbug_option= "d:t:i:O,\\ma_test_loghandler.trace";
#else
default_dbug_option= "d:t:i:o,/tmp/ma_test_loghandler.trace";
diff --git a/storage/maria/unittest/ma_test_loghandler_pagecache-t.c b/storage/maria/unittest/ma_test_loghandler_pagecache-t.c
index f09a78e5fa8..892a773b475 100644
--- a/storage/maria/unittest/ma_test_loghandler_pagecache-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_pagecache-t.c
@@ -57,7 +57,7 @@ int main(int argc __attribute__((unused)), char *argv[])
bzero(long_tr_id, 6);
#ifndef DBUG_OFF
-#if defined(__WIN__)
+#if defined(_WIN32)
default_dbug_option= "d:t:i:O,\\ma_test_loghandler_pagecache.trace";
#else
default_dbug_option= "d:t:i:o,/tmp/ma_test_loghandler_pagecache.trace";
diff --git a/storage/maria/unittest/ma_test_loghandler_purge-t.c b/storage/maria/unittest/ma_test_loghandler_purge-t.c
index e1eeca2fc9b..07b50f197de 100644
--- a/storage/maria/unittest/ma_test_loghandler_purge-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_purge-t.c
@@ -55,7 +55,7 @@ int main(int argc __attribute__((unused)), char *argv[])
bzero(long_tr_id, 6);
#ifndef DBUG_OFF
-#if defined(__WIN__)
+#if defined(_WIN32)
default_dbug_option= "d:t:i:O,\\ma_test_loghandler.trace";
#else
default_dbug_option= "d:t:i:o,/tmp/ma_test_loghandler.trace";
diff --git a/storage/maria/unittest/test_file.c b/storage/maria/unittest/test_file.c
index 8c9a5f66a2f..853f5352fca 100644
--- a/storage/maria/unittest/test_file.c
+++ b/storage/maria/unittest/test_file.c
@@ -44,7 +44,7 @@ int test_file(PAGECACHE_FILE file, char *file_name,
int step= 0;
int res= 1; /* ok */
-#ifdef __WIN__
+#ifdef _WIN32
/*
On Windows, the info returned by stat(), specifically file length
is not necessarily current, because this is the behavior of