I got this tree to build under Solaris, AIX, IRIX, & Linux.

In order to do so I:
* included strings.h and string.h in many files so various functions would be
defined
* Fixed model_t collision problem in cl_main.c (Solaris)
* com.c - corrected WORDS_BIGENDIAN spelling
* gl_draw.c - Use HAVE_GL_COLOR_INDEX8_EXT to avoid referencing
GL_COLOR_INDEX8_EXT when it isn't available
* net_udp.c - use socklen_t to appease AIX
This commit is contained in:
Loring Holden 2000-05-25 06:14:56 +00:00
parent 0ad3e80422
commit 8005c0d25e
28 changed files with 148 additions and 25 deletions

View file

@ -17,21 +17,35 @@ libqfsys_cl_a_SOURCES = sys_unix.c cl_sys_unix.c
libqfsys_sv_a_SOURCES = sys_unix.c sv_sys_unix.c
endif
if ASM_ARCH
MATH_ASM = math.S
WORLDA_ASM = worlda.S
CL_ASM = snd_mixa.S cl_math.S sys_x86.S
SOFT_ASM = d_draw.S d_draw16.S d_parta.S d_polysa.S d_scana.S \
d_spr8.S d_varsa.S r_aclipa.S r_aliasa.S r_drawa.S r_edgea.S \
r_varsa.S surf16.S surf8.S
endif
EXTRA_libqfsys_cl_a_SOURCES = cl_sys_unix.c cl_sys_win.c sys_win.c sys_unix.c fnmatch.c dirent.c
EXTRA_libqfsys_sv_a_SOURCES = sv_sys_unix.c sv_sys_win.c sys_win.c sys_unix.c fnmatch.c dirent.c
if SNDTYPE_WIN32
libqfsnd_a_SOURCES = snd_dma.c snd_win.c
endif
libqfsnd_a_SOURCES = snd_win.c snd_dma.c snd_mem.c snd_mix.c
else
if SNDTYPE_OSS
libqfsnd_a_SOURCES = snd_dma.c snd_oss.c
endif
libqfsnd_a_SOURCES = snd_oss.c snd_dma.c snd_mem.c snd_mix.c
else
if SNDTYPE_ALSA
libqfsnd_a_SOURCES = snd_dma.c snd_alsa.c
endif
if SNDTYPE_NULL
libqfsnd_a_SOURCES = snd_alsa.c snd_dma.c snd_mem.c snd_mix.c
else
if SNDTYPE_SUN
libqfsnd_a_SOURCES = snd_sun.c snd_dma.c snd_mem.c snd_mix.c
else
libqfsnd_a_SOURCES = snd_null.c
endif
endif
endif
endif
EXTRA_libqfsnd_a_SOURCES = snd_dma.c snd_win.c snd_oss.c snd_alsa.c snd_null.c
if CDTYPE_WIN32
@ -46,26 +60,23 @@ endif
EXTRA_libqfcd_a_SOURCES = cd_win.c cd_linux.c cd_null.c
common_SOURCES= net_chan.c net_com.c net_udp.c pmove.c pmovetst.c zone.c \
mdfour.c mathlib.c math.S cvar.c crc.c model.c cmd.c \
mdfour.c mathlib.c cvar.c crc.c model.c cmd.c \
qargs.c qendian.c quakefs.c quakeio.c msg.c sizebuf.c info.c \
checksum.c link.c buildnum.c va.c com.c
checksum.c link.c buildnum.c va.c com.c $(MATH_ASM)
server_SOURCES= pr_cmds.c pr_edict.c pr_exec.c sv_init.c sv_main.c sv_misc.c \
sv_model.c sv_nchan.c sv_ents.c sv_send.c sv_move.c sv_phys.c \
sv_user.c sv_ccmds.c world.c worlda.S sv_cvar.c
sv_user.c sv_ccmds.c world.c sv_cvar.c $(WORLDA_ASM)
client_SOURCES= cl_cmd.c cl_cvar.c cl_demo.c cl_ents.c cl_input.c cl_main.c \
cl_math.S cl_misc.c cl_parse.c cl_pred.c cl_tent.c cl_cam.c \
r_view.c wad.c snd_mem.c snd_mix.c snd_mixa.S \
cl_misc.c cl_parse.c cl_pred.c cl_tent.c cl_cam.c \
r_view.c wad.c \
skin.c sbar.c nonintel.c menu.c keys.c console.c \
sys_x86.S cl_slist.c
cl_slist.c $(CL_ASM)
soft_SOURCES= cl_model.c cl_trans.c d_edge.c d_fill.c d_init.c d_modech.c \
d_part.c d_polyse.c d_scan.c d_sky.c d_sprite.c d_surf.c \
d_vars.c d_zpoint.c draw.c r_aclip.c r_alias.c r_bsp.c \
r_draw.c r_edge.c r_efrag.c r_light.c r_main.c r_misc.c \
r_part.c r_sky.c r_sprite.c r_surf.c r_vars.c sw_view.c \
screen.c \
d_draw.S d_draw16.S d_parta.S d_polysa.S d_scana.S \
d_spr8.S d_varsa.S r_aclipa.S r_aliasa.S r_drawa.S r_edgea.S \
r_varsa.S surf16.S surf8.S
screen.c $(SOFT_ASM)
ogl_SOURCES= gl_draw.c gl_mesh.c gl_model.c gl_ngraph.c gl_part.c \
gl_refrag.c gl_rlight.c gl_rmain.c gl_rmisc.c gl_rsurf.c \
gl_screen.c gl_trans.c gl_view.c gl_warp.c

