Bitvec now builds in C++

This commit is contained in:
2025-08-01 00:47:08 -04:00
parent 4284c308be
commit 9ddcb3c509
5 changed files with 9 additions and 5 deletions

View File

@ -66,8 +66,8 @@ flenser_SOURCES = \
list.h \ list.h \
url.cc \ url.cc \
url.hh \ url.hh \
bitvec.c \ bitvec.cc \
bitvec.h \ bitvec.hh \
klist.c \ klist.c \
klist.h \ klist.h \
chain.cc \ chain.cc \

View File

@ -14,8 +14,9 @@
*/ */
#include "../dlib/dlib.h" #include "../dlib/dlib.h"
#include "bitvec.h" #include "bitvec.hh"
extern "C" {
/** /**
* Create a new bitvec with 'num_bits' size * Create a new bitvec with 'num_bits' size
@ -65,3 +66,4 @@ void a_Bitvec_set_bit(bitvec_t *bvec, int pos)
dReturn_if_fail (pos < bvec->len); dReturn_if_fail (pos < bvec->len);
bvec->vec[pos/BVEC_SIZE] |= 1 << (pos % BVEC_SIZE); bvec->vec[pos/BVEC_SIZE] |= 1 << (pos % BVEC_SIZE);
} }
}

View File

@ -12,6 +12,7 @@ typedef struct {
} bitvec_t; } bitvec_t;
extern "C" {
/* /*
* Function prototypes * Function prototypes
*/ */
@ -31,5 +32,6 @@ void a_Bitvec_clear(bitvec_t *bvec);
#define a_Bitvec_clear_bit(bvec,pos) \ #define a_Bitvec_clear_bit(bvec,pos) \
((bvec)->vec[(pos)/BVEC_SIZE] &= ~(1 << (pos) % BVEC_SIZE)) ((bvec)->vec[(pos)/BVEC_SIZE] &= ~(1 << (pos) % BVEC_SIZE))
}
#endif /* __BITVEC_H__ */ #endif /* __BITVEC_H__ */

View File

@ -6,7 +6,7 @@ extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */
#include "bitvec.h" #include "bitvec.hh"
#include "image.hh" #include "image.hh"
#include "cache.hh" #include "cache.hh"

View File

@ -24,7 +24,7 @@ extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */
#include "bitvec.h" #include "bitvec.hh"
#include "url.hh" #include "url.hh"
/* /*