Compilation fixed on CentOS 7
Bitmap APi changes
This commit is contained in:
@@ -1618,9 +1618,17 @@ extern "C" {
|
|||||||
void ndpi_bitmap_unset(ndpi_bitmap* b, u_int32_t value);
|
void ndpi_bitmap_unset(ndpi_bitmap* b, u_int32_t value);
|
||||||
bool ndpi_bitmap_isset(ndpi_bitmap* b, u_int32_t value);
|
bool ndpi_bitmap_isset(ndpi_bitmap* b, u_int32_t value);
|
||||||
void ndpi_bitmap_clear(ndpi_bitmap* b);
|
void ndpi_bitmap_clear(ndpi_bitmap* b);
|
||||||
|
|
||||||
size_t ndpi_bitmap_serialize(ndpi_bitmap* b, char **buf);
|
size_t ndpi_bitmap_serialize(ndpi_bitmap* b, char **buf);
|
||||||
ndpi_bitmap* ndpi_bitmap_deserialize(char *buf);
|
ndpi_bitmap* ndpi_bitmap_deserialize(char *buf);
|
||||||
|
|
||||||
|
void ndpi_bitmap_and(ndpi_bitmap* a, ndpi_bitmap* b_and);
|
||||||
|
void ndpi_bitmap_or(ndpi_bitmap* a, ndpi_bitmap* b_or);
|
||||||
|
|
||||||
|
ndpi_bitmap_iterator* ndpi_bitmap_iterator_alloc(ndpi_bitmap* b);
|
||||||
|
void ndpi_bitmap_iterator_free(ndpi_bitmap* b);
|
||||||
|
bool ndpi_bitmap_iterator_next(ndpi_bitmap_iterator* i, uint32_t *value);
|
||||||
|
|
||||||
/* ******************************* */
|
/* ******************************* */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -1705,6 +1705,7 @@ typedef int (*ndpi_custom_dga_predict_fctn)(const char* domain, int domain_lengt
|
|||||||
/* **************************************** */
|
/* **************************************** */
|
||||||
|
|
||||||
typedef void ndpi_bitmap;
|
typedef void ndpi_bitmap;
|
||||||
|
typedef void ndpi_bitmap_iterator;
|
||||||
|
|
||||||
/* **************************************** */
|
/* **************************************** */
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ ndpi_bitmap* ndpi_bitmap_deserialize(char *buf) {
|
|||||||
/* ******************************************* */
|
/* ******************************************* */
|
||||||
|
|
||||||
/* b = b & b_and */
|
/* b = b & b_and */
|
||||||
void ndpi_bitmap_and(ndpi_bitmap* b, ndpi_bitmap* b_and) {
|
void ndpi_bitmap_and(ndpi_bitmap* a, ndpi_bitmap* b_and) {
|
||||||
roaring_bitmap_and_inplace((ndpi_bitmap*)a, (ndpi_bitmap*)b_and);
|
roaring_bitmap_and_inplace((ndpi_bitmap*)a, (ndpi_bitmap*)b_and);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,20 +116,13 @@ void ndpi_bitmap_or(ndpi_bitmap* a, ndpi_bitmap* b_or) {
|
|||||||
|
|
||||||
/* ******************************************* */
|
/* ******************************************* */
|
||||||
|
|
||||||
/* b = b | b_or */
|
|
||||||
void ndpi_bitmap_or(ndpi_bitmap* a, ndpi_bitmap* b_or) {
|
|
||||||
roaring_bitmap_or_inplace((ndpi_bitmap*)a, (ndpi_bitmap*)b_or);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ******************************************* */
|
|
||||||
|
|
||||||
ndpi_bitmap_iterator* ndpi_bitmap_iterator_alloc(ndpi_bitmap* b) {
|
ndpi_bitmap_iterator* ndpi_bitmap_iterator_alloc(ndpi_bitmap* b) {
|
||||||
return(roaring_create_iterator((ndpi_bitmap*)b));
|
return(roaring_create_iterator((ndpi_bitmap*)b));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************************************* */
|
/* ******************************************* */
|
||||||
|
|
||||||
ndpi_bitmap_iterator* ndpi_bitmap_iterator_free(ndpi_bitmap* b) {
|
void ndpi_bitmap_iterator_free(ndpi_bitmap* b) {
|
||||||
return(roaring_free_uint32_iterator((ndpi_bitmap*)b));
|
return(roaring_free_uint32_iterator((ndpi_bitmap*)b));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+18
-3
@@ -218,6 +218,14 @@ static inline uint32_t croaring_detect_supported_architectures() {
|
|||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
#else // defined(__cplusplus) and defined(_MSC_VER) && !defined(__clang__)
|
#else // defined(__cplusplus) and defined(_MSC_VER) && !defined(__clang__)
|
||||||
|
#if defined(__GNUC_RH_RELEASE__) && (__GNUC_RH_RELEASE__ != 5)
|
||||||
|
#define ROARING_DISABLE_AVX
|
||||||
|
#undef __AVX2__
|
||||||
|
/* CentOS 7 */
|
||||||
|
static inline uint32_t croaring_detect_supported_architectures() {
|
||||||
|
return(dynamic_croaring_detect_supported_architectures());
|
||||||
|
}
|
||||||
|
#else
|
||||||
#include <stdatomic.h>
|
#include <stdatomic.h>
|
||||||
static inline uint32_t croaring_detect_supported_architectures() {
|
static inline uint32_t croaring_detect_supported_architectures() {
|
||||||
static _Atomic int buffer = CROARING_UNINITIALIZED;
|
static _Atomic int buffer = CROARING_UNINITIALIZED;
|
||||||
@@ -226,6 +234,7 @@ static inline uint32_t croaring_detect_supported_architectures() {
|
|||||||
}
|
}
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
#endif // defined(__GNUC_RH_RELEASE__) && (__GNUC_RH_RELEASE__ != 5)
|
||||||
#endif // defined(_MSC_VER) && !defined(__clang__)
|
#endif // defined(_MSC_VER) && !defined(__clang__)
|
||||||
|
|
||||||
#ifdef ROARING_DISABLE_AVX
|
#ifdef ROARING_DISABLE_AVX
|
||||||
@@ -315,6 +324,12 @@ extern "C" { // portability definitions are in global scope, not a namespace
|
|||||||
#undef CROARING_IS_X64
|
#undef CROARING_IS_X64
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__GNUC_RH_RELEASE__) && (__GNUC_RH_RELEASE__ != 5 /* RH 8 */)
|
||||||
|
/* RH 7 don't have atomic includes */
|
||||||
|
#undef CROARING_IS_X64
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined(__clang_major__) && (__clang_major__<= 8) && !defined(__AVX2__)
|
#if defined(__clang_major__) && (__clang_major__<= 8) && !defined(__AVX2__)
|
||||||
// Older versions of clang have a bug affecting us
|
// Older versions of clang have a bug affecting us
|
||||||
// https://stackoverflow.com/questions/57228537/how-does-one-use-pragma-clang-attribute-push-with-c-namespaces
|
// https://stackoverflow.com/questions/57228537/how-does-one-use-pragma-clang-attribute-push-with-c-namespaces
|
||||||
@@ -7060,14 +7075,14 @@ static inline void tellmeall() {
|
|||||||
(long unsigned int)sizeof(size_t),
|
(long unsigned int)sizeof(size_t),
|
||||||
(long unsigned int)sizeof(int));
|
(long unsigned int)sizeof(int));
|
||||||
}
|
}
|
||||||
#if __LITTLE_ENDIAN__
|
#ifdef __LITTLE_ENDIAN__
|
||||||
// This is what we expect!
|
// This is what we expect!
|
||||||
// printf("you have little endian machine");
|
// printf("you have little endian machine");
|
||||||
#endif
|
#endif
|
||||||
#if __BIG_ENDIAN__
|
#ifdef __BIG_ENDIAN__
|
||||||
printf("you have a big endian machine");
|
printf("you have a big endian machine");
|
||||||
#endif
|
#endif
|
||||||
#if __CHAR_BIT__
|
#ifdef __CHAR_BIT__
|
||||||
if (__CHAR_BIT__ != 8) printf("on your machine, chars don't have 8bits???");
|
if (__CHAR_BIT__ != 8) printf("on your machine, chars don't have 8bits???");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user