[ovs-dev] [PATCH 3/4] build-windows: Add check for struct timespec

Ben Pfaff blp at ovn.org
Mon Nov 6 22:12:25 UTC 2017


On Mon, Nov 06, 2017 at 01:19:47PM +0200, aserdean at ovn.org wrote:
> > -----Original Message-----
> > From: Ben Pfaff [mailto:blp at ovn.org]
> > Sent: Friday, November 3, 2017 8:38 PM
> > To: Alin Gabriel Serdean <aserdean at ovn.org>
> > Cc: dev at openvswitch.org
> > Subject: Re: [ovs-dev] [PATCH 3/4] build-windows: Add check for struct
> > timespec
> > 
> > On Wed, Nov 01, 2017 at 07:19:06PM +0200, Alin Gabriel Serdean wrote:
> > > Starting from WDK 10 the structure `timespec` is defined in <time.h>.
> > >
> > > This patch adds a check for the structure to make <pthread.h> aware of
> > > it, so it doesn't try to redefine the structure.
> > >
> > > Signed-off-by: Alin Gabriel Serdean <aserdean at ovn.org>
> > > ---
> > >  m4/openvswitch.m4 | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4 index
> > > 59e1352..01d2269 100644
> > > --- a/m4/openvswitch.m4
> > > +++ b/m4/openvswitch.m4
> > > @@ -143,6 +143,7 @@ AC_DEFUN([OVS_CHECK_WIN32],
> > >        )
> > >
> > >        AC_DEFINE([WIN32], [1], [Define to 1 if building on WIN32.])
> > > +      AC_CHECK_TYPES([struct timespec], [], [], [[#include
> > > + <time.h>]])
> > >        AH_BOTTOM([#ifdef WIN32
> > >  #include "include/windows/windefs.h"
> > >  #endif])
> > 
> > Is this something that the Windows pthread we recommend checks for?  I
> > don't see any checks for it in the OVS codebase itself.
> > 
> > If so,
> > Acked-by: Ben Pfaff <blp at ovn.org>
> > 
> > Thanks!
> Not necessarily (sorry for the long answer) 😊. We currently use: https://www.sourceware.org/pthreads-win32/ which looks for HAVE_STRUCT_TIMESPEC in "pthread.h" to define the struct or not.
> Pthreads-win32 seems to be unmaintained and switched to pthread4w: https://sourceforge.net/p/pthreads4w/wiki/Home/. The latter has a check for VS 2015/2017 https://sourceforge.net/p/pthreads4w/code/ci/master/tree/sched.h#l87 regarding timespec. I tried reaching out to the maintainer to see which of these projects is actively maintained but unfortunately no response yet.

OK.  At any rate it sounds like you're on top of the situation, so if
this fixes a problem then I support it.

Acked-by: Ben Pfaff <blp at ovn.org>


More information about the dev mailing list