Skip to content

Commit fe08f19

Browse files
authoredOct 18, 2021
Merge pull request #37 from bcmi-labs/fix-remove-superfluous-macro
Cleanup/Remove superfluous macros
2 parents 3d96dd4 + b233ee4 commit fe08f19

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed
 

‎src/Arduino_Threads.h

+8-11
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,15 @@ 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+
85+
#define ARDUINO_THREADS_TO_STRING(sequence) #sequence
86+
8287
/**************************************************************************************
8388
* CLASS DECLARATION
8489
**************************************************************************************/
8590

86-
#define CONCAT2(x,y) x##y
87-
#define CONCAT(x,y) CONCAT2(x,y)
88-
89-
#define INCF(F) INCF_(F)
90-
#define INCF_(F) #F
91-
92-
#define _macroToString(sequence) #sequence
93-
9491
class Arduino_Threads
9592
{
9693
public:
@@ -124,13 +121,13 @@ class Arduino_Threads
124121
void threadFunc();
125122
};
126123

127-
#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 { \
128125
public: \
129-
CONCAT(tabname, Class)() { _tabname = _macroToString(tabname); } \
126+
ARDUINO_THREADS_CONCAT(tabname, Class)() { _tabname = ARDUINO_THREADS_TO_STRING(tabname); } \
130127
private: \
131128

132129
#define THD_DONE(tabname) \
133130
}; \
134-
CONCAT(tabname,Class) tabname;
131+
ARDUINO_THREADS_CONCAT(tabname,Class) tabname;
135132

136133
#endif /* ARDUINO_THREADS_H_ */

0 commit comments

Comments
 (0)
Please sign in to comment.