10000 Removed dependency on `PGM_P` as Particle 0.6.2 doesn't define it (is… · thehellmaker/ArduinoJson@788c9be · GitHub
[go: up one dir, main page]

Skip to content

Commit 788c9be

Browse files
committed
Removed dependency on PGM_P as Particle 0.6.2 doesn't define it (issue bblanchon#546)
1 parent c3d7a79 commit 788c9be

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
ArduinoJson: change log
22
=======================
33

4+
HEAD
5+
----
6+
7+
* Removed dependency on `PGM_P` as Particle 0.6.2 doesn't define it (issue #546)
8+
49
v5.11.0
510
-------
611

src/ArduinoJson/StringTraits/FlashString.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ struct StringTraits<const __FlashStringHelper*, void> {
3434
};
3535

3636
static bool equals(const __FlashStringHelper* str, const char* expected) {
37-
return strcmp_P(expected, (PGM_P)str) == 0;
37+
return strcmp_P(expected, (const char*)str) == 0;
3838
}
3939

4040
template <typename Buffer>
4141
static char* duplicate(const __FlashStringHelper* str, Buffer* buffer) {
4242
if (!str) return NULL;
43-
size_t size = strlen_P((PGM_P)str) + 1;
43+
size_t size = strlen_P((const char*)str) + 1;
4444
void* dup = buffer->alloc(size);
45-
if (dup != NULL) memcpy_P(dup, (PGM_P)str, size);
45+
if (dup != NULL) memcpy_P(dup, (const char*)str, size);
4646
return static_cast<char*>(dup);
4747
}
4848

0 commit comments

Comments
 (0)
0