瀏覽代碼

LibUV: Reorder event poll preference

*nix will keep epoll/kqueue/port as the default (when available), while
Windows, lacking all of these, will default to libuv (when available)
Nils Maier 12 年之前
父節點
當前提交
e700ebd3e9
共有 1 個文件被更改,包括 10 次插入8 次删除
  1. 10 8
      src/OptionHandlerFactory.cc

+ 10 - 8
src/OptionHandlerFactory.cc

@@ -329,9 +329,6 @@ std::vector<OptionHandler*> OptionHandlerFactory::createOptionHandlers()
   }
   {
     std::string params[] = {
-#ifdef HAVE_LIBUV
-      V_LIBUV,
-#endif // HAVE_LIBUV
 #ifdef HAVE_EPOLL
       V_EPOLL,
 #endif // HAVE_EPOLL
@@ -341,6 +338,9 @@ std::vector<OptionHandler*> OptionHandlerFactory::createOptionHandlers()
 #ifdef HAVE_PORT_ASSOCIATE
       V_PORT,
 #endif // HAVE_PORT_ASSOCIATE
+#ifdef HAVE_LIBUV
+      V_LIBUV,
+#endif // HAVE_LIBUV
 #ifdef HAVE_POLL
       V_POLL,
 #endif // HAVE_POLL
@@ -349,17 +349,19 @@ std::vector<OptionHandler*> OptionHandlerFactory::createOptionHandlers()
     OptionHandler* op(new ParameterOptionHandler
                       (PREF_EVENT_POLL,
                        TEXT_EVENT_POLL,
-#ifdef HAVE_LIBUV
-                       V_LIBUV,
-#elif defined(HAVE_EPOLL)
+#if defined(HAVE_EPOLL)
                        V_EPOLL,
 #elif defined(HAVE_KQUEUE)
                        V_KQUEUE,
 #elif defined(HAVE_PORT_ASSOCIATE)
                        V_PORT,
-#else
+#elif defined(HAVE_LIBUV)
+                       V_LIBUV,
+#elif defined(HAVE_POLL)
+                       V_POLL,
+#else // defined(HAVE_EPOLL)
                        V_SELECT,
-#endif // !HAVE_LIBUV
+#endif // defined(HAVE_EPOLL)
                        std::vector<std::string>
                        (vbegin(params), vend(params))));
     op->addTag(TAG_ADVANCED);