From f1411efa85df8308105d9f2436166c507a9ee208 Mon Sep 17 00:00:00 2001 From: theoddone33 Date: Thu, 10 Jan 2002 05:21:36 +0000 Subject: [PATCH] Round 3: Some minor cross-platform compatibility changes (FreeBSD), still may not work 100%, but any other changes that will help are greatly appreciated. git-svn-id: svn://svn.icculus.org/hhexen/trunk@8 c79c8604-0f32-0410-912e-ea7021435596 --- base/i_cdmus.c | 2 ++ base/mn_menu.c | 2 +- base/p_inter.c | 2 +- base/st_start.c | 5 +++-- base/w_wad.c | 18 +++++------------- include/h2def.h | 8 ++++++++ 6 files changed, 20 insertions(+), 17 deletions(-) diff --git a/base/i_cdmus.c b/base/i_cdmus.c index 831d99e..b47f6dd 100644 --- a/base/i_cdmus.c +++ b/base/i_cdmus.c @@ -16,7 +16,9 @@ #include #include #include +#ifdef HAVE_LINUX_CDROM_H #include +#endif #include "h2def.h" #include "i_sound.h" diff --git a/base/mn_menu.c b/base/mn_menu.c index dac03ba..53c9504 100644 --- a/base/mn_menu.c +++ b/base/mn_menu.c @@ -426,7 +426,7 @@ static Menu_t *Menus[] = &SaveMenu }; -#if defined(__linux) +#if defined(__linux) || #defined(__FreeBSD__) static char *GammaText[] = { TXT_GAMMA_LEVEL_OFF, diff --git a/base/p_inter.c b/base/p_inter.c index 3aa6585..885ee6f 100644 --- a/base/p_inter.c +++ b/base/p_inter.c @@ -54,7 +54,7 @@ static void TryPickupWeaponPiece(player_t *player, pclass_t matchClass, /* jim Linux needs this too */ /* #ifdef __NeXT__ */ -#if defined(__NeXT__) || defined(__linux) +#if defined(__NeXT__) || defined(__linux) || defined(__FreeBSD__) extern void strupr(char *s); #endif diff --git a/base/st_start.c b/base/st_start.c index d809633..ae667be 100644 --- a/base/st_start.c +++ b/base/st_start.c @@ -12,10 +12,11 @@ // HEADER FILES ------------------------------------------------------------ -#ifdef __linux +#if 1 #include #include -#else +#else + /* I doubt I'll readd DOS support, but who knows */ #include #include #define O_BINARY 0 diff --git a/base/w_wad.c b/base/w_wad.c index 32d75b6..baaaaab 100644 --- a/base/w_wad.c +++ b/base/w_wad.c @@ -12,29 +12,21 @@ // HEADER FILES ------------------------------------------------------------ -#ifdef __linux #include #include #include #include /* jim open() etc. */ #include /* jim toupper() */ +#ifndef HAVE_ALLOCA_H +#include #else -#ifdef NeXT -#include -#include -#else -#include -#include -#include -#include -#endif +#define O_BINARY 0 #endif -#include #include "h2def.h" // MACROS ------------------------------------------------------------------ -#if defined(NeXT) || defined(__linux) +#if defined(NeXT) || defined(__linux) || defined(__FreeBSD__) // NeXT doesn't need a binary flag in open call #define O_BINARY 0 #define strcmpi strcasecmp @@ -85,7 +77,7 @@ boolean AuxiliaryOpened = false; // CODE -------------------------------------------------------------------- -#if defined(NeXT) || defined(__linux) +#if defined(NeXT) || defined(__linux) || defined(__FreeBSD__) //========================================================================== // // strupr diff --git a/include/h2def.h b/include/h2def.h index 331dc7d..85d7c19 100644 --- a/include/h2def.h +++ b/include/h2def.h @@ -24,7 +24,15 @@ #define VERSION 110 #define VERSION_TEXT "v1.1" +#if defined(__linux) #define VERSION_PLATFORM "Linux" +#elif defined (__FreeBSD__) +#define VERSION_PLATFORM "FreeBSD" +#elif defined (WIN32) +#define VERSION_PLATFORM "Windows" +#else +#define VERSION_PLATFORM "Unknown" +#endif #define VERSION_MAJ 1 #define VERSION_MIN 4 -- 2.39.2