簡體   English   中英

在 MinGW/MSYS2 上編譯 XZ Utils 時的類型未知

[英]Unknown type when compiling XZ Utils on MinGW/MSYS2

我一直在嘗試使用 MinGW-w64 編譯 XZ Utils,當嘗試在./configure之后運行make ,我收到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

我使用gcc -E - <<< "#include <signal.h>" | grep sigset_t檢查了signal.hsigset_t gcc -E - <<< "#include <signal.h>" | grep sigset_t並沒有發現任何東西。 現在我一直在想這是否是 MinGW 的限制,如果是,是否有辦法解決它。

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 中...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM