Skip to content

Commit 66a0461

Browse files
committed
Update x86 and x86_64 arch checks to use the recommended
define names, resulting in improved compiler support. Based on the overviews from several sites, such as: http://nadeausoftware.com/articles/2012/02/c_c_tip_how_detect_processor_type_using_compiler_predefined_macros
1 parent 17b7471 commit 66a0461

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

arch/x86/deflate_quick.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ static inline long compare258(const unsigned char *const src0, const unsigned ch
9393
"cmp $256 + 16, %[ax]\n\t"
9494
"jb 1b\n\t"
9595

96-
# if !defined(__x86_64)
96+
# if !defined(__x86_64__)
9797
"movzwl -16(%[src0], %[ax]), %[dx]\n\t"
9898
# else
9999
"movzwq -16(%[src0], %[ax]), %[dx]\n\t"

deflate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ int ZEXPORT PREFIX(deflateInit2_)(PREFIX3(stream) *strm, int level, int method,
301301

302302
s->hash_size = 1 << s->hash_bits;
303303
s->hash_mask = s->hash_size - 1;
304-
#if !defined(__x86_64) && !defined(__i386_)
304+
#if !defined(__x86_64__) && !defined(_M_X64) && !defined(__i386) && !defined(_M_IX86)
305305
s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);
306306
#endif
307307

deflate.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ typedef struct internal_state {
154154
unsigned int hash_bits; /* log2(hash_size) */
155155
unsigned int hash_mask; /* hash_size-1 */
156156

157-
#if !defined(__x86_64) && !defined(__i386_)
157+
#if !defined(__x86_64__) && !defined(_M_X64) && !defined(__i386) && !defined(_M_IX86)
158158
unsigned int hash_shift;
159159
#endif
160160
/* Number of bits by which ins_h must be shifted at each input
@@ -392,7 +392,7 @@ void ZLIB_INTERNAL bi_windup(deflate_state *s);
392392
#define TRIGGER_LEVEL 5
393393
#endif
394394

395-
#if defined(__x86_64) || defined(__i386_)
395+
#if defined(__x86_64__) || defined(_M_X64) || defined(__i386) || defined(_M_IX86)
396396
#define UPDATE_HASH(s, h, i) \
397397
do {\
398398
if (s->level < TRIGGER_LEVEL) \

0 commit comments

Comments
 (0)