فهرست منبع

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);