… | |
… | |
3900 | To embed libev, see L</EMBEDDING>, but in short, it's easiest to create two |
3900 | To embed libev, see L</EMBEDDING>, but in short, it's easiest to create two |
3901 | files, F<my_ev.h> and F<my_ev.c> that include the respective libev files: |
3901 | files, F<my_ev.h> and F<my_ev.c> that include the respective libev files: |
3902 | |
3902 | |
3903 | // my_ev.h |
3903 | // my_ev.h |
3904 | #define EV_CB_DECLARE(type) struct my_coro *cb; |
3904 | #define EV_CB_DECLARE(type) struct my_coro *cb; |
3905 | #define EV_CB_INVOKE(watcher) switch_to ((watcher)->cb); |
3905 | #define EV_CB_INVOKE(watcher) switch_to ((watcher)->cb) |
3906 | #include "../libev/ev.h" |
3906 | #include "../libev/ev.h" |
3907 | |
3907 | |
3908 | // my_ev.c |
3908 | // my_ev.c |
3909 | #define EV_H "my_ev.h" |
3909 | #define EV_H "my_ev.h" |
3910 | #include "../libev/ev.c" |
3910 | #include "../libev/ev.c" |