From 8809ef98f92cfe5bd349e425ebe0e69c51ea9153 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 PR-URL: https://github.com/nodejs/node/pull/38670 Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Rich Trott --- 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 11206b16dd8e41..dbbdbc08380a7a 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 20d350a76321e8..27322367556374 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 {