]> git.ipfire.org Git - thirdparty/libvirt.git/commit
build: fix build on mingw with winpthreads
authorEric Blake <eblake@redhat.com>
Fri, 10 Jan 2014 21:01:10 +0000 (14:01 -0700)
committerEric Blake <eblake@redhat.com>
Mon, 13 Jan 2014 16:14:11 +0000 (09:14 -0700)
commitc91d13bd0ffde54905e7c5b0aedce2bb9c2b347e
treedc2fe823c34c256856dd214fc05c192da02d22e8
parentd952619894b1a4b453244cd0d0f5bff7c7b7d9a8
build: fix build on mingw with winpthreads

On my Fedora 20 box with mingw cross-compiler, the build failed with:

../../src/rpc/virnetclient.c: In function 'virNetClientSetTLSSession':
../../src/rpc/virnetclient.c:745:14: error: unused variable 'oldmask' [-Werror=unused-variable]
     sigset_t oldmask, blockedsigs;
              ^

I traced it to the fact that mingw64-winpthreads installs a header
that does #define pthread_sigmask(...) 0, which means any argument
only ever passed to pthread_sigmask is reported as unused.  This
patch works around the compilation failure, with behavior no worse
than what mingw already gives us regarding the function being a
no-op.

* configure.ac (pthread_sigmask): Probe for broken mingw macro.
* src/util/virutil.h (pthread_sigmask): Rewrite to something that
avoids unused variables.

Signed-off-by: Eric Blake <eblake@redhat.com>
configure.ac
src/util/virutil.h