。それは便利です。私はルートフォルダにmake
を実行すると 、それは示しています暗黙の宣言「swapcontext」
uthread.c:21:3: warning: implicit declaration of function ‘swapcontext’ [-Wimplicit-function-declaration]
swapcontext(¤tThread->context,&scheduler_context);
^
uthread.c: In function ‘main_manager’:
uthread.c:31:2: warning: implicit declaration of function ‘setcontext’ [-Wimplicit-function-declaration]
setcontext(&mainThread->context);
^
uthread.c: In function ‘initialer’:
uthread.c:72:5: warning: implicit declaration of function ‘getcontext’ [-Wimplicit-function-declaration]
getcontext(&initThread->context);
^
uthread.c: In function ‘THREAD_INIT’:
uthread.c:112:3: warning: implicit declaration of function ‘makecontext’ [-Wimplicit-function-declaration]
makecontext(&mainThread->context, (void(*)(void)) main_manager, 0, NULL, NULL);
^
私はオンライン多くの素材を見上げるとSYS/ucontext.hでucontext.h置き換えられています。私は本当になぜこれが分からないのですか?
アップデート: 私はucontext.hに変更すると、それが表示されるでしょう:MAC OS上で
uthread.c: In function ‘signal_handler’:
uthread.c:21:3: warning: ‘swapcontext’ is deprecated [-Wdeprecated-declarations]
swapcontext(¤tThread->context,&scheduler_context);
^
In file included from uthread.h:8:0,
from uthread.c:1:
/usr/include/ucontext.h:40:6: note: declared here
int swapcontext(ucontext_t * __restrict, const ucontext_t * __restrict) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
^
uthread.c: In function ‘main_manager’:
uthread.c:31:2: warning: ‘setcontext’ is deprecated [-Wdeprecated-declarations]
setcontext(&mainThread->context);
^
In file included from uthread.h:8:0,
from uthread.c:1:
/usr/include/ucontext.h:39:6: note: declared here
int setcontext(const ucontext_t *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
^
uthread.c:32:2: warning: ‘setcontext’ is deprecated [-Wdeprecated-declarations]
setcontext(&scheduler_context);
^
In file included from uthread.h:8:0,
from uthread.c:1:
/usr/include/ucontext.h:39:6: note: declared here
int setcontext(const ucontext_t *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
^
uthread.c: In function ‘thread_manager’:
uthread.c:43:2: warning: ‘setcontext’ is deprecated [-Wdeprecated-declarations]
setcontext(&scheduler_context);
^
In file included from uthread.h:8:0,
from uthread.c:1:
/usr/include/ucontext.h:39:6: note: declared here
int setcontext(const ucontext_t *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
^
uthread.c: In function ‘scheduler’:
uthread.c:55:9: warning: ‘swapcontext’ is deprecated [-Wdeprecated-declarations]
swapcontext(&scheduler_context,¤tThread->context);
^
In file included from uthread.h:8:0,
from uthread.c:1:
/usr/include/ucontext.h:40:6: note: declared here
int swapcontext(ucontext_t * __restrict, const ucontext_t * __restrict) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
^
uthread.c: In function ‘initialer’:
uthread.c:72:5: warning: ‘getcontext’ is deprecated [-Wdeprecated-declarations]
getcontext(&initThread->context);
^
In file included from uthread.h:8:0,
from uthread.c:1:
/usr/include/ucontext.h:37:6: note: declared here
int getcontext(ucontext_t *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
^
uthread.c: In function ‘THREAD_INIT’:
uthread.c:112:3: warning: ‘makecontext’ is deprecated [-Wdeprecated-declarations]
makecontext(&mainThread->context, (void(*)(void)) main_manager, 0, NULL, NULL);
^
In file included from uthread.h:8:0,
from uthread.c:1:
/usr/include/ucontext.h:38:6: note: declared here
void makecontext(ucontext_t *, void (*)(), int, ...) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
^
uthread.c: In function ‘THREAD_CREATE’:
uthread.c:138:3: warning: ‘makecontext’ is deprecated [-Wdeprecated-declarations]
makecontext(&newThread->context, (void(*)(void)) thread_manager, 2, func, arg);
^
In file included from uthread.h:8:0,
from uthread.c:1:
/usr/include/ucontext.h:38:6: note: declared here
void makecontext(ucontext_t *, void (*)(), int, ...) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
^
uthread.c:143:3: warning: ‘getcontext’ is deprecated [-Wdeprecated-declarations]
getcontext(&mainThread->context);
^
In file included from uthread.h:8:0,
from uthread.c:1:
/usr/include/ucontext.h:37:6: note: declared here
int getcontext(ucontext_t *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
^
uthread.c:157:3: warning: ‘getcontext’ is deprecated [-Wdeprecated-declarations]
getcontext(&newThread->context);
^
In file included from uthread.h:8:0,
from uthread.c:1:
/usr/include/ucontext.h:37:6: note: declared here
int getcontext(ucontext_t *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
^
uthread.c:169:3: warning: ‘makecontext’ is deprecated [-Wdeprecated-declarations]
makecontext(&newThread->context, (void(*)(void)) thread_manager, 2, func, arg);
^
In file included from uthread.h:8:0,
from uthread.c:1:
/usr/include/ucontext.h:38:6: note: declared here
void makecontext(ucontext_t *, void (*)(), int, ...) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
^
uthread.c:172:3: warning: ‘swapcontext’ is deprecated [-Wdeprecated-declarations]
swapcontext(¤tThread->context,&scheduler_context);
^
In file included from uthread.h:8:0,
from uthread.c:1:
/usr/include/ucontext.h:40:6: note: declared here
int swapcontext(ucontext_t * __restrict, const ucontext_t * __restrict) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
^
uthread.c: In function ‘THREAD_EXIT’:
uthread.c:209:2: warning: ‘setcontext’ is deprecated [-Wdeprecated-declarations]
setcontext(&scheduler_context);
^
In file included from uthread.h:8:0,
from uthread.c:1:
/usr/include/ucontext.h:39:6: note: declared here
int setcontext(const ucontext_t *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
^
uthread.c: In function ‘THREAD_YIELD’:
uthread.c:217:5: warning: ‘getcontext’ is deprecated [-Wdeprecated-declarations]
getcontext(¤tThread->context);
^
In file included from uthread.h:8:0,
from uthread.c:1:
/usr/include/ucontext.h:37:6: note: declared here
int getcontext(ucontext_t *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
^
uthread.c:221:9: warning: ‘setcontext’ is deprecated [-Wdeprecated-declarations]
setcontext(&scheduler_context);
^
In file included from uthread.h:8:0,
from uthread.c:1:
/usr/include/ucontext.h:39:6: note: declared here
int setcontext(const ucontext_t *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
^
"ucontext.hをsys/ucontext.hに置き換えました"。どうしてそんなことをしました?あなたがそれをする前の行動は何でしたか? [swapcontextのmanページ](https://linux.die.net/man/3/swapcontext)には、「」が含まれています。 –
kaylum
MAC OSでは、ucontext.hをsys/ucontext.hに置き換える必要がありますか?また、多くのパッケージで同じことをする必要があるようです。私のprojを '作る'、それは便利です。 – fourth