Round 3: Some minor cross-platform compatibility changes (FreeBSD), still may not...
authortheoddone33 <theoddone33@c79c8604-0f32-0410-912e-ea7021435596>
Thu, 10 Jan 2002 05:21:36 +0000 (05:21 +0000)
committertheoddone33 <theoddone33@c79c8604-0f32-0410-912e-ea7021435596>
Thu, 10 Jan 2002 05:21:36 +0000 (05:21 +0000)
git-svn-id: svn://svn.icculus.org/hhexen/trunk@8 c79c8604-0f32-0410-912e-ea7021435596

base/i_cdmus.c
base/mn_menu.c
base/p_inter.c
base/st_start.c
base/w_wad.c
include/h2def.h

index 831d99e..b47f6dd 100644 (file)
@@ -16,7 +16,9 @@
 #include <string.h>
 #include <time.h>
 #include <errno.h>
+#ifdef HAVE_LINUX_CDROM_H
 #include <linux/cdrom.h>
+#endif
 #include "h2def.h"
 #include "i_sound.h"
 
index dac03ba..53c9504 100644 (file)
@@ -426,7 +426,7 @@ static Menu_t *Menus[] =
        &SaveMenu
 };
 
-#if defined(__linux)
+#if defined(__linux) || #defined(__FreeBSD__)
 static char *GammaText[] = 
 {
        TXT_GAMMA_LEVEL_OFF,
index 3aa6585..885ee6f 100644 (file)
@@ -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
 
index d809633..ae667be 100644 (file)
 
 
 // HEADER FILES ------------------------------------------------------------
-#ifdef __linux
+#if 1
        #include <sys/stat.h>
        #include <sys/types.h>
-#else 
+#else
+       /* I doubt I'll readd DOS support, but who knows */
        #include <libc.h>
        #include <ctype.h>
        #define O_BINARY 0
index 32d75b6..baaaaab 100644 (file)
 
 // HEADER FILES ------------------------------------------------------------
 
-#ifdef __linux
 #include <malloc.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h> /* jim open() etc. */
 #include <ctype.h>  /* jim toupper() */
+#ifndef HAVE_ALLOCA_H
+#include <alloca.h>
 #else
-#ifdef NeXT
-#include <libc.h>
-#include <ctype.h>
-#else
-#include <malloc.h>
-#include <io.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#endif
+#define O_BINARY 0
 #endif
-#include <alloca.h>
 #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
index 331dc7d..85d7c19 100644 (file)
 #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