diff --git a/Source/d_io.h b/Source/d_io.h index 7932f309..1f0f58bd 100644 --- a/Source/d_io.h +++ b/Source/d_io.h @@ -21,6 +21,13 @@ #ifndef D_IO_INCLUDED #define D_IO_INCLUDED +#ifndef TRUE + #define TRUE true +#endif +#ifndef FALSE + #define FALSE false +#endif + #ifdef _MSC_VER #include #include @@ -28,13 +35,28 @@ #define W_OK 2 #define R_OK 4 #define S_ISDIR(x) (((sbuf.st_mode & S_IFDIR)==S_IFDIR)?1:0) - #define TRUE true - #define FALSE false #define strcasecmp _stricmp #define strncasecmp _strnicmp #ifndef PATH_MAX #define PATH_MAX _MAX_PATH #endif +#elif defined (__unix__) + #include + #include // tolower() + #ifndef O_BINARY + #define O_BINARY 0 + #endif + #define stricmp strcasecmp + #define strnicmp strncasecmp + static inline char *strlwr (char *str) { + char *c = str; + while (*str != '\0') + { + *str = tolower (*str); + str++; + } + return c; + } #else #include #endif diff --git a/Source/d_main.c b/Source/d_main.c index 92cb899d..f316c609 100644 --- a/Source/d_main.c +++ b/Source/d_main.c @@ -1263,6 +1263,7 @@ void D_DoomMain(void) if (devparm) printf(D_DEVSTR); +#ifndef __unix__ if (M_CheckParm("-cdrom")) { printf(D_CDROM); @@ -1275,6 +1276,7 @@ void D_DoomMain(void) // killough 10/98: sprintf(basedefault, "c:/doomdata/%s.cfg", D_DoomExeName()); } +#endif // turbo option if ((p=M_CheckParm ("-turbo"))) diff --git a/Source/g_game.c b/Source/g_game.c index b917dff1..caa6b3e8 100644 --- a/Source/g_game.c +++ b/Source/g_game.c @@ -1156,9 +1156,11 @@ void G_SaveGameName(char *name, int slot) // Ty 05/04/98 - use savegamename variable (see d_deh.c) // killough 12/98: add .7 to truncate savegamename +#ifndef __unix__ if (M_CheckParm("-cdrom")) sprintf(name, "c:/doomdata/%.7s%d.dsg", savegamename, slot); else +#endif sprintf(name, "%s/%.7s%d.dsg", basesavegame, savegamename, slot); } diff --git a/Source/i_system.c b/Source/i_system.c index 55977dd8..d37cfe39 100644 --- a/Source/i_system.c +++ b/Source/i_system.c @@ -257,7 +257,7 @@ void I_Quit (void) G_CheckDemoStatus(); M_SaveDefaults(); -#if defined(MY_SDL_VER) +#if defined(MY_SDL_VER) && defined(_MSC_VER) // Under Visual C++, the console window likes to rudely slam // shut -- this can stop it if(*errmsg || waitAtExit) diff --git a/Source/m_fixed.h b/Source/m_fixed.h index c80643bc..8bae7313 100644 --- a/Source/m_fixed.h +++ b/Source/m_fixed.h @@ -36,6 +36,7 @@ #define __attribute__(x) #endif +#include // abs() #include "i_system.h" // diff --git a/Source/p_mobj.c b/Source/p_mobj.c index a674db75..efed3266 100644 --- a/Source/p_mobj.c +++ b/Source/p_mobj.c @@ -717,8 +717,8 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) return mobj; } -static mapthing_t itemrespawnque[ITEMQUESIZE]; -static int itemrespawntime[ITEMQUESIZE]; +mapthing_t itemrespawnque[ITEMQUESIZE]; +int itemrespawntime[ITEMQUESIZE]; int iquehead, iquetail; // diff --git a/Source/r_segs.c b/Source/r_segs.c index 8b53b218..03a090b9 100644 --- a/Source/r_segs.c +++ b/Source/r_segs.c @@ -45,9 +45,9 @@ rcsid[] = "$Id: r_segs.c,v 1.16 1998/05/03 23:02:01 killough Exp $"; // killough 1/6/98: replaced globals with statics where appropriate // True if any of the segs textures might be visible. -static boolean segtextured; -static boolean markfloor; // False if the back side is the same plane. -static boolean markceiling; +boolean segtextured; +boolean markfloor; // False if the back side is the same plane. +boolean markceiling; static boolean maskedtexture; static int toptexture; static int bottomtexture; @@ -61,8 +61,8 @@ lighttable_t **walllights; // // regular wall // -static int rw_x; -static int rw_stopx; +int rw_x; +int rw_stopx; static angle_t rw_centerangle; static fixed_t rw_offset; static fixed_t rw_scale; diff --git a/Source/z_zone.h b/Source/z_zone.h index 2d1eeaf7..a65304dd 100644 --- a/Source/z_zone.h +++ b/Source/z_zone.h @@ -99,6 +99,8 @@ void Z_DumpHistory(char *); #define calloc(n1,n2) Z_Calloc(n1,n2,PU_STATIC,0) #define strdup(s) Z_Strdup(s,PU_STATIC,0) +// dprintf() is already declared in , define it out of the way +#define dprintf doomprintf // Doom-style printf void dprintf(const char *, ...) __attribute__((format(printf,1,2)));