From a7f031ba55ac4a69263000357eb7f6d7fb88101a Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Thu, 1 Oct 2015 07:40:26 -0500 Subject: add b64_ntop checking and fallback for nc(1) --- include/Makefile.am | 1 + include/compat/readpassphrase.h | 4 ---- include/compat/resolv.h | 24 ++++++++++++++++++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 include/compat/resolv.h (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am index 522d375..b3c3549 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -11,6 +11,7 @@ noinst_HEADERS += compat/err.h noinst_HEADERS += compat/netdb.h noinst_HEADERS += compat/poll.h noinst_HEADERS += compat/readpassphrase.h +noinst_HEADERS += compat/resolv.h noinst_HEADERS += compat/stdio.h noinst_HEADERS += compat/stdlib.h noinst_HEADERS += compat/string.h diff --git a/include/compat/readpassphrase.h b/include/compat/readpassphrase.h index aedf16c..3416919 100644 --- a/include/compat/readpassphrase.h +++ b/include/compat/readpassphrase.h @@ -37,11 +37,7 @@ #define RPP_SEVENBIT 0x10 /* Strip the high bit from input. */ #define RPP_STDIN 0x20 /* Read from stdin, not /dev/tty */ -#include - -__BEGIN_DECLS char * readpassphrase(const char *, char *, size_t, int); -__END_DECLS #endif /* !_READPASSPHRASE_H_ */ diff --git a/include/compat/resolv.h b/include/compat/resolv.h new file mode 100644 index 0000000..42dec07 --- /dev/null +++ b/include/compat/resolv.h @@ -0,0 +1,24 @@ +/* + * Public domain + * resolv.h compatibility shim + */ + +#ifndef LIBCRYPTOCOMPAT_RESOLV_H +#define LIBCRYPTOCOMPAT_RESOLV_H + +#ifdef _MSC_VER +#if _MSC_VER >= 1900 +#include <../ucrt/resolv.h> +#else +#include <../include/resolv.h> +#endif +#else +#include_next +#endif + +#ifndef HAVE_B64_NTOP +int b64_ntop(unsigned char const *, size_t, char *, size_t); +int b64_pton(char const *, unsigned char *, size_t); +#endif + +#endif -- cgit v1.2.3-55-g6feb