Fix build on linux-musl

[ Done by updating CCAN with the ccan/endian fix --RR ]
This commit is contained in:
nicolas.dorier 2018-05-09 16:48:52 +09:00 committed by Rusty Russell
parent 3abd9ad4f6
commit 59154ebd34
4 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,3 @@
CCAN imported from http://ccodearchive.net. CCAN imported from http://ccodearchive.net.
CCAN version: init-2419-g9bdb4be8 CCAN version: init-2423-g696c9b68

View File

@ -113,9 +113,17 @@ static inline uint64_t bswap_64(uint64_t val)
#elif HAVE_LITTLE_ENDIAN && HAVE_BIG_ENDIAN #elif HAVE_LITTLE_ENDIAN && HAVE_BIG_ENDIAN
#error "Can't compile for both big and little endian." #error "Can't compile for both big and little endian."
#elif HAVE_LITTLE_ENDIAN #elif HAVE_LITTLE_ENDIAN
#ifndef __BYTE_ORDER
#define __BYTE_ORDER __LITTLE_ENDIAN #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 #elif HAVE_BIG_ENDIAN
#ifndef __BYTE_ORDER
#define __BYTE_ORDER __BIG_ENDIAN #define __BYTE_ORDER __BIG_ENDIAN
#elif __BYTE_ORDER != __BIG_ENDIAN
#error "__BYTE_ORDER already defined, but not equal to __BIG_ENDIAN"
#endif
#endif #endif

View File

@ -110,7 +110,7 @@ static char *add_desc(char *base, size_t *len, size_t *max,
base = add_str(base, len, max, opt->names); base = add_str(base, len, max, opt->names);
off = strlen(opt->names); off = strlen(opt->names);
if (opt->type == OPT_HASARG if ((opt->type & OPT_HASARG)
&& !strchr(opt->names, ' ') && !strchr(opt->names, ' ')
&& !strchr(opt->names, '=')) { && !strchr(opt->names, '=')) {
base = add_str(base, len, max, " <arg>"); base = add_str(base, len, max, " <arg>");

View File

@ -102,7 +102,8 @@ static struct test tests[] = {
"#include <stdio.h>\n" "#include <stdio.h>\n"
"static char *func(int x) {" "static char *func(int x) {"
" char *p;\n" " char *p;\n"
" if (asprintf(&p, \"%u\", x) == -1) p = NULL;" " if (asprintf(&p, \"%u\", x) == -1) \n"
" p = NULL;\n"
" return p;\n" " return p;\n"
"}" }, "}" },
{ "HAVE_ATTRIBUTE_COLD", DEFINES_FUNC, NULL, NULL, { "HAVE_ATTRIBUTE_COLD", DEFINES_FUNC, NULL, NULL,