diff --git a/libraries/Desktop/include/avr/pgmspace.h b/libraries/Desktop/include/avr/pgmspace.h index f166b2b0d8..dd13ee03a0 100644 --- a/libraries/Desktop/include/avr/pgmspace.h +++ b/libraries/Desktop/include/avr/pgmspace.h @@ -27,6 +27,7 @@ extern "C" { typedef char PROGMEM prog_char; extern int strcasecmp_P(const char *, PGM_P) __ATTR_PURE__; extern int strcmp_P(const char *, PGM_P) __ATTR_PURE__; +extern int strncmp_P(const char *, PGM_P, size_t n) __ATTR_PURE__; extern size_t strlcat_P (char *, PGM_P, size_t ); extern size_t strnlen_P (PGM_P, size_t ); extern size_t strlen_P (PGM_P); diff --git a/libraries/Desktop/support/Arduino.cpp b/libraries/Desktop/support/Arduino.cpp index bbcb0c9918..134bdc635d 100644 --- a/libraries/Desktop/support/Arduino.cpp +++ b/libraries/Desktop/support/Arduino.cpp @@ -87,6 +87,16 @@ int strcmp_P(PGM_P str1, PGM_P str2) return strcmp(str1, str2); } +int strncmp_P(PGM_P str1, PGM_P str2, size_t n) +{ + return strncmp(str1, str2, n); +} + +char *strncpy_P(char *dest, PGM_P src, size_t n) +{ + return strncpy(dest, src, n); +} + void *memcpy_P(void *dest, PGM_P src, size_t n) { return memcpy(dest, src, n);