Skip to content

Commit e96894c

Browse files
committed
Rename CONCAT/CONCAT2 to ARDUINO_THREADS_CONCAT/_ in order to prevent name-clashes with similar named macros.
1 parent 9af57d4 commit e96894c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: src/Arduino_Threads.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ public: \
7979
#define SHARED(name, type) \
8080
Shared<type> name;
8181

82+
#define ARDUINO_THREADS_CONCAT_(x,y) x##y
83+
#define ARDUINO_THREADS_CONCAT(x,y) ARDUINO_THREADS_CONCAT_(x,y)
84+
8285
/**************************************************************************************
8386
* CLASS DECLARATION
8487
**************************************************************************************/
8588

86-
#define CONCAT2(x,y) x##y
87-
#define CONCAT(x,y) CONCAT2(x,y)
88-
8989
#define _macroToString(sequence) #sequence
9090

9191
class Arduino_Threads
@@ -121,13 +121,13 @@ class Arduino_Threads
121121
void threadFunc();
122122
};
123123

124-
#define THD_ENTER(tabname) class CONCAT(tabname, Class) : public Arduino_Threads { \
124+
#define THD_ENTER(tabname) class ARDUINO_THREADS_CONCAT(tabname, Class) : public Arduino_Threads { \
125125
public: \
126-
CONCAT(tabname, Class)() { _tabname = _macroToString(tabname); } \
126+
ARDUINO_THREADS_CONCAT(tabname, Class)() { _tabname = _macroToString(tabname); } \
127127
private: \
128128

129129
#define THD_DONE(tabname) \
130130
}; \
131-
CONCAT(tabname,Class) tabname;
131+
ARDUINO_THREADS_CONCAT(tabname,Class) tabname;
132132

133133
#endif /* ARDUINO_THREADS_H_ */

0 commit comments

Comments
 (0)