smadaminov / ovs-dpdk-meson-issues

VMware Summer 2021
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

windows meson: timespec redefinition due to pthread.h #28

Open williamtu opened 3 years ago

williamtu commented 3 years ago

Found ninja.EXE-1.10.0 at "C:\Program Files\Meson\ninja.EXE" Command line for building ['lib\libopenvswitch.a'] is long, using a response file [1/252] Compiling C object lib/libopenvswitch.a.p/backtrace.c.obj FAILED: lib/libopenvswitch.a.p/backtrace.c.obj "clang" "-Ilib\libopenvswitch.a.p" "-Ilib" "-I..\lib" "-I." "-I.." "-Iinclude\openflow" "-I..\include\openflow" "-Iinclude\openvswitch" "-I..\include\openvsw itch" "-I..\include\windows" "-Iinclude" "-I..\include" "-I..\datapath-windows\include" "-IC:\PTHREADS-BUILT\include" "-Xclang" "-fcolor-diagnostics" "-pipe" "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-g" "-Wthread-safety" "-Werror" "-dM" "-U_MSC_VER" "-D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS" -MD -MQ lib/libopenvswitch.a.p/backtrace.c.obj -MF "lib\libopenvswitch.a.p\backtrace.c.obj.d" -o lib/libopenvswitch.a.p/backtrace.c.obj "-c" ../lib/backtrac e.c In file included from ../lib/backtrace.c:25: In file included from ..\include\openvswitch/vlog.h:35: In file included from ..\include\openvswitch/thread.h:20: In file included from C:\PTHREADS-BUILT\include\pthread.h:178: C:\PTHREADS-BUILT\include\sched.h:95:8: error: redefinition of 'timespec' struct timespec ^ C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\time.h:39:12: note: previous definition is here struct timespec ^ 1 error generated.

williamtu commented 3 years ago

I don't know why current OVS build doesn't have this problem...

williamtu commented 3 years ago

https://github.com/libusb/libusb/issues/144

ifndef _CRT_NO_TIME_T

but triggers other error for struct time_t

williamtu commented 3 years ago

seems to work by adding, disabling the timspect defined in pthread lib add_global_arguments('-D_TIMESPEC_DEFINED', language : 'c')