From 10a4b78ec8d9a29fdc4f9b4f0f801dacbf56873d Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 13 May 2021 15:53:52 +0200 Subject: [PATCH] src: update cares_wrap OpenBSD defines Move the `#define`s back into `cares_wrap.cc`, as they are part of the implementation, not the declarations used in `cares_wrap.h`, and apply the suggestion from https://github.com/nodejs/node/pull/38572#discussion_r627809407 to make the defines a bit more generic and not check for OpenBSD specifically. Refs: https://github.com/nodejs/node/pull/38572 --- src/cares_wrap.cc | 13 +++++++++++++ src/cares_wrap.h | 8 -------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index c0368739ff03ef..1b8639fa03f6a2 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -38,6 +38,19 @@ #include #include +#ifndef T_CAA +# define T_CAA 257 /* Certification Authority Authorization */ +#endif + +// OpenBSD does not define these +#ifndef AI_ALL +# define AI_ALL 0 +#endif +#ifndef AI_V4MAPPED +# define AI_V4MAPPED 0 +#endif + + namespace node { namespace cares_wrap { diff --git a/src/cares_wrap.h b/src/cares_wrap.h index bceafcb8b7f46b..fa9296f3749c0d 100644 --- a/src/cares_wrap.h +++ b/src/cares_wrap.h @@ -32,14 +32,6 @@ # include #endif -#ifndef T_CAA -# define T_CAA 257 /* Certification Authority Authorization */ -#endif - -#if defined(__OpenBSD__) -# define AI_V4MAPPED 0 -#endif - namespace node { namespace cares_wrap {