mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-22 11:41:38 +00:00
Some compile fixes for OpenBSD
This commit is contained in:
parent
0d5bebabe2
commit
f75b0a611b
19 changed files with 31 additions and 24 deletions
|
@ -29,6 +29,7 @@
|
|||
#ifndef __net_h
|
||||
#define __net_h
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
AUTOMAKE_OPTIONS= foreign
|
||||
|
||||
AM_CFLAGS= @PREFER_PIC@ @VORBIS_CFLAGS@ @OGG_CFLAGS@
|
||||
AM_CFLAGS= @PREFER_PIC@ @VORBIS_CFLAGS@ @OGG_CFLAGS@ @SAMPLERATE_CFLAGS@
|
||||
INCLUDES= -I$(top_srcdir)/include
|
||||
plugin_ldflags= @plugin_ldflags@ -avoid-version -module -rpath $(plugindir)
|
||||
plugin_libadd= @plugin_libadd@
|
||||
|
|
|
@ -38,7 +38,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#if defined(_WIN32) && defined(HAVE_MALLOC_H)
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -36,6 +36,12 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
@ -59,7 +65,7 @@ static int audio_fd;
|
|||
static int snd_inited;
|
||||
static int snd_blocked = 0;
|
||||
|
||||
static int wbufp;
|
||||
static unsigned int wbufp;
|
||||
static audio_info_t info;
|
||||
|
||||
#define BUFFER_SIZE 8192
|
||||
|
@ -141,8 +147,8 @@ SNDDMA_Init (void)
|
|||
sn.channels = 2;
|
||||
}
|
||||
|
||||
sn.samples = sizeof (dma_buffer) / (sn.samplebits / 8);
|
||||
sn.samplepos = 0;
|
||||
sn.frames = sizeof (dma_buffer) / (sn.samplebits / 8);
|
||||
sn.framepos = 0;
|
||||
sn.submission_chunk = 1;
|
||||
sn.buffer = (unsigned char *) dma_buffer;
|
||||
|
||||
|
@ -165,9 +171,9 @@ SNDDMA_GetDMAPos (void)
|
|||
return (0);
|
||||
}
|
||||
|
||||
return ((info.play.samples * sn.channels) % sn.samples);
|
||||
return ((info.play.samples * sn.channels) % sn.frames);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
SNDDMA_GetSamples (void)
|
||||
{
|
||||
|
@ -184,7 +190,7 @@ SNDDMA_GetSamples (void)
|
|||
|
||||
return info.play.samples;
|
||||
}
|
||||
|
||||
#endif
|
||||
static void
|
||||
SNDDMA_Shutdown (void)
|
||||
{
|
||||
|
@ -219,7 +225,7 @@ SNDDMA_Submit (void)
|
|||
if (!bytes)
|
||||
return;
|
||||
|
||||
if (bytes > sizeof (writebuf)) {
|
||||
if (bytes > (int) sizeof (writebuf)) {
|
||||
bytes = sizeof (writebuf);
|
||||
stop = wbufp + bytes / bsize;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#if defined(_WIN32) && defined(HAVE_MALLOC_H)
|
||||
# include <malloc.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#if defined(_WIN32) && defined(HAVE_MALLOC_H)
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#if defined(_WIN32) && defined(HAVE_MALLOC_H)
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#if defined(_WIN32) && defined(HAVE_MALLOC_H)
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#endif
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#if defined(_WIN32) && defined(HAVE_MALLOC_H)
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#if defined(_WIN32) && defined(HAVE_MALLOC_H)
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
# include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#if defined(_WIN32) && defined(HAVE_MALLOC_H)
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#if defined(_WIN32) && defined(HAVE_MALLOC_H)
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
# include <alloca.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#if defined(_WIN32) && defined(HAVE_MALLOC_H)
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
# include <alloca.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#if defined(_WIN32) && defined(HAVE_MALLOC_H)
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
# include <rpc/types.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#if defined(_WIN32) && defined(HAVE_MALLOC_H)
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ const char rcsid[] = "$Id: $";
|
|||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#if defined(_WIN32) && defined(HAVE_MALLOC_H)
|
||||
# include <malloc.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
|
|
|
@ -37,7 +37,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#if defined(_WIN32) && defined(HAVE_MALLOC_H)
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -30,7 +30,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#if defined(_WIN32) && defined(HAVE_MALLOC_H)
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -41,7 +41,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#if defined(_WIN32) && defined(HAVE_MALLOC_H)
|
||||
# include <malloc.h>
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue