Skip to content

Commit c478a55

Browse files
committed
MDEV-27667 Fix MDEV-26720 on 64-bit Microsoft Windows
The correct macro to detect the AMD64 ISA is _M_X64, not M_IX64. This is the 10.6 version of commit fb8fea3 (10.5).
1 parent f0f5ce5 commit c478a55

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

storage/innobase/include/fil0fil.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ struct fil_space_t final
572572
#if defined __GNUC__ && (defined __i386__ || defined __x86_64__)
573573
static_assert(NEEDS_FSYNC == 1U << 29, "compatibility");
574574
__asm__ __volatile__("lock btrl $29, %0" : "+m" (n_pending));
575-
#elif defined _MSC_VER && (defined _M_IX86 || defined _M_IX64)
575+
#elif defined _MSC_VER && (defined _M_IX86 || defined _M_X64)
576576
static_assert(NEEDS_FSYNC == 1U << 29, "compatibility");
577577
_interlockedbittestandreset(reinterpret_cast<volatile long*>
578578
(&n_pending), 29);
@@ -588,7 +588,7 @@ struct fil_space_t final
588588
#if defined __GNUC__ && (defined __i386__ || defined __x86_64__)
589589
static_assert(CLOSING == 1U << 30, "compatibility");
590590
__asm__ __volatile__("lock btrl $30, %0" : "+m" (n_pending));
591-
#elif defined _MSC_VER && (defined _M_IX86 || defined _M_IX64)
591+
#elif defined _MSC_VER && (defined _M_IX86 || defined _M_X64)
592592
static_assert(CLOSING == 1U << 30, "compatibility");
593593
_interlockedbittestandreset(reinterpret_cast<volatile long*>
594594
(&n_pending), 30);
@@ -1555,7 +1555,7 @@ inline bool fil_space_t::set_stopping_check()
15551555
return true;
15561556
not_stopped:
15571557
return false;
1558-
#elif defined _MSC_VER && (defined _M_IX86 || defined _M_IX64)
1558+
#elif defined _MSC_VER && (defined _M_IX86 || defined _M_X64)
15591559
static_assert(STOPPING == 1U << 31, "compatibility");
15601560
return _interlockedbittestandset(reinterpret_cast<volatile long*>
15611561
(&n_pending), 31);
@@ -1572,7 +1572,7 @@ inline void fil_space_t::set_stopping()
15721572
#if defined __GNUC__ && (defined __i386__ || defined __x86_64__)
15731573
static_assert(STOPPING == 1U << 31, "compatibility");
15741574
__asm__ __volatile__("lock btsl $31, %0" : "+m" (n_pending));
1575-
#elif defined _MSC_VER && (defined _M_IX86 || defined _M_IX64)
1575+
#elif defined _MSC_VER && (defined _M_IX86 || defined _M_X64)
15761576
static_assert(STOPPING == 1U << 31, "compatibility");
15771577
_interlockedbittestandset(reinterpret_cast<volatile long*>(&n_pending), 31);
15781578
#else

storage/innobase/include/rw_lock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class rw_lock
5656
#if defined __GNUC__ && (defined __i386__ || defined __x86_64__)
5757
static_assert(WRITER_WAITING == 1U << 30, "compatibility");
5858
__asm__ __volatile__("lock btsl $30, %0" : "+m" (lock));
59-
#elif defined _MSC_VER && (defined _M_IX86 || defined _M_IX64)
59+
#elif defined _MSC_VER && (defined _M_IX86 || defined _M_X64)
6060
static_assert(WRITER_WAITING == 1U << 30, "compatibility");
6161
_interlockedbittestandset(reinterpret_cast<volatile long*>(&lock), 30);
6262
#else

storage/innobase/include/srw_lock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ class ssux_lock_impl final
224224
void wr_lock()
225225
{
226226
writer.wr_lock();
227-
#if defined __i386__||defined __x86_64__||defined _M_IX86||defined _M_IX64
227+
#if defined __i386__||defined __x86_64__||defined _M_IX86||defined _M_X64
228228
/* On IA-32 and AMD64, this type of fetch_or() can only be implemented
229229
as a loop around LOCK CMPXCHG. In this particular case, setting the
230230
most significant bit using fetch_add() is equivalent, and is

storage/innobase/include/trx0rseg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ struct MY_ALIGNED(CPU_LEVEL1_DCACHE_LINESIZE) trx_rseg_t
116116
__asm__ __volatile__("lock btsl $1, %0" : "+m" (ref));
117117
else
118118
__asm__ __volatile__("lock btsl $0, %0" : "+m" (ref));
119-
#elif defined _MSC_VER && (defined _M_IX86 || defined _M_IX64)
119+
#elif defined _MSC_VER && (defined _M_IX86 || defined _M_X64)
120120
_interlockedbittestandset(reinterpret_cast<volatile long*>(&ref),
121121
needs_purge);
122122
#else
@@ -133,7 +133,7 @@ struct MY_ALIGNED(CPU_LEVEL1_DCACHE_LINESIZE) trx_rseg_t
133133
__asm__ __volatile__("lock btrl $1, %0" : "+m" (ref));
134134
else
135135
__asm__ __volatile__("lock btrl $0, %0" : "+m" (ref));
136-
#elif defined _MSC_VER && (defined _M_IX86 || defined _M_IX64)
136+
#elif defined _MSC_VER && (defined _M_IX86 || defined _M_X64)
137137
_interlockedbittestandreset(reinterpret_cast<volatile long*>(&ref),
138138
needs_purge);
139139
#else

storage/innobase/sync/srw_lock.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ assembler code or a Microsoft intrinsic function.
385385
# define IF_NOT_FETCH_OR_GOTO(mem, bit, label) \
386386
__asm__ goto("lock btsl $" #bit ", %0\n\t" \
387387
"jnc %l1" : : "m" (mem) : "cc", "memory" : label);
388-
#elif defined _MSC_VER && (defined _M_IX86 || defined _M_IX64)
388+
#elif defined _MSC_VER && (defined _M_IX86 || defined _M_X64)
389389
# define IF_FETCH_OR_GOTO(mem, bit, label) \
390390
if (_interlockedbittestandset(reinterpret_cast<volatile long*>(&mem), bit)) \
391391
goto label;

0 commit comments

Comments
 (0)