Skip to content

Commit f80a59f

Browse files
author
karurochori
committed
Apply fixes from stbrumme#21
Apply fixes from stbrumme#20
1 parent 51814e3 commit f80a59f

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

src/crc32.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,15 +322,15 @@ namespace
322322
{
323323
#if defined(__GNUC__) || defined(__clang__)
324324
return __builtin_bswap32(x);
325-
#endif
326-
#ifdef MSC_VER
325+
#elif defined(_MSC_VER)
327326
return _byteswap_ulong(x);
328-
#endif
327+
#else
329328

330329
return (x >> 24) |
331330
((x >> 8) & 0x0000FF00) |
332331
((x << 8) & 0x00FF0000) |
333332
(x << 24);
333+
#endif
334334
}
335335
}
336336

src/keccak.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,9 @@ namespace
5959
{
6060
#if defined(__GNUC__) || defined(__clang__)
6161
return __builtin_bswap64(x);
62-
#endif
63-
#ifdef _MSC_VER
62+
#elif _MSC_VER
6463
return _byteswap_uint64(x);
65-
#endif
64+
#else
6665

6766
return (x >> 56) |
6867
((x >> 40) & 0x000000000000FF00ULL) |
@@ -72,6 +71,7 @@ namespace
7271
((x << 24) & 0x0000FF0000000000ULL) |
7372
((x << 40) & 0x00FF000000000000ULL) |
7473
(x << 56);
74+
#endif
7575
}
7676

7777

src/md5.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ namespace
6565
{
6666
#if defined(__GNUC__) || defined(__clang__)
6767
return __builtin_bswap32(x);
68-
#endif
69-
#ifdef MSC_VER
68+
#elif defined(_MSC_VER)
7069
return _byteswap_ulong(x);
71-
#endif
70+
#else
7271

7372
return (x >> 24) |
7473
((x >> 8) & 0x0000FF00) |
7574
((x << 8) & 0x00FF0000) |
7675
(x << 24);
76+
#endif
7777
}
7878
#endif
7979
}

src/sha1.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ namespace
6161
{
6262
#if defined(__GNUC__) || defined(__clang__)
6363
return __builtin_bswap32(x);
64-
#endif
65-
#ifdef MSC_VER
64+
#elif defined(_MSC_VER)
6665
return _byteswap_ulong(x);
67-
#endif
66+
#else
6867

6968
return (x >> 24) |
7069
((x >> 8) & 0x0000FF00) |
7170
((x << 8) & 0x00FF0000) |
7271
(x << 24);
72+
#endif
7373
}
7474
}
7575

src/sha3.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,9 @@ namespace
6161
{
6262
#if defined(__GNUC__) || defined(__clang__)
6363
return __builtin_bswap64(x);
64-
#endif
65-
#ifdef _MSC_VER
64+
#elif defined(_MSC_VER)
6665
return _byteswap_uint64(x);
67-
#endif
66+
#else
6867

6968
return (x >> 56) |
7069
((x >> 40) & 0x000000000000FF00ULL) |
@@ -74,6 +73,7 @@ namespace
7473
((x << 24) & 0x0000FF0000000000ULL) |
7574
((x << 40) & 0x00FF000000000000ULL) |
7675
(x << 56);
76+
#endif
7777
}
7878

7979

0 commit comments

Comments
 (0)