mirror of https://github.com/0intro/libtask
fix clang warnings
amd64-ucontext.h:3:25: warning: redefinition of typedef 'mcontext_t' is a C11 feature amd64-ucontext.h:4:25: warning: redefinition of typedef 'ucontext_t' is a C11 feature context.c:86:3: warning: indirection of non-volatile null pointer will be deleted, not trap
This commit is contained in:
parent
3ae1151187
commit
53021339da
|
@ -83,7 +83,7 @@ makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...)
|
||||||
|
|
||||||
memset(&ucp->uc_mcontext, 0, sizeof ucp->uc_mcontext);
|
memset(&ucp->uc_mcontext, 0, sizeof ucp->uc_mcontext);
|
||||||
if(argc != 2)
|
if(argc != 2)
|
||||||
*(int*)0 = 0;
|
*(volatile int*)0 = 0;
|
||||||
va_start(va, argc);
|
va_start(va, argc);
|
||||||
ucp->uc_mcontext.mc_rdi = va_arg(va, int);
|
ucp->uc_mcontext.mc_rdi = va_arg(va, int);
|
||||||
ucp->uc_mcontext.mc_rsi = va_arg(va, int);
|
ucp->uc_mcontext.mc_rsi = va_arg(va, int);
|
||||||
|
|
12
taskimpl.h
12
taskimpl.h
|
@ -105,19 +105,17 @@ extern void makecontext(ucontext_t*, void(*)(), int, ...);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__linux__) && defined(__amd64__)
|
#if defined(__linux__) && defined(__amd64__)
|
||||||
typedef struct mcontext mcontext_t;
|
# if defined(__i386__)
|
||||||
typedef struct ucontext ucontext_t;
|
# include "386-ucontext.h"
|
||||||
|
# elif defined(__x86_64__)
|
||||||
|
# include "amd64-ucontext.h"
|
||||||
|
# endif
|
||||||
extern int getmcontext(mcontext_t*);
|
extern int getmcontext(mcontext_t*);
|
||||||
extern void setmcontext(const mcontext_t*);
|
extern void setmcontext(const mcontext_t*);
|
||||||
#define setcontext(u) setmcontext(&(u)->uc_mcontext)
|
#define setcontext(u) setmcontext(&(u)->uc_mcontext)
|
||||||
#define getcontext(u) getmcontext(&(u)->uc_mcontext)
|
#define getcontext(u) getmcontext(&(u)->uc_mcontext)
|
||||||
extern int swapcontext(ucontext_t*, const ucontext_t*);
|
extern int swapcontext(ucontext_t*, const ucontext_t*);
|
||||||
extern void makecontext(ucontext_t*, void(*)(), int, ...);
|
extern void makecontext(ucontext_t*, void(*)(), int, ...);
|
||||||
# if defined(__i386__)
|
|
||||||
# include "386-ucontext.h"
|
|
||||||
# elif defined(__x86_64__)
|
|
||||||
# include "amd64-ucontext.h"
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
|
|
Loading…
Reference in New Issue