diff --git a/src/Makefile.in b/src/Makefile.in index c8b4e6171fd576b8f4170204fc83a8f2f736d0d6..8a471ecc20cd6c2b06e42c6f0b9e3484524c38dd 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -37,7 +37,7 @@ HEADER_FILES = common_define.h hash.h chain.h logger.h base64.h \ skiplist_common.h system_info.h fast_blocked_queue.h \ php7_ext_wrapper.h id_generator.h char_converter.h \ char_convert_loader.h common_blocked_queue.h \ - multi_socket_client.h skiplist_set.h + multi_socket_client.h skiplist_set.h fc_list.h ALL_OBJS = $(FAST_STATIC_OBJS) $(FAST_SHARED_OBJS) diff --git a/src/common_define.h b/src/common_define.h index afecb7e668985a722a021d85cac6b6cfff460c17..b7a849b8bc26c7bbb59c3333e458478509b162c6 100644 --- a/src/common_define.h +++ b/src/common_define.h @@ -12,6 +12,7 @@ #define _COMMON_DEFINE_H_ #include +#include #include #ifdef WIN32 @@ -206,6 +207,20 @@ typedef void* (*MallocFunc)(size_t size); #define __gcc_attribute__(x) #endif +static inline int fc_compare_string(const string_t *s1, const string_t *s2) +{ + int result; + if (s1->len == s2->len) { + return memcmp(s1->str, s2->str, s1->len); + } else if (s1->len < s2->len) { + result = memcmp(s1->str, s2->str, s1->len); + return result == 0 ? -1 : result; + } else { + result = memcmp(s1->str, s2->str, s2->len); + return result == 0 ? 1 : result; + } +} + #ifdef __cplusplus } #endif diff --git a/src/fast_task_queue.c b/src/fast_task_queue.c index 6942ad2660952ddb0710c4e8517792248ced59e6..63940eed4db66156cd4ee01958a304804d5e1b7a 100644 --- a/src/fast_task_queue.c +++ b/src/fast_task_queue.c @@ -24,8 +24,6 @@ struct mpool_chain { static struct mpool_chain g_mpool = {NULL, NULL}; -#define ALIGNED_TASK_INFO_SIZE MEM_ALIGN(sizeof(struct fast_task_info)) - int task_queue_init(struct fast_task_queue *pQueue) { int result; diff --git a/src/fast_task_queue.h b/src/fast_task_queue.h index c5ca8e64403c82fb5e241c1df08cd5232cff2b91..dac9b9d3327f69a4e997064483793408412d5358 100644 --- a/src/fast_task_queue.h +++ b/src/fast_task_queue.h @@ -19,6 +19,8 @@ #include "ioevent.h" #include "fast_timer.h" +#define ALIGNED_TASK_INFO_SIZE MEM_ALIGN(sizeof(struct fast_task_info)) + struct nio_thread_data; struct fast_task_info;