Skip to content

Commit 8663d4f

Browse files
committed
A few fixes to prepare for MSVC building
1 parent 3986ded commit 8663d4f

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

include/minisketch.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33

44
#include <stdint.h>
55
#include <stdlib.h>
6+
7+
#ifdef WIN32
8+
#include <compat.h>
9+
#else
610
#include <unistd.h>
11+
#endif
712

813
#ifdef __cplusplus
914
# if __cplusplus >= 201103L

src/fields/clmul_common_impl.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
#define _MINISKETCH_FIELDS_CLMUL_COMMON_IMPL_H_ 1
99

1010
#include <stdint.h>
11+
12+
#ifdef WIN32
13+
#include <immintrin.h>
14+
#else
1115
#include <x86intrin.h>
16+
#endif
1217

1318
#include "../int_utils.h"
1419
#include "../lintrans.h"

src/minisketch.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ int minisketch_implementation_supported(uint32_t bits, uint32_t implementation)
332332
delete sketch;
333333
return 1;
334334
}
335-
} catch (std::bad_alloc& ba) {}
335+
} catch (std::bad_alloc) {}
336336
return 0;
337337
}
338338

@@ -345,14 +345,14 @@ minisketch* minisketch_create(uint32_t bits, uint32_t implementation, size_t cap
345345
if (sketch) {
346346
try {
347347
sketch->Init(capacity);
348-
} catch (std::bad_alloc& ba) {
348+
} catch (std::bad_alloc) {
349349
delete sketch;
350350
throw;
351351
}
352352
sketch->Ready();
353353
}
354354
return (minisketch*)sketch;
355-
} catch (std::bad_alloc& ba) {
355+
} catch (std::bad_alloc) {
356356
return nullptr;
357357
}
358358
}

0 commit comments

Comments
 (0)