From f2a0a49d55eb8f963c0c5c07bfd95959a43bbd7b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 26 Nov 2011 17:18:09 +1100 Subject: [PATCH] desktop: fixed desktop build for strlcat_P() changes --- libraries/Desktop/include/avr/pgmspace.h | 4 ++++ libraries/Desktop/support/Arduino.cpp | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/libraries/Desktop/include/avr/pgmspace.h b/libraries/Desktop/include/avr/pgmspace.h index c9ceb57367..f166b2b0d8 100644 --- a/libraries/Desktop/include/avr/pgmspace.h +++ b/libraries/Desktop/include/avr/pgmspace.h @@ -29,6 +29,10 @@ extern int strcasecmp_P(const char *, PGM_P) __ATTR_PURE__; extern int strcmp_P(const char *, PGM_P) __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); +extern size_t strlen_P (PGM_P); +extern char *strncpy_P(char *dest, PGM_P src, size_t n); +extern void *memcpy_P(void *dest, PGM_P src, size_t n); static inline uint8_t pgm_read_byte(PGM_P s) { return (uint8_t)*s; } static inline uint16_t pgm_read_word(const void *s) { return *(const uint16_t *)s; } diff --git a/libraries/Desktop/support/Arduino.cpp b/libraries/Desktop/support/Arduino.cpp index 355fcc6307..34db6f58be 100644 --- a/libraries/Desktop/support/Arduino.cpp +++ b/libraries/Desktop/support/Arduino.cpp @@ -72,6 +72,11 @@ size_t strnlen_P(PGM_P str, size_t size) return strnlen(str, size); } +size_t strlen_P(PGM_P str) +{ + return strlen(str); +} + int strcasecmp_P(PGM_P str1, PGM_P str2) { return strcasecmp(str1, str2); @@ -82,6 +87,11 @@ int strcmp_P(PGM_P str1, PGM_P str2) return strcmp(str1, str2); } +void *memcpy_P(void *dest, PGM_P src, size_t n) +{ + return memcpy(dest, src, n); +} + void digitalWrite(uint8_t pin, uint8_t val) {