abseil / abseil/abseil-cpp

Add support for NetBSD

未关闭
#641 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C++
星标
18.1k
派生
3.2k
平均合并
20 小时 36 分钟
30 天内合并 PR
1

描述

NetBSD supports **mmap()** and **pthread_getschedparam()**:
```
--- absl/base/config.h.orig
+++ absl/base/config.h
@@ -365,6 +365,7 @@ static_assert(ABSL_INTERNAL_INLINE_NAMES
#ifdef ABSL_HAVE_MMAP
#error ABSL_HAVE_MMAP cannot be directly set
#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
+ defined(__NetBSD__) || \
defined(__ros__) || defined(__native_client__) || defined(__asmjs__) || \
defined(__wasm__) || defined(__Fuchsia__) || defined(__sun) || \
defined(__ASYLO__)
@@ -378,6 +379,7 @@ static_assert(ABSL_INTERNAL_INLINE_NAMES
#ifdef ABSL_HAVE_PTHREAD_GETSCHEDPARAM
#error ABSL_HAVE_PTHREAD_GETSCHEDPARAM cannot be directly set
#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
+ defined(__NetBSD__) || \
defined(__ros__)
#define ABSL_HAVE_PTHREAD_GETSCHEDPARAM 1
#endif
```

Also `_XOPEN_SOURCE` must not be defined, so either apply the following, or exclude defining it only for NetBSD (by the way, Darwin/macOS does not need either).
```
--- absl/time/internal/cctz/src/time_zone_format.cc.orig
+++ absl/time/internal/cctz/src/time_zone_format.cc
@@ -18,11 +18,6 @@
#endif
#endif

-#if defined(HAS_STRPTIME) && HAS_STRPTIME
-#if !defined(_XOPEN_SOURCE)
-#define _XOPEN_SOURCE // Definedness suffices for strptime.
-#endif
-#endif

#include "absl/base/config.h"
#include "absl/time/internal/cctz/include/cctz/time_zone.h"
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。