View file

@ -32,6 +32,9 @@
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
//char *date = "Dec 21 1999";
static char *date = __DATE__ ;

View file

@ -35,6 +35,9 @@
#include "msg.h"
#include <string.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
/*
===================

View file

@ -58,6 +58,12 @@
#include "draw.h"
#include "qargs.h"
#include "cdaudio.h"
#ifdef __sun
/* Sun's model_t in sys/model.h conflicts w/ Quake's model_t */
#define model_t sunmodel_t
#endif
#ifdef _WIN32
#include "winquake.h"
#include "winsock.h"
@ -65,7 +71,15 @@
#else
#include <netinet/in.h>
#endif
#ifdef __sun
#undef model_t
#endif
#include <cl_slist.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
// we need to declare some mouse variables here, because the menu system

View file

@ -32,6 +32,9 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "model.h"
#include "crc.h"
#include "msg.h"

View file

@ -40,6 +40,9 @@
#include "msg.h"
#include "pmove.h"
#include "sbar.h"
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
extern cvar_t *gl_flashblend;
extern cvar_t *cl_autoexec;

View file

@ -39,6 +39,9 @@
#include <math.h>
#include <stdlib.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#define MAX_BEAMS 8
typedef struct

View file

@ -34,6 +34,9 @@
#include "client.h"
#include <string.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
/*
=====================

View file

@ -41,6 +41,9 @@
#include <string.h>
#include <ctype.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
void Cmd_ForwardToServer (void);

View file

@ -88,7 +88,7 @@ COM_Init
*/
void COM_Init (void)
{
#ifndef WORDS_BIGENDIEN
#ifndef WORDS_BIGENDIAN
bigendien = false;
BigShort = ShortSwap;
LittleShort = ShortNoSwap;

View file

@ -32,6 +32,9 @@
#include <string.h>
#include <stdio.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#include "bothdefs.h" // needed by: common.h, net.h, client.h
@ -1240,7 +1243,12 @@ void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboole
{
if (!mipmap)
{
/* FIXME - what if this extension isn't available? */
#ifdef HAVE_GL_COLOR_INDEX8_EXT
glTexImage2D (GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX , GL_UNSIGNED_BYTE, data);
#else
/* FIXME - should warn that this isn't available */
#endif
goto done;
}
memcpy (scaled, data, width*height);
@ -1248,7 +1256,12 @@ void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboole
else
GL_Resample8BitTexture (data, width, height, scaled, scaled_width, scaled_height);
// FIXME - what if this extension isn't available?
#ifdef HAVE_GL_COLOR_INDEX8_EXT
glTexImage2D (GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, scaled);
#else
/* FIXME - should warn that this isn't available */
#endif
if (mipmap)
{
int miplevel;
@ -1264,7 +1277,12 @@ void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboole
if (scaled_height < 1)
scaled_height = 1;
miplevel++;
/* FIXME - what if this extension isn't available? */
#ifdef HAVE_GL_COLOR_INDEX8_EXT
glTexImage2D (GL_TEXTURE_2D, miplevel, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, scaled);
#else
/* FIXME - should warn that this isn't available */
#endif
}
}
done: ;
@ -1401,7 +1419,7 @@ void GL_SelectTexture (GLenum target)
{
if (!gl_mtexable)
return;
#ifndef __linux__ // no multitexture under Linux yet
#ifdef _WIN32 // FIXME - only multi-texture under Win32
qglSelectTextureSGIS(target);
#endif
if (target == oldtarget)

View file

@ -31,6 +31,9 @@
#endif
#include <string.h>
#include <stdio.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#include "bothdefs.h" // needed by: common.h, net.h, client.h

View file

@ -34,6 +34,9 @@
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#include "bothdefs.h"
#include "console.h"

View file

@ -34,6 +34,9 @@
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
/*
=====================================================================

View file

@ -35,6 +35,9 @@
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#include "qtypes.h"
#include "sys.h"

View file

@ -29,6 +29,9 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include <math.h>
#include "qtypes.h"
#include "mathlib.h"

View file

@ -34,6 +34,9 @@
#else
# include <windows.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include <time.h>
#include <stdarg.h>

View file

@ -82,6 +82,14 @@
# define MAXHOSTNAMELEN 512
#endif
#ifndef HAVE_SOCKLEN_T
# ifdef HAVE_SIZE
typedef size_t socklen_t;
# else
typedef unsigned int socklen_t;
# endif
#endif
netadr_t net_local_adr;
netadr_t net_from;
@ -230,13 +238,13 @@ qboolean NET_IsClientLegal(netadr_t *adr)
qboolean NET_GetPacket (void)
{
int ret;
struct sockaddr_in from;
int fromlen;
int ret;
struct sockaddr_in from;
socklen_t fromlen;
fromlen = sizeof(from);
ret = recvfrom(net_socket, net_message_buffer, sizeof(net_message_buffer),
0, (struct sockaddr *)&from, &fromlen);
ret = recvfrom(net_socket, (void*)net_message_buffer, sizeof(net_message_buffer), 0, (struct sockaddr *)&from, &fromlen);
SockadrToNetadr (&from, &net_from);
SockadrToNetadr(&from, &net_from);
if (ret == -1) {
@ -337,7 +345,7 @@ void NET_GetLocalAddress (void)
{
char buff[MAXHOSTNAMELEN];
struct sockaddr_in address;
int namelen;
socklen_t namelen;
gethostname(buff, MAXHOSTNAMELEN);
buff[MAXHOSTNAMELEN-1] = 0;

View file

@ -29,6 +29,9 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "sys.h"
#include "qtypes.h"
#include "pmove.h"

View file

@ -44,6 +44,9 @@
#include <stdlib.h>
#include <math.h>
#include <string.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
void SV_Error (char *error, ...);

View file

@ -29,6 +29,9 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "sys.h"
#include "cmd.h"
#include "bothdefs.h"

View file

@ -29,6 +29,9 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "sound.h"
#include "console.h"

View file

@ -45,6 +45,9 @@
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
qboolean sv_allow_cheats;

View file

@ -29,6 +29,9 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "server.h"
#include "crc.h"
#include "msg.h"

View file

@ -45,6 +45,9 @@
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
quakeparms_t host_parms;

View file

@ -29,6 +29,9 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "server.h"
#include "crc.h"
#include "msg.h"

View file

@ -31,6 +31,9 @@
# include <config.h>
#endif
#include <sys/types.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#include "qargs.h"
#include "cvar.h"
#include "server.h"
@ -46,6 +49,9 @@
#include <errno.h>
#include <unistd.h>
#include <sys/time.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
/* cvar_t sys_extrasleep = {"sys_extrasleep","0"};

View file

@ -36,6 +36,9 @@
#include "console.h"
#include <stdio.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
/*