File tree Expand file tree Collapse file tree 4 files changed +53
-28
lines changed Expand file tree Collapse file tree 4 files changed +53
-28
lines changed Original file line number Diff line number Diff line change 16
16
#ifndef COROUTINE_H
17
17
#define COROUTINE_H
18
18
19
- /**
20
- * @brief Token concatenation detail
21
- */
22
-
23
- #define TOKENCONCAT_DETAIL (x , y ) x##y
24
- /**
25
- * @brief Concatenates two tokens
26
- */
27
-
28
- #define TOKENCONCAT (x , y ) TOKENCONCAT_DETAIL(x, y)
29
- /**
30
- * @brief Generates an unique coroutine label with the __LINE__ macro
31
- */
32
- #define CR_LABEL TOKENCONCAT(CR_, __LINE__)
19
+ #include "sq_coro_common.h"
33
20
34
21
/**
35
22
* @brief Start of coroutine
Original file line number Diff line number Diff line change 14
14
#ifndef COROUTINE_HPP
15
15
#define COROUTINE_HPP
16
16
17
- /* *
18
- * @brief Token concatenation detail
19
- */
20
-
21
- #define TOKENCONCAT_DETAIL (x, y ) x##y
22
- /* *
23
- * @brief Concatenates two tokens
24
- */
25
-
26
- #define TOKENCONCAT (x, y ) TOKENCONCAT_DETAIL(x, y)
27
- /* *
28
- * @brief Generates an unique coroutine label with the __LINE__ macro
29
- */
30
- #define CR_LABEL TOKENCONCAT (CR_, __LINE__)
17
+ #include " sq_coro_common.h"
31
18
32
19
/* *
33
20
* @brief Coroutine state structure to be defined in class
Original file line number Diff line number Diff line change
1
+ /*
2
+ * SPDX-License-Identifier: MIT
3
+ *
4
+ * Copyright (c) 2023 Bart Bilos
5
+ * For conditions of distribution and use, see LICENSE file
6
+ */
7
+ /**
8
+ *\file sq_coro_common.h
9
+ *
10
+ * contains common macros for coroutines
11
+ *
12
+ */
13
+ #ifndef SQ_CORO_COMMON_H
14
+ #define SQ_CORO_COMMON_H
15
+
16
+ #include "sq_tokenconcat.h"
17
+
18
+ /**
19
+ * @brief Generates an unique coroutine label with the __LINE__ macro
20
+ */
21
+ #define CR_LABEL TOKENCONCAT(CR_, __LINE__)
22
+
23
+ #define CR_START cr_start /**< standard coroutine start */
24
+
25
+ #endif
Original file line number Diff line number Diff line change
1
+ /*
2
+ * SPDX-License-Identifier: MIT
3
+ *
4
+ * Copyright (c) 2023 Bart Bilos
5
+ * For conditions of distribution and use, see LICENSE file
6
+ */
7
+ /**
8
+ *\file sq_tokenconcat.h
9
+ *
10
+ * Contains standard preprocessor token concatenation idiom
11
+ *
12
+ */
13
+ #ifndef SQ_TOKENCONCAT_H
14
+ #define SQ_TOKENCONCAT_H
15
+
16
+ /**
17
+ * @brief Token concatenation detail
18
+ */
19
+ #define TOKENCONCAT_DETAIL (x , y ) x##y
20
+
21
+ /**
22
+ * @brief Concatenates two tokens
23
+ */
24
+ #define TOKENCONCAT (x , y ) TOKENCONCAT_DETAIL(x, y)
25
+
26
+ #endif
You can’t perform that action at this time.
0 commit comments