From: David Griffith Date: Mon, 9 Jul 2012 08:07:36 +0000 (-0700) Subject: unicode cleanliness mods, no unicode yet until I work it out with DOS X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=74740a591ace7d107bbafb2fb1d7f092e4f3aef1;p=liskon_frotz.git unicode cleanliness mods, no unicode yet until I work it out with DOS --- diff --git a/src/common/err.c b/src/common/err.c index 49cb13b..040bc11 100644 --- a/src/common/err.c +++ b/src/common/err.c @@ -19,7 +19,7 @@ */ #include "frotz.h" -f_setup_t f_setup; +/*f_setup_t f_setup; */ /* Define stuff for stricter Z-code error checking, for the generic Unix/DOS/etc terminal-window interface. Feel free to change the way diff --git a/src/common/frotz.h b/src/common/frotz.h index f8ae19d..fd5d781 100644 --- a/src/common/frotz.h +++ b/src/common/frotz.h @@ -35,6 +35,12 @@ typedef int bool; typedef unsigned char zbyte; typedef unsigned short zword; +#ifdef MSDOS_16BIT +typedef unsigned char zchar; +#else +typedef unsigned short zchar; +#endif + enum story { BEYOND_ZORK, SHERLOCK, @@ -72,8 +78,6 @@ typedef struct { #include "setup.h" -typedef unsigned char zchar; - /*** Constants that may be set at compile time ***/ #ifndef MAX_UNDO_SLOTS diff --git a/src/curses/ux_init.c b/src/curses/ux_init.c index e185bcb..5e0584e 100644 --- a/src/curses/ux_init.c +++ b/src/curses/ux_init.c @@ -41,9 +41,12 @@ #include #endif +#ifndef WIN32 #include +#endif #include "ux_frotz.h" +#include "ux_blorb.h" f_setup_t f_setup; u_setup_t u_setup; @@ -140,12 +143,20 @@ void os_process_arguments (int argc, char *argv[]) char *home; char configfile[FILENAME_MAX + 1]; +#ifndef WIN32 if ((getuid() == 0) || (geteuid() == 0)) { printf("I won't run as root!\n"); exit(1); } +#endif + +#ifdef WIN32 +#define HOMEDIR "USERPROFILE" +#else +#define HOMEDIR "HOME" +#endif - if ((home = getenv("HOME")) == NULL) { + if ((home = getenv(HOMEDIR)) == NULL) { printf("Hard drive on fire!\n"); exit(1); }