From: Guillem Jover Date: Sat, 6 Feb 2021 22:28:42 +0000 (+0100) Subject: Add support for new LIBBSD_VIS_OPENBSD selection macro X-Git-Tag: 0.11.1~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=233cab9d649137b14bb0caac045a75e4a7a562c4;p=thirdparty%2Flibbsd.git Add support for new LIBBSD_VIS_OPENBSD selection macro This will make it possible to explicitly select the OpenBSD vis implementation (the current default) for code of OpenBSD origins. --- diff --git a/include/bsd/vis.h b/include/bsd/vis.h index 84102b2..fb9ad27 100644 --- a/include/bsd/vis.h +++ b/include/bsd/vis.h @@ -99,8 +99,11 @@ * Provide both implementations and default for now on the historical one to * avoid breakage, we will switch to the NetBSD one in libbsd 0.10.0 or so. * Define LIBBSD_NETBSD_VIS to switch to the NetBSD one now. + * Define LIBBSD_OPENBSD_VIS to keep using the OpenBSD one. */ -#ifndef LIBBSD_NETBSD_VIS +#if defined(LIBBSD_OPENBSD_VIS) +#undef LIBBSD_NETBSD_VIS +#elif !defined(LIBBSD_NETBSD_VIS) #warning "NetBSD added incompatible strnvis() and strnunvis(), please see for more detils." #endif diff --git a/test/vis-openbsd.c b/test/vis-openbsd.c index 99c4198..cd39675 100644 --- a/test/vis-openbsd.c +++ b/test/vis-openbsd.c @@ -24,12 +24,11 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#define LIBBSD_OPENBSD_VIS 1 + #include #include -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wcpp" #include -#pragma GCC diagnostic pop int main(int argc, char **argv)