Skip to content

Commit

Permalink
Merge pull request #107 from Makuna/StrNAdditions
Browse files Browse the repository at this point in the history
missing strn program space wrappers
  • Loading branch information
igrr committed Apr 26, 2015
2 parents eab9e87 + 64a2f1e commit 6a37b44
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hardware/arduino/sam/cores/arduino/avr/pgmspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ typedef uint32_t prog_uint32_t;
#define strstr_P(a, b) strstr((a), (b))
#define strlen_P(a) strlen((a))
#define sprintf_P(s, f, ...) sprintf((s), (f), __VA_ARGS__)
#define strcasecmp_P(a, b) strcasecmp((a), (b))
#define strncpy_P(dest, src, size) strncpy((dest), (src), (size))
#define strncat_P(dest, src, size) strncat((dest), (src), (size))
#define strncmp_P(a, b, size) strncmp((a), (b), (size))
#define strnlen_P(s, size) strnlen((const char *)(s), (size))
#define strncasecmp_P(a, b, size) strncasecmp((a), (b), (size))

#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
#define pgm_read_word(addr) (*(const unsigned short *)(addr))
Expand Down
6 changes: 6 additions & 0 deletions hardware/esp8266com/esp8266/cores/esp8266/pgmspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ typedef uint32_t prog_uint32_t;
#define strcmp_P(a, b) strcmp((a), (b))
#define strstr_P(a, b) strstr((a), (b))
#define strlen_P(s) strlen((const char *)(s))
#define strcasecmp_P(a, b) strcasecmp((a), (b))
#define strncpy_P(dest, src, size) strncpy((dest), (src), (size))
#define strncat_P(dest, src, size) strncat((dest), (src), (size))
#define strncmp_P(a, b, size) strncmp((a), (b), (size))
#define strnlen_P(s, size) strnlen((const char *)(s), (size))
#define strncasecmp_P(a, b, size) strncasecmp((a), (b), (size))

#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
#define pgm_read_word(addr) (*(const unsigned short *)(addr))
Expand Down

0 comments on commit 6a37b44

Please sign in to comment.