PSTR for arduino literals
This commit is contained in:
parent
d3ec5a2cee
commit
93537183da
1 changed files with 6 additions and 0 deletions
|
|
@ -385,6 +385,11 @@ static N_INLINE(NI32, float32ToInt32)(float x) {
|
||||||
#define zeroMem(a, size) memset(a, 0, size)
|
#define zeroMem(a, size) memset(a, 0, size)
|
||||||
#define equalMem(a, b, size) (memcmp(a, b, size) == 0)
|
#define equalMem(a, b, size) (memcmp(a, b, size) == 0)
|
||||||
|
|
||||||
|
#ifdef ARDUINO
|
||||||
|
#include <avr/pgmspace.h>
|
||||||
|
#define STRING_LITERAL(name, str, length) \
|
||||||
|
name = PSTR(str)
|
||||||
|
#else
|
||||||
#define STRING_LITERAL(name, str, length) \
|
#define STRING_LITERAL(name, str, length) \
|
||||||
static const struct { \
|
static const struct { \
|
||||||
TGenericSeq Sup; \
|
TGenericSeq Sup; \
|
||||||
|
|
@ -392,6 +397,7 @@ static N_INLINE(NI32, float32ToInt32)(float x) {
|
||||||
} name = {{length, length}, str}
|
} name = {{length, length}, str}
|
||||||
|
|
||||||
typedef struct TStringDesc* string;
|
typedef struct TStringDesc* string;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* declared size of a sequence: */
|
/* declared size of a sequence: */
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue