abseil / abseil/abseil-cpp

[Bug]: sig_t is not portable

未關閉
#1,825 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
C++
星號
18.1k
分支
3.2k
平均合併
20 小時 36 分鐘
30 天內合併 PR
1

描述

### Describe the issue

Compilation of tests fails on OpenIndiana due to `sig_t`:

```
/data/builds/oi-userland/components/library/abseil-cpp/abseil-cpp-20240116.3/absl/time/clock_test.cc: In function 'bool {anonymous}::SleepForBounded(absl::lts_20240116::Duration, absl::lts_20240116::Duration, absl::lts_20240116::Duration, absl::lts_20240116::Duration, AlarmPolicy, int*)':
/data/builds/oi-userland/components/library/abseil-cpp/abseil-cpp-20240116.3/absl/time/clock_test.cc:62:5: error: 'sig_t' was not declared in this scope
62 | sig_t old_alarm = SIG_DFL;
| ^~~~~
/data/builds/oi-userland/components/library/abseil-cpp/abseil-cpp-20240116.3/absl/time/clock_test.cc:65:7: error: 'old_alarm' was not declared in this scope
65 | old_alarm = signal(SIGALRM, AlarmHandler);
| ^~~~~~~~~
/data/builds/oi-userland/components/library/abseil-cpp/abseil-cpp-20240116.3/absl/time/clock_test.cc:77:23: error: 'old_alarm' was not declared in this scope
77 | signal(SIGALRM, old_alarm);
| ^~~~~~~~~

```

### Steps to reproduce the problem

Compile abseil-cpp 20240116.3 with `-DABSL_BUILD_TESTING=ON` and `-DABSL_USE_EXTERNAL_GOOGLETEST=ON` on OpenIndiana.

### What version of Abseil are you using?

20240116.3

### What operating system and version are you using?

OpenIndiana Hipster (an illumos distro)

### What compiler and version are you using?

```
$ gcc --version
gcc (OpenIndiana 14.2.0-oi-1) 14.2.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$
```

### What build system are you using?

cmake version 3.31.5

### Additional context

_No response_

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。