mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Make things work in visual studio.
This commit is contained in:
parent
1fd054baae
commit
3ce7177a17
@ -23,6 +23,13 @@ namespace dlib
|
||||
|
||||
// Microsoft Visual Studio
|
||||
|
||||
|
||||
#if (defined(__GNUC__) || defined(__clang__))
|
||||
#define DLIB_FALLTHROUGH [[fallthrough]]
|
||||
#else
|
||||
#define DLIB_FALLTHROUGH
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
|
||||
#define DLIB_FORCE_INLINE __forceinline
|
||||
@ -214,9 +221,9 @@ namespace dlib
|
||||
switch(len & 3)
|
||||
{
|
||||
case 3: k1 ^= tail[2] << 16;
|
||||
[[fallthrough]]; // fall through
|
||||
DLIB_FALLTHROUGH; // fall through
|
||||
case 2: k1 ^= tail[1] << 8;
|
||||
[[fallthrough]]; // fall through
|
||||
DLIB_FALLTHROUGH; // fall through
|
||||
case 1: k1 ^= tail[0];
|
||||
k1 *= c1; k1 = DLIB_ROTL32(k1,15); k1 *= c2; h1 ^= k1;
|
||||
};
|
||||
@ -386,22 +393,22 @@ namespace dlib
|
||||
|
||||
switch(len & 15)
|
||||
{
|
||||
case 15: k2 ^= uint64(tail[14]) << 48; [[fallthrough]]; // fall through
|
||||
case 14: k2 ^= uint64(tail[13]) << 40; [[fallthrough]]; // fall through
|
||||
case 13: k2 ^= uint64(tail[12]) << 32; [[fallthrough]]; // fall through
|
||||
case 12: k2 ^= uint64(tail[11]) << 24; [[fallthrough]]; // fall through
|
||||
case 11: k2 ^= uint64(tail[10]) << 16; [[fallthrough]]; // fall through
|
||||
case 10: k2 ^= uint64(tail[ 9]) << 8; [[fallthrough]]; // fall through
|
||||
case 15: k2 ^= uint64(tail[14]) << 48; DLIB_FALLTHROUGH; // fall through
|
||||
case 14: k2 ^= uint64(tail[13]) << 40; DLIB_FALLTHROUGH; // fall through
|
||||
case 13: k2 ^= uint64(tail[12]) << 32; DLIB_FALLTHROUGH; // fall through
|
||||
case 12: k2 ^= uint64(tail[11]) << 24; DLIB_FALLTHROUGH; // fall through
|
||||
case 11: k2 ^= uint64(tail[10]) << 16; DLIB_FALLTHROUGH; // fall through
|
||||
case 10: k2 ^= uint64(tail[ 9]) << 8; DLIB_FALLTHROUGH; // fall through
|
||||
case 9: k2 ^= uint64(tail[ 8]) << 0;
|
||||
k2 *= c2; k2 = DLIB_ROTL64(k2,33); k2 *= c1; h2 ^= k2; [[fallthrough]]; // fall through
|
||||
k2 *= c2; k2 = DLIB_ROTL64(k2,33); k2 *= c1; h2 ^= k2; DLIB_FALLTHROUGH; // fall through
|
||||
|
||||
case 8: k1 ^= uint64(tail[ 7]) << 56; [[fallthrough]]; // fall through
|
||||
case 7: k1 ^= uint64(tail[ 6]) << 48; [[fallthrough]]; // fall through
|
||||
case 6: k1 ^= uint64(tail[ 5]) << 40; [[fallthrough]]; // fall through
|
||||
case 5: k1 ^= uint64(tail[ 4]) << 32; [[fallthrough]]; // fall through
|
||||
case 4: k1 ^= uint64(tail[ 3]) << 24; [[fallthrough]]; // fall through
|
||||
case 3: k1 ^= uint64(tail[ 2]) << 16; [[fallthrough]]; // fall through
|
||||
case 2: k1 ^= uint64(tail[ 1]) << 8; [[fallthrough]]; // fall through
|
||||
case 8: k1 ^= uint64(tail[ 7]) << 56; DLIB_FALLTHROUGH; // fall through
|
||||
case 7: k1 ^= uint64(tail[ 6]) << 48; DLIB_FALLTHROUGH; // fall through
|
||||
case 6: k1 ^= uint64(tail[ 5]) << 40; DLIB_FALLTHROUGH; // fall through
|
||||
case 5: k1 ^= uint64(tail[ 4]) << 32; DLIB_FALLTHROUGH; // fall through
|
||||
case 4: k1 ^= uint64(tail[ 3]) << 24; DLIB_FALLTHROUGH; // fall through
|
||||
case 3: k1 ^= uint64(tail[ 2]) << 16; DLIB_FALLTHROUGH; // fall through
|
||||
case 2: k1 ^= uint64(tail[ 1]) << 8; DLIB_FALLTHROUGH; // fall through
|
||||
case 1: k1 ^= uint64(tail[ 0]) << 0;
|
||||
k1 *= c1; k1 = DLIB_ROTL64(k1,31); k1 *= c2; h1 ^= k1;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user