Skip to content

Commit ec49c07

Browse files
committed
A few fixes to prepare for MSVC building
1 parent 20a8529 commit ec49c07

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

include/minisketch.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33

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

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

src/fields/clmul_common_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#define _MINISKETCH_FIELDS_CLMUL_COMMON_IMPL_H_ 1
99

1010
#include <stdint.h>
11-
#include <x86intrin.h>
11+
#include <immintrin.h>
1212

1313
#include "../int_utils.h"
1414
#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 (const std::bad_alloc&) {}
336336
return 0;
337337
}
338338

@@ -342,14 +342,14 @@ minisketch* minisketch_create(uint32_t bits, uint32_t implementation, size_t cap
342342
if (sketch) {
343343
try {
344344
sketch->Init(capacity);
345-
} catch (std::bad_alloc& ba) {
345+
} catch (const std::bad_alloc&) {
346346
delete sketch;
347347
throw;
348348
}
349349
sketch->Ready();
350350
}
351351
return (minisketch*)sketch;
352-
} catch (std::bad_alloc& ba) {
352+
} catch (const std::bad_alloc&) {
353353
return nullptr;
354354
}
355355
}

0 commit comments

Comments
 (0)