diff options
| author | yangwei <[email protected]> | 2023-07-23 13:12:37 +0800 |
|---|---|---|
| committer | yangwei <[email protected]> | 2023-07-23 13:12:37 +0800 |
| commit | 6a8be56de169bd79ed0e43afcc05ab96829a40a9 (patch) | |
| tree | 2c463a33eab1b835f493781c8a7280a0a00b2c6a /src/timer/sapp_timer.c | |
| parent | ee48aae42e59e9e79df58ca0e06c342ff06e49e8 (diff) | |
📃 docs(clean redundancy code): 移除已注释代码,和直接放在头文件目录的event2.h
Diffstat (limited to 'src/timer/sapp_timer.c')
| -rw-r--r-- | src/timer/sapp_timer.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/timer/sapp_timer.c b/src/timer/sapp_timer.c index 45a715b..00b6d52 100644 --- a/src/timer/sapp_timer.c +++ b/src/timer/sapp_timer.c @@ -32,7 +32,7 @@ static inline int __st_is_platform_timer(const void *h) return 0; } - +#ifdef LIBEVENT_ENABLED static void __st_libev_callback(evutil_socket_t sd, short event, void *sapp_args) { sapp_timer_event_inner_t *inner_ev = (sapp_timer_event_inner_t *)sapp_args; @@ -44,7 +44,7 @@ static void __st_libev_callback(evutil_socket_t sd, short event, void *sapp_args inner_ev->sapp_plug_cb_fun(inner_ev->timer_handle, inner_ev, inner_ev->timer_handle->effective_thread_index, inner_ev->user_arg); /* ���ﴫ���ⲿ������������user_args */ } } - +#endif /* NOTE: @@ -218,7 +218,9 @@ sapp_timer_event sapp_timer_event_new(sapp_timer_handle sth) if (inner_h) { inner_ev = (sapp_timer_event_inner_t *)calloc(1, sizeof(sapp_timer_event_inner_t)); +#ifdef LIBEVENT_ENABLED inner_ev->libev_event = (struct event *)calloc(1, sizeof(struct event)); +#endif inner_ev->timer_handle = inner_h; inner_h->effective_thread_index = -1; } |
