pkgsrc/emulators/tuxnes/patches/patch-ac
hans 5821bac85f Fix build on SunOS.
- buildlink against x11/xextproto for shmproto.h
- endian defines
- use GNU ld to build table.o
2012-03-07 15:52:40 +00:00

37 lines
1.1 KiB
Text

$NetBSD: patch-ac,v 1.3 2012/03/07 15:52:40 hans Exp $
--- sound.c.orig 2001-04-11 21:45:47.000000000 +0000
+++ sound.c
@@ -104,12 +104,22 @@
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
#include <sys/ioctl.h>
#if defined(__FreeBSD__)
#include <machine/endian.h>
-#elif defined(__NetBSD__) || defined(__OpenBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
#include <sys/endian.h>
+#elif defined(__sun)
+#include <sys/byteorder.h>
+#define LITTLE_ENDIAN 1234
+#define BIG_ENDIAN 4321
+#ifdef _BIG_ENDIAN
+#define BYTE_ORDER BIG_ENDIAN
+#else
+#define BYTE_ORDER LITTLE_ENDIAN
+#endif
#else /* Linux */
#include <endian.h>
#endif
@@ -411,7 +421,7 @@ InitAudio(int argc, char **argv)
{
int desired_fragmentsize = 0;
#ifdef SNDCTL_DSP_RESET
- if (! ioctl (audiofd, SNDCTL_DSP_RESET)) {
+ if (! ioctl (audiofd, SNDCTL_DSP_RESET, 0)) {
int desired_audiorate;
int desired_audiostereo;
struct SampleFormat *desired_sample_format = sample_format;