mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-25 11:46:31 +00:00
Berry fix for Ubuntu (#21166)
This commit is contained in:
parent
a111c0ae8f
commit
8acf4cd119
@ -23,17 +23,17 @@
|
|||||||
|
|
||||||
static int str_strncasecmp(const char *s1, const char *s2, size_t n)
|
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)) {
|
while (n-- != 0 && tolower(*s1) == tolower(*s2)) {
|
||||||
if (n == 0 || *s1 == '\0' || *s2 == '\0')
|
if (n == 0 || *s1 == '\0' || *s2 == '\0')
|
||||||
break;
|
break;
|
||||||
s1++;
|
s1++;
|
||||||
s2++;
|
s2++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return tolower(*(const unsigned char *)s1)
|
return tolower(*(const unsigned char *)s1)
|
||||||
- tolower(*(const unsigned char *)s2);
|
- tolower(*(const unsigned char *)s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef bint (*str_opfunc)(const char*, const char*, bint, bint);
|
typedef bint (*str_opfunc)(const char*, const char*, bint, bint);
|
||||||
|
@ -14,6 +14,9 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.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,
|
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);
|
intptr_t p4, intptr_t p5, intptr_t p6, intptr_t p7);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user