Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 May 2001 17:00:13 +0200 (CEST)
From:      Christian Weisgerber <naddy@mips.inka.de>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/27270: sys/soundcard.h fails to define AFMT_S16_NE
Message-ID:  <200105111500.f4BF0Dl12537@kemoauc.mips.inka.de>

next in thread | raw e-mail | index | archive | help

>Number:         27270
>Category:       bin
>Synopsis:       sys/soundcard.h fails to define AFMT_S16_NE
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 11 08:40:02 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Christian Weisgerber
>Release:        FreeBSD 5.0-CURRENT alpha
>Organization:
>Environment:
System: FreeBSD kemoauc.mips.inka.de 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Mon May 7 16:13:13 CEST 2001 naddy@kemoauc.mips.inka.de:/home/obj/usr/src/sys/KEMOAUC alpha

>Description:

<sys/soundcard.h> fails to define AFMT_S16_NE for "16-bit signed
format in machine's native endian convention".  This is defined in
the OSS specs, it's available on Linux and NetBSD/OpenBSD, and some
third party software expects it to be available.

Bizarrely, there are no further _NE defines for unsigned or 32-bit
values.

>How-To-Repeat:

>Fix:

Index: sys/soundcard.h
===================================================================
RCS file: /home/ncvs/src/sys/sys/soundcard.h,v
retrieving revision 1.35
diff -u -r1.35 soundcard.h
--- sys/soundcard.h	2000/09/01 17:38:32	1.35
+++ sys/soundcard.h	2001/05/11 14:52:25
@@ -160,6 +160,13 @@
 #   define AFMT_U32_LE		0x00004000	/* Little endian unsigned 32 */
 #   define AFMT_U32_BE		0x00008000	/* big endian unsigned 32 */
 
+#include <machine/endian.h>
+#if BYTE_ORDER == LITTLE_ENDIAN
+#   define AFMT_S16_NE AFMT_S16_LE		/* native endian signed 16 */
+#else
+#   define AFMT_S16_NE AFMT_S16_BE
+#endif
+
 #   define AFMT_STEREO		0x10000000	/* can do/want stereo	*/
 
 /*
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200105111500.f4BF0Dl12537>