Skip to content

Commit

Permalink
Fix build on linux-musl
Browse files Browse the repository at this point in the history
[ Done by updating CCAN with the ccan/endian fix --RR ]
  • Loading branch information
NicolasDorier authored and rustyrussell committed May 15, 2018
1 parent 3abd9ad commit 59154eb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ccan/README
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
CCAN imported from http://ccodearchive.net.

CCAN version: init-2419-g9bdb4be8
CCAN version: init-2423-g696c9b68
8 changes: 8 additions & 0 deletions ccan/ccan/endian/endian.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,17 @@ static inline uint64_t bswap_64(uint64_t val)
#elif HAVE_LITTLE_ENDIAN && HAVE_BIG_ENDIAN
#error "Can't compile for both big and little endian."
#elif HAVE_LITTLE_ENDIAN
#ifndef __BYTE_ORDER
#define __BYTE_ORDER __LITTLE_ENDIAN
#elif __BYTE_ORDER != __LITTLE_ENDIAN
#error "__BYTE_ORDER already defined, but not equal to __LITTLE_ENDIAN"
#endif
#elif HAVE_BIG_ENDIAN
#ifndef __BYTE_ORDER
#define __BYTE_ORDER __BIG_ENDIAN
#elif __BYTE_ORDER != __BIG_ENDIAN
#error "__BYTE_ORDER already defined, but not equal to __BIG_ENDIAN"
#endif
#endif


Expand Down
2 changes: 1 addition & 1 deletion ccan/ccan/opt/usage.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ static char *add_desc(char *base, size_t *len, size_t *max,

base = add_str(base, len, max, opt->names);
off = strlen(opt->names);
if (opt->type == OPT_HASARG
if ((opt->type & OPT_HASARG)
&& !strchr(opt->names, ' ')
&& !strchr(opt->names, '=')) {
base = add_str(base, len, max, " <arg>");
Expand Down
3 changes: 2 additions & 1 deletion ccan/tools/configurator/configurator.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ static struct test tests[] = {
"#include <stdio.h>\n"
"static char *func(int x) {"
" char *p;\n"
" if (asprintf(&p, \"%u\", x) == -1) p = NULL;"
" if (asprintf(&p, \"%u\", x) == -1) \n"
" p = NULL;\n"
" return p;\n"
"}" },
{ "HAVE_ATTRIBUTE_COLD", DEFINES_FUNC, NULL, NULL,
Expand Down

0 comments on commit 59154eb

Please sign in to comment.