From 3320df74a64f33b81488eecad3bc4935b2ad386b Mon Sep 17 00:00:00 2001 From: guenther <> Date: Sat, 17 Oct 2015 21:48:42 +0000 Subject: [PATCH] Move the last of the __DBINTERFACE_PRIVATE bits from to libc's wrapper and eliminate the now superfluous -D option ok kettenis@ millert@ --- src/include/db.h | 52 +----------------------------------------------- 1 file changed, 1 insertion(+), 51 deletions(-) diff --git a/src/include/db.h b/src/include/db.h index 90fe790a..4381efeb 100644 --- a/src/include/db.h +++ b/src/include/db.h @@ -1,4 +1,4 @@ -/* $OpenBSD: db.h,v 1.11 2015/09/05 11:28:35 guenther Exp $ */ +/* $OpenBSD: db.h,v 1.12 2015/10/17 21:48:42 guenther Exp $ */ /* $NetBSD: db.h,v 1.13 1994/10/26 00:55:48 cgd Exp $ */ /*- @@ -155,56 +155,6 @@ typedef struct { char *bfname; /* btree file name */ } RECNOINFO; -#ifdef __DBINTERFACE_PRIVATE -/* - * Little endian <==> big endian 32-bit swap macros. - * M_32_SWAP swap a memory location - * P_32_SWAP swap a referenced memory location - * P_32_COPY swap from one location to another - */ -#define M_32_SWAP(a) { \ - u_int32_t _tmp = a; \ - ((char *)&a)[0] = ((char *)&_tmp)[3]; \ - ((char *)&a)[1] = ((char *)&_tmp)[2]; \ - ((char *)&a)[2] = ((char *)&_tmp)[1]; \ - ((char *)&a)[3] = ((char *)&_tmp)[0]; \ -} -#define P_32_SWAP(a) { \ - u_int32_t _tmp = *(u_int32_t *)a; \ - ((char *)a)[0] = ((char *)&_tmp)[3]; \ - ((char *)a)[1] = ((char *)&_tmp)[2]; \ - ((char *)a)[2] = ((char *)&_tmp)[1]; \ - ((char *)a)[3] = ((char *)&_tmp)[0]; \ -} -#define P_32_COPY(a, b) { \ - ((char *)&(b))[0] = ((char *)&(a))[3]; \ - ((char *)&(b))[1] = ((char *)&(a))[2]; \ - ((char *)&(b))[2] = ((char *)&(a))[1]; \ - ((char *)&(b))[3] = ((char *)&(a))[0]; \ -} - -/* - * Little endian <==> big endian 16-bit swap macros. - * M_16_SWAP swap a memory location - * P_16_SWAP swap a referenced memory location - * P_16_COPY swap from one location to another - */ -#define M_16_SWAP(a) { \ - u_int16_t _tmp = a; \ - ((char *)&a)[0] = ((char *)&_tmp)[1]; \ - ((char *)&a)[1] = ((char *)&_tmp)[0]; \ -} -#define P_16_SWAP(a) { \ - u_int16_t _tmp = *(u_int16_t *)a; \ - ((char *)a)[0] = ((char *)&_tmp)[1]; \ - ((char *)a)[1] = ((char *)&_tmp)[0]; \ -} -#define P_16_COPY(a, b) { \ - ((char *)&(b))[0] = ((char *)&(a))[1]; \ - ((char *)&(b))[1] = ((char *)&(a))[0]; \ -} -#endif - __BEGIN_DECLS DB *dbopen(const char *, int, int, DBTYPE, const void *); __END_DECLS