Browse Source

Adding new THREAD_RETURN macro to other ports

Joel Bodenmann 4 years ago
parent
commit
46619f60cd

+ 1 - 0
src/gos/gos_chibios.h

@@ -56,6 +56,7 @@ typedef tprio_t		threadpriority_t;
56 56
 
57 57
 #define DECLARE_THREAD_STACK(name, sz)			WORKING_AREA(name, sz)
58 58
 #define DECLARE_THREAD_FUNCTION(fnName, param)	threadreturn_t fnName(void *param)
59
+#define THREAD_RETURN(retval)					return retval
59 60
 
60 61
 #if CH_KERNEL_MAJOR == 2
61 62
 	typedef struct {

+ 1 - 0
src/gos/gos_ecos.h

@@ -46,6 +46,7 @@ typedef cyg_handle_t		gfxThreadHandle;
46 46
 
47 47
 #define DECLARE_THREAD_STACK(name, sz)			struct { cyg_thread t; unsigned char stk[sz]; } name[1]
48 48
 #define DECLARE_THREAD_FUNCTION(fnName, param)	threadreturn_t fnName(cyg_addrword_t param)
49
+#define THREAD_RETURN(retval)
49 50
 
50 51
 typedef struct {
51 52
 	cyg_sem_t	sem;

+ 1 - 0
src/gos/gos_freertos.h

@@ -62,6 +62,7 @@ typedef portBASE_TYPE		threadpriority_t;
62 62
 /* FreeRTOS will allocate the stack when creating the thread, so pass the size instead of a working area */
63 63
 #define DECLARE_THREAD_STACK(name, sz)			size_t *name = (size_t *)sz
64 64
 #define DECLARE_THREAD_FUNCTION(fnName, param)	threadreturn_t fnName(void *param)
65
+#define THREAD_RETURN(retval)
65 66
 portTickType MS2ST(portTickType ms);
66 67
 
67 68
 typedef struct {

+ 1 - 0
src/gos/gos_linux.h

@@ -37,6 +37,7 @@ typedef pthread_mutex_t		gfxMutex;
37 37
 
38 38
 #define DECLARE_THREAD_FUNCTION(fnName, param)	threadreturn_t fnName(void *param)
39 39
 #define DECLARE_THREAD_STACK(name, sz)			uint8_t name[0];
40
+#define THREAD_RETURN(retval)					return retval
40 41
 
41 42
 #define gfxExit()						exit(0)
42 43
 #define gfxAlloc(sz)					malloc(sz)

+ 1 - 0
src/gos/gos_osx.h

@@ -27,6 +27,7 @@ typedef pthread_mutex_t		gfxMutex;
27 27
 
28 28
 #define DECLARE_THREAD_FUNCTION(fnName, param)	threadreturn_t fnName(void *param)
29 29
 #define DECLARE_THREAD_STACK(name, sz)			uint8_t name[0];
30
+#define THREAD_RETURN(retval)					return reval
30 31
 
31 32
 #define gfxExit()						exit(0)
32 33
 #define gfxAlloc(sz)					malloc(sz)

+ 1 - 0
src/gos/gos_rawrtos.h

@@ -27,6 +27,7 @@ typedef RAW_TASK_OBJ*		gfxThreadHandle;
27 27
 
28 28
 #define DECLARE_THREAD_FUNCTION(fnName, param)	threadreturn_t fnName(void *param)
29 29
 #define DECLARE_THREAD_STACK(name, sz)			PORT_STACK name[sz];
30
+#define THREAD_RETURN(retval)					return retval
30 31
 
31 32
 #define gfxHalt(msg)					for(;;)
32 33
 #define gfxExit()						for(;;)

+ 1 - 0
src/gos/gos_win32.h

@@ -48,6 +48,7 @@ typedef int					threadpriority_t;
48 48
 
49 49
 #define DECLARE_THREAD_FUNCTION(fnName, param)	threadreturn_t WINAPI fnName(void *param)
50 50
 #define DECLARE_THREAD_STACK(name, sz)			uint8_t name[0];
51
+#define THREAD_RETURN(retval)					return retval
51 52
 
52 53
 #define TIME_IMMEDIATE				0
53 54
 #define TIME_INFINITE				INFINITE

+ 1 - 0
src/gos/gos_x_threads.h

@@ -32,6 +32,7 @@ typedef int				threadpriority_t;
32 32
 
33 33
 #define DECLARE_THREAD_FUNCTION(fnName, param)	threadreturn_t fnName(void *param)
34 34
 #define DECLARE_THREAD_STACK(name, sz)			uint8_t name[sz];
35
+#define THREAD_RETURN(retval)					return retval
35 36
 
36 37
 #define TIME_IMMEDIATE				0
37 38
 #define TIME_INFINITE				((delaytime_t)-1)