Skip to content

Commit 16d9faa

Browse files
committed
Change data tag to __fstr__ for improved filtering in linker script.
This also accommodates use within templated code, where GCC ignores section attribute.
1 parent bd37f99 commit 16d9faa

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

map.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ The macro in the first example above produces a structure like this::
101101
constexpr const struct {
102102
ObjectBase object;
103103
MapPair<int, String> data[2];
104-
} fstr_data_intmap PROGMEM = {
104+
} __fstr__intmap PROGMEM = {
105105
{16},
106106
{35, &content1},
107107
{180, &content2},
108108
};
109-
const Map<int, String>& intmap = fstr_data_intmap.object.as<Map<int, String>>();
109+
const Map<int, String>& intmap = __fstr__intmap.object.as<Map<int, String>>();
110110

111111
Note: ``FSTR::`` namespace qualifier omitted for clarity.
112112

src/include/FlashString/Object.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
/**
4747
* @brief Provide internal name for generated flash string structures
4848
*/
49-
#define FSTR_DATA_NAME(name) fstr_data_##name
49+
#define FSTR_DATA_NAME(name) __fstr__##name
5050

5151
/**
5252
* @brief Given an Object& reference, return a pointer to the actual object

src/include/FlashString/String.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ typedef const __FlashStringHelper* flash_string_t;
4242
*/
4343
#define FS_PTR(str) \
4444
(__extension__({ \
45-
static DEFINE_FSTR_DATA(struc, str); \
46-
static_cast<const FSTR::String*>(&struc.object); \
45+
static DEFINE_FSTR_DATA(__fstr__, str); \
46+
static_cast<const FSTR::String*>(&__fstr__.object); \
4747
}))
4848

4949
/**

vector.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ The above example generates a structure like this::
7070
const struct {
7171
ObjectBase object;
7272
String* entries[4];
73-
} fstr_data_myTable PROGMEM = {
73+
} __fstr__myTable PROGMEM = {
7474
{16},
7575
&str1,
7676
&str2,
7777
nullptr,
7878
&str3,
7979
};
80-
const Vector<String>& myTable PROGMEM = fstr_data_myTable.as<Vector<String>>();
80+
const Vector<String>& myTable PROGMEM = __fstr__myTable.as<Vector<String>>();
8181

8282
Note: ``FSTR::`` namespace qualifier omitted for clarity.
8383

0 commit comments

Comments
 (0)