mirror of
https://github.com/esp8266/Arduino.git
synced 2025-10-13 23:48:28 +03:00
Use PGM_P instead of prog_char
On later versions of avr-libc, prog_char is deprecated. In0acebeeff4
the one occurence of prog_char was replaced by "char PROGMEM", which is not entirely correct (PROGMEM is supposed to be an attribute on a variable, not on a type, even though this is how things work in older libc versions). However, in1130fede3a
a few new occurences of prog_char are introduced, which break compilation on newer libc versions again. This commit changes all these pointer types to use the PGM_P macro from <avr/pgmspace.h>. This macro is just "const char *" in newer libc versions and "const prog_char *" in older versions, so it should always work. References #795
This commit is contained in:
committed by
Cristian Maglie
parent
0b72c88b42
commit
98777e816f
@@ -187,7 +187,7 @@ String & String::copy(const __FlashStringHelper *pstr, unsigned int length)
|
||||
return *this;
|
||||
}
|
||||
len = length;
|
||||
strcpy_P(buffer, (const prog_char *)pstr);
|
||||
strcpy_P(buffer, (PGM_P)pstr);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ String & String::operator = (const char *cstr)
|
||||
|
||||
String & String::operator = (const __FlashStringHelper *pstr)
|
||||
{
|
||||
if (pstr) copy(pstr, strlen_P((const prog_char *)pstr));
|
||||
if (pstr) copy(pstr, strlen_P((PGM_P)pstr));
|
||||
else invalidate();
|
||||
|
||||
return *this;
|
||||
|
Reference in New Issue
Block a user