@@ -82,16 +82,6 @@ extern const struct opal_eventop opal_kqops;
8282extern const struct opal_eventop devpollops ;
8383#endif
8484
85- #if 0
86- /* This is to prevent event library from picking up the win32_ops
87- since this will be picked up over select(). By using select, we can
88- pretty much use the OOB and PTL as is. Otherwise, there would have
89- to be a lot of magic to be done to get this to work */
90- #if defined(WIN32 ) && WIN32
91- extern const struct opal_eventop opal_win32ops ;
92- #endif
93- #endif
94-
9585/* In order of preference */
9686static const struct opal_eventop * eventops [] = {
9787#if 0 /* no KQUEUE or EPOLL support for us -- neither seem to work
@@ -119,16 +109,18 @@ static const struct opal_eventop *eventops[] = {
119109#if defined(HAVE_SELECT ) && HAVE_SELECT
120110 & opal_selectops ,
121111#endif
122- #if 0
123- /* This is to prevent event library from picking up the
124- win32_ops since this will be picked up over select(). By
125- using select, we can pretty much use the OOB and PTL as
126- is. Otherwise, there would have to be a lot of magic to be
127- done to get this to work */
128- #if defined(WIN32 ) && WIN32
112+ /**
113+ * One of the most stupid comment in the libevent project. Why ? How ?
114+ *
115+ * This is to prevent event library from picking up the
116+ * win32_ops since this will be picked up over select(). By
117+ * using select, we can pretty much use the OOB and PTL as
118+ * is. Otherwise, there would have to be a lot of magic to be
119+ * done to get this to work
120+ */
121+ #if defined(__WINDOWS__ )
129122 & opal_win32ops ,
130- #endif
131- #endif
123+ #endif /* defined(__WINDOWS__) */
132124 NULL
133125};
134126
@@ -149,8 +141,6 @@ static int opal_event_haveevents(struct event_base *);
149141
150142static void opal_event_process_active (struct event_base * );
151143
152- extern int opal_evsignal_restart (void );
153-
154144static int timeout_next (struct event_base * , struct timeval * );
155145static void timeout_process (struct event_base * );
156146static void timeout_correct (struct event_base * , struct timeval * );
@@ -237,7 +227,7 @@ opal_event_init(void)
237227
238228#if OPAL_HAVE_WORKING_EVENTOPS
239229
240- if ((current_base = calloc (1 , sizeof (struct event_base ))) == NULL )
230+ if ((current_base = ( event_base * ) calloc (1 , sizeof (struct event_base ))) == NULL )
241231 event_err (1 , "%s: calloc" );
242232
243233 event_sigcb = NULL ;
@@ -362,7 +352,7 @@ int opal_event_disable(void)
362352
363353int opal_event_restart (void )
364354{
365- #if OPAL_HAVE_WORKING_EVENTOPS
355+ #if OPAL_HAVE_WORKING_EVENTOPS && !defined( __WINDOWS__ )
366356 int rc ;
367357#if OMPI_ENABLE_PROGRESS_THREADS
368358 opal_mutex_lock (& opal_event_lock );
@@ -379,8 +369,10 @@ int opal_event_restart(void)
379369#endif
380370
381371 opal_event_enable ();
372+ #if !defined(__WINDOWS__ )
382373 if ((rc = opal_evsignal_restart ()) != 0 )
383374 return OPAL_ERROR ;
375+ #endif /* defined(__WINDOWS__) */
384376 return (OPAL_SUCCESS );
385377#else /* OPAL_HAVE_WORKING_EVENTOPS */
386378 return OPAL_ERR_NOT_SUPPORTED ;
@@ -568,7 +560,7 @@ opal_event_base_loop(struct event_base *base, int flags)
568560 }
569561 }
570562 }
571-
563+ #if !defined( __WINDOWS__ )
572564 /* Check if time is running backwards */
573565 gettimeofday (& tv , NULL );
574566 if (timercmp (& tv , & base -> event_tv , < )) {
@@ -579,7 +571,7 @@ opal_event_base_loop(struct event_base *base, int flags)
579571 timeout_correct (base , & off );
580572 }
581573 base -> event_tv = tv ;
582-
574+ #endif /* !defined(__WINDOWS__) */
583575 if (!base -> event_count_active && !(flags & OPAL_EVLOOP_NONBLOCK ))
584576 timeout_next (base , & tv );
585577 else
0 commit comments