Skip to content

Commit

Permalink
Berry fix for Ubuntu (#21166)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-hadinger authored Apr 13, 2024
1 parent a111c0a commit 8acf4cd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/libesp32/berry/src/be_strlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@

static int str_strncasecmp(const char *s1, const char *s2, size_t n)
{
if (n == 0) return 0;
if (n == 0) return 0;

while (n-- != 0 && tolower(*s1) == tolower(*s2)) {
if (n == 0 || *s1 == '\0' || *s2 == '\0')
break;
s1++;
s2++;
}
while (n-- != 0 && tolower(*s1) == tolower(*s2)) {
if (n == 0 || *s1 == '\0' || *s2 == '\0')
break;
s1++;
s2++;
}

return tolower(*(const unsigned char *)s1)
- tolower(*(const unsigned char *)s2);
return tolower(*(const unsigned char *)s1)
- tolower(*(const unsigned char *)s2);
}

typedef bint (*str_opfunc)(const char*, const char*, bint, bint);
Expand Down
3 changes: 3 additions & 0 deletions lib/libesp32/berry_mapping/src/be_class_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
#include <string.h>
#include <stdlib.h>

/* Ubuntu 22.04 LTS seems to have an invalid or missing signature for strtok_r, forcing a correct one */
extern char *strtok_r(char *str, const char *delim, char **saveptr);

typedef intptr_t (*fn_any_callable)(intptr_t p0, intptr_t p1, intptr_t p2, intptr_t p3,
intptr_t p4, intptr_t p5, intptr_t p6, intptr_t p7);

Expand Down

0 comments on commit 8acf4cd

Please sign in to comment.