Browse Source

ccan: update to latest.

configurator failed under clang:

checking for #pragma omp and -fopenmp support... ccan/tools/configurator/configurator: Test for HAVE_OPENMP failed with 32512:
./configurator.out: error while loading shared libraries: libomp.so: cannot open shared object file: No such file or directory

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
pull/2938/head
Rusty Russell 5 years ago
committed by Christian Decker
parent
commit
641876a20a
  1. 2
      ccan/README
  2. 14
      ccan/ccan/bitmap/bitmap.c
  3. 3
      ccan/ccan/bitmap/bitmap.h
  4. 2
      ccan/tools/configurator/configurator.c

2
ccan/README

@ -1,3 +1,3 @@
CCAN imported from http://ccodearchive.net.
CCAN version: init-2481-gce4660aa
CCAN version: init-2483-g920ca95d

14
ccan/ccan/bitmap/bitmap.c

@ -13,8 +13,8 @@ void bitmap_zero_range(bitmap *bitmap, unsigned long n, unsigned long m)
{
unsigned long an = BIT_ALIGN_UP(n);
unsigned long am = BIT_ALIGN_DOWN(m);
bitmap_word headmask = -1ULL >> (n % BITMAP_WORD_BITS);
bitmap_word tailmask = ~(-1ULL >> (m % BITMAP_WORD_BITS));
bitmap_word headmask = BITMAP_WORD_1 >> (n % BITMAP_WORD_BITS);
bitmap_word tailmask = ~(BITMAP_WORD_1 >> (m % BITMAP_WORD_BITS));
assert(m >= n);
@ -38,8 +38,8 @@ void bitmap_fill_range(bitmap *bitmap, unsigned long n, unsigned long m)
{
unsigned long an = BIT_ALIGN_UP(n);
unsigned long am = BIT_ALIGN_DOWN(m);
bitmap_word headmask = -1ULL >> (n % BITMAP_WORD_BITS);
bitmap_word tailmask = ~(-1ULL >> (m % BITMAP_WORD_BITS));
bitmap_word headmask = BITMAP_WORD_1 >> (n % BITMAP_WORD_BITS);
bitmap_word tailmask = ~(BITMAP_WORD_1 >> (m % BITMAP_WORD_BITS));
assert(m >= n);
@ -65,7 +65,7 @@ static int bitmap_clz(bitmap_word w)
return __builtin_clzl(w);
#else
int lz = 0;
bitmap_word mask = 1UL << (BITMAP_WORD_BITS - 1);
bitmap_word mask = (bitmap_word)1 << (BITMAP_WORD_BITS - 1);
while (!(w & mask)) {
lz++;
@ -81,8 +81,8 @@ unsigned long bitmap_ffs(const bitmap *bitmap,
{
unsigned long an = BIT_ALIGN_UP(n);
unsigned long am = BIT_ALIGN_DOWN(m);
bitmap_word headmask = -1ULL >> (n % BITMAP_WORD_BITS);
bitmap_word tailmask = ~(-1ULL >> (m % BITMAP_WORD_BITS));
bitmap_word headmask = BITMAP_WORD_1 >> (n % BITMAP_WORD_BITS);
bitmap_word tailmask = ~(BITMAP_WORD_1 >> (m % BITMAP_WORD_BITS));
assert(m >= n);

3
ccan/ccan/bitmap/bitmap.h

@ -15,6 +15,9 @@ typedef unsigned long bitmap_word;
#define BITMAP_NWORDS(_n) \
(((_n) + BITMAP_WORD_BITS - 1) / BITMAP_WORD_BITS)
#define BITMAP_WORD_0 (0)
#define BITMAP_WORD_1 ((bitmap_word)-1UL)
/*
* We wrap each word in a structure for type checking.
*/

2
ccan/tools/configurator/configurator.c

@ -431,7 +431,7 @@ static const struct test base_tests[] = {
" return i + 1;\n"
"}" },
{ "HAVE_OPENMP", "#pragma omp and -fopenmp support",
"INSIDE_MAIN", NULL, NULL,
"INSIDE_MAIN|EXECUTE|MAY_NOT_COMPILE", NULL, NULL,
"int i;\n"
"#pragma omp parallel for\n"
"for(i = 0; i < 0; i++) {};\n"

Loading…
Cancel
Save