在MinGW / MSYS2上编译XZ Utils时出现未知类型

问题描述 投票:1回答:1

我一直在尝试使用MinGW-w64编译XZ Utils,并且在makeing之后尝试运行./configure时,我得到sigset_t未知的错误。

XZ Utils版本是5.2.3,而我的MinGW-w64是x86_64-7.2.0-posix-seh-rt_v5-rv1

In file included from common/common.h:17:0,
                 from common/common.c:13:
../../src/common/mythread.h:138:33: error: unknown type name 'sigset_t'
 mythread_sigmask(int how, const sigset_t *restrict set,
                                 ^~~~~~~~
../../src/common/mythread.h:139:3: error: unknown type name 'sigset_t'; did you mean '_sigset_t'?
   sigset_t *restrict oset)
   ^~~~~~~~
   _sigset_t
../../src/common/mythread.h: In function 'mythread_create':
../../src/common/mythread.h:158:2: error: unknown type name 'sigset_t'; did you mean '_sigset_t'?
  sigset_t old;
  ^~~~~~~~
  _sigset_t
../../src/common/mythread.h:159:2: error: unknown type name 'sigset_t'; did you mean '_sigset_t'?
  sigset_t all;
  ^~~~~~~~
  _sigset_t
../../src/common/mythread.h:160:2: warning: implicit declaration of function 'sigfillset' [-Wimplicit-function-declaration]
  sigfillset(&all);
  ^~~~~~~~~~
../../src/common/mythread.h:162:2: warning: implicit declaration of function 'mythread_sigmask'; did you mean 'pthread_sigmask'? [-Wimplicit-function-declaration]
  mythread_sigmask(SIG_SETMASK, &all, &old);
  ^~~~~~~~~~~~~~~~
  pthread_sigmask

我用signal.h检查了sigset_tgcc -E - <<< "#include <signal.h>" | grep sigset_t并没有发现任何东西。现在我一直想知道这是否是MinGW限制,如果是的话,是否有解决方法。

c signals mingw mingw-w64 xz
1个回答
1
投票

https://github.com/Alexpux/mingw-w64/blob/master/mingw-w64-headers/crt/sys/types.h#L110

#ifdef _POSIX
typedef _sigset_t   sigset_t;
#endif

如果定义了_POSIX,它似乎只会被定义。它也在sys / types.h和signal.h中...

© www.soinside.com 2019 - 2024. All rights reserved.