Received: from eggs.gnu.org ([208.118.235.92]:38102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWopg-0007ol-EK for qemu-devel@nongnu.org; Mon, 29 Apr 2013 10:13:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UWope-0005sc-Nj for qemu-devel@nongnu.org; Mon, 29 Apr 2013 10:13:32 -0400 Received: from [216.171.111.232] (port=38775 helo=freebsd.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWope-0005rP-Hy for qemu-devel@nongnu.org; Mon, 29 Apr 2013 10:13:30 -0400 From: Ed Maste Date: Mon, 29 Apr 2013 10:12:55 -0400 Message-Id: <1367244775-94775-1-git-send-email-emaste@freebsd.org> Subject: [Qemu-devel] [PATCH] bsd-user: OS-agnostic 64-bit SYSCTL types List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Ed Maste Use existence of type as #ifdef condition rather than FreeBSD-specific version check, as suggested by Patrick Welche. Also handle the signed (CTLTYPE_S64) case identically to the unsigned (CTLTYPE_U64) case, per later patches in the FreeBSD ports tree (emulators/qemu-devel/files/patch-z-arm-bsd-user-001). Signed-off-by: Ed Maste --- bsd-user/syscall.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index 69e3466..34b8dfc 100644 --- a/bsd-user/syscall.c +++ b/bsd-user/syscall.c @@ -211,10 +211,11 @@ static int sysctl_oldcvt(void *holdp, size_t holdlen, uint32_t kind) *(uint64_t *)holdp = tswap64(*(unsigned long *)holdp); break; #endif -#if !defined(__FreeBSD_version) || __FreeBSD_version < 900031 - case CTLTYPE_QUAD: -#else +#ifdef CTLTYPE_U64: + case CTLTYPE_S64: case CTLTYPE_U64: +#else + case CTLTYPE_QUAD: #endif *(uint64_t *)holdp = tswap64(*(uint64_t *)holdp); break; -- 1.7.11.5