Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: __sigval_t causes compile error. #21

Merged
merged 1 commit into from
Oct 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion util/dns_resolve.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,17 @@ struct NotifyStruct {
fibers_ext::EventCount evc;
};

static void DnsResolveNotify(__sigval_t val) {
// To ensure compatibility between different versions of Glibc,
// we use sigval_t instead of __sigval_t. However, some older
// versions may still require __sigval_t, such as when __USE_POSIX199309
// is defined. The following text is derived from the comments in Glibc 2.31:
// To avoid sigval_t (not a standard type name) having C++ name
// mangling depending on whether the selected standard includes union
// sigval, it should not be defined at all when using a standard for
// which the sigval name is not reserved; in that case, headers should
// not include <bits/types/sigval_t.h> and should use only the
// internal __sigval_t name.
static void DnsResolveNotify(sigval_t val) {
NotifyStruct* ns = (NotifyStruct*)val.sival_ptr;
ns->gate.store(true, memory_order_relaxed);
ns->evc.notify();
Expand Down