From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L60qX-0004Yx-T1 for qemu-devel@nongnu.org; Fri, 28 Nov 2008 05:45:14 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L60qX-0004Y7-6A for qemu-devel@nongnu.org; Fri, 28 Nov 2008 05:45:13 -0500 Received: from [199.232.76.173] (port=56660 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L60qW-0004Xx-K1 for qemu-devel@nongnu.org; Fri, 28 Nov 2008 05:45:12 -0500 Received: from outbound-va3.frontbridge.com ([216.32.180.16]:47946 helo=VA3EHSOBE004.bigfish.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.60) (envelope-from ) id 1L60qW-0006jt-4y for qemu-devel@nongnu.org; Fri, 28 Nov 2008 05:45:12 -0500 From: Christoph Egger Date: Fri, 28 Nov 2008 12:42:47 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-00=_os8LJb+kEP4807r" Message-ID: <200811281142.48217.Christoph.Egger@amd.com> Subject: [Qemu-devel] [PATCH 6/6] qemu fixes Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl --Boundary-00=_os8LJb+kEP4807r Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, This is a series of four patches which improve support for qemu on NetBSD. This patch touches the audio part. On NetBSD, the ANSI C99 integer types are defined via CPP macros. The CPP must evaluate the conv_natural__to_mono twice to compile on NetBSD. Signed-off-by: Christoph Egger =2D-=20 AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Gesch=E4ftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplement=E4r: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Gesch=E4ftsf=FChrer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy --Boundary-00=_os8LJb+kEP4807r Content-Type: text/x-diff; charset="us-ascii"; name="audio_qemu.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="audio_qemu.diff" Index: audio/mixeng.c =================================================================== --- audio/mixeng.c (revision 5805) +++ audio/mixeng.c (working copy) @@ -143,56 +143,64 @@ #undef IN_T #undef SHIFT +/* + * Work around ugly XX_t #defines in NetBSD 2.x, + * fixed as typedefs in NetBSD 3.x. Two macros needed to + * get CPP defines expanded properly. + */ +#define _NBglue(x,y,z) x ## y ## z +#define NBglue(x,y,z) _NBglue(x,y,z) + t_sample *mixeng_conv[2][2][2][3] = { { { { - conv_natural_uint8_t_to_mono, - conv_natural_uint16_t_to_mono, - conv_natural_uint32_t_to_mono + NBglue(conv_natural_, uint8_t, _to_mono), + NBglue(conv_natural_, uint16_t, _to_mono), + NBglue(conv_natural_, uint32_t, _to_mono), }, { - conv_natural_uint8_t_to_mono, - conv_swap_uint16_t_to_mono, - conv_swap_uint32_t_to_mono, + NBglue(conv_natural_, uint8_t, _to_mono), + NBglue(conv_swap_, uint16_t, _to_mono), + NBglue(conv_swap_, uint32_t, _to_mono), } }, { { - conv_natural_int8_t_to_mono, - conv_natural_int16_t_to_mono, - conv_natural_int32_t_to_mono + NBglue(conv_natural_, int8_t, _to_mono), + NBglue(conv_natural_, int16_t, _to_mono), + NBglue(conv_natural_, int32_t, _to_mono) }, { - conv_natural_int8_t_to_mono, - conv_swap_int16_t_to_mono, - conv_swap_int32_t_to_mono + NBglue(conv_natural_, int8_t, _to_mono), + NBglue(conv_swap_, int16_t, _to_mono), + NBglue(conv_swap_, int32_t, _to_mono) } } }, { { { - conv_natural_uint8_t_to_stereo, - conv_natural_uint16_t_to_stereo, - conv_natural_uint32_t_to_stereo + NBglue(conv_natural_, uint8_t, _to_stereo), + NBglue(conv_natural_, uint16_t, _to_stereo), + NBglue(conv_natural_, uint32_t, _to_stereo) }, { - conv_natural_uint8_t_to_stereo, - conv_swap_uint16_t_to_stereo, - conv_swap_uint32_t_to_stereo + NBglue(conv_natural_, uint8_t, _to_stereo), + NBglue(conv_swap_, uint16_t, _to_stereo), + NBglue(conv_swap_, uint32_t, _to_stereo) } }, { { - conv_natural_int8_t_to_stereo, - conv_natural_int16_t_to_stereo, - conv_natural_int32_t_to_stereo + NBglue(conv_natural_, int8_t, _to_stereo), + NBglue(conv_natural_, int16_t, _to_stereo), + NBglue(conv_natural_, int32_t, _to_stereo) }, { - conv_natural_int8_t_to_stereo, - conv_swap_int16_t_to_stereo, - conv_swap_int32_t_to_stereo, + NBglue(conv_natural_, int8_t, _to_stereo), + NBglue(conv_swap_, int16_t, _to_stereo), + NBglue(conv_swap_, int32_t, _to_stereo), } } } @@ -202,52 +210,52 @@ { { { - clip_natural_uint8_t_from_mono, - clip_natural_uint16_t_from_mono, - clip_natural_uint32_t_from_mono + NBglue(clip_natural_, uint8_t, _from_mono), + NBglue(clip_natural_, uint16_t, _from_mono), + NBglue(clip_natural_, uint32_t, _from_mono) }, { - clip_natural_uint8_t_from_mono, - clip_swap_uint16_t_from_mono, - clip_swap_uint32_t_from_mono + NBglue(clip_natural_, uint8_t, _from_mono), + NBglue(clip_swap_, uint16_t, _from_mono), + NBglue(clip_swap_, uint32_t, _from_mono) } }, { { - clip_natural_int8_t_from_mono, - clip_natural_int16_t_from_mono, - clip_natural_int32_t_from_mono + NBglue(clip_natural_, int8_t, _from_mono), + NBglue(clip_natural_, int16_t, _from_mono), + NBglue(clip_natural_, int32_t, _from_mono) }, { - clip_natural_int8_t_from_mono, - clip_swap_int16_t_from_mono, - clip_swap_int32_t_from_mono + NBglue(clip_natural_, int8_t, _from_mono), + NBglue(clip_swap_, int16_t, _from_mono), + NBglue(clip_swap_, int32_t, _from_mono) } } }, { { { - clip_natural_uint8_t_from_stereo, - clip_natural_uint16_t_from_stereo, - clip_natural_uint32_t_from_stereo + NBglue(clip_natural_, uint8_t, _from_stereo), + NBglue(clip_natural_, uint16_t, _from_stereo), + NBglue(clip_natural_, uint32_t, _from_stereo) }, { - clip_natural_uint8_t_from_stereo, - clip_swap_uint16_t_from_stereo, - clip_swap_uint32_t_from_stereo + NBglue(clip_natural_, uint8_t, _from_stereo), + NBglue(clip_swap_, uint16_t, _from_stereo), + NBglue(clip_swap_, uint32_t, _from_stereo) } }, { { - clip_natural_int8_t_from_stereo, - clip_natural_int16_t_from_stereo, - clip_natural_int32_t_from_stereo + NBglue(clip_natural_, int8_t, _from_stereo), + NBglue(clip_natural_, int16_t, _from_stereo), + NBglue(clip_natural_, int32_t, _from_stereo) }, { - clip_natural_int8_t_from_stereo, - clip_swap_int16_t_from_stereo, - clip_swap_int32_t_from_stereo + NBglue(clip_natural_, int8_t, _from_stereo), + NBglue(clip_swap_, int16_t, _from_stereo), + NBglue(clip_swap_, int32_t, _from_stereo) } } } --Boundary-00=_os8LJb+kEP4807r--