Berry fix for Ubuntu (#21166)

This commit is contained in:
s-hadinger 2024-04-13 15:19:04 +02:00 committed by GitHub
parent a111c0ae8f
commit 8acf4cd119
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 9 deletions

View File

@ -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);

View File

@ -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);