Mercurial > hg > early-roguelike
comparison arogue5/mdport.c @ 122:65f3da34578a
rogue4, arogue5: improve portability.
Most changes merely prevent including header files that don't exist.
All games now build and run on MinGW, though bugs remain.
| author | John "Elwin" Edwards |
|---|---|
| date | Wed, 07 May 2014 14:08:38 -0700 |
| parents | 2f41b9635c34 |
| children | aac28331e71d |
comparison
equal
deleted
inserted
replaced
| 121:e6c8652473fe | 122:65f3da34578a |
|---|---|
| 40 #include <shlobj.h> | 40 #include <shlobj.h> |
| 41 #include <sys/types.h> | 41 #include <sys/types.h> |
| 42 #undef MOUSE_MOVED | 42 #undef MOUSE_MOVED |
| 43 #elif defined(__DJGPP__) | 43 #elif defined(__DJGPP__) |
| 44 #include <process.h> | 44 #include <process.h> |
| 45 #else | 45 #endif |
| 46 | |
| 47 #ifdef HAVE_PWD_H | |
| 46 #include <pwd.h> | 48 #include <pwd.h> |
| 49 #endif | |
| 50 #ifdef HAVE_SYS_UTSNAME_H | |
| 47 #include <sys/utsname.h> | 51 #include <sys/utsname.h> |
| 52 #endif | |
| 53 #ifdef HAVE_UNISTD_H | |
| 48 #include <unistd.h> | 54 #include <unistd.h> |
| 49 #endif | 55 #endif |
| 50 | 56 |
| 51 #include <stdlib.h> | 57 #include <stdlib.h> |
| 52 #include <string.h> | 58 #include <string.h> |
| 55 #define PATH_MAX MAX_PATH | 61 #define PATH_MAX MAX_PATH |
| 56 #endif | 62 #endif |
| 57 | 63 |
| 58 #include <curses.h> | 64 #include <curses.h> |
| 59 | 65 |
| 60 #if defined(__INTERIX) || defined(__MSYS__) | 66 #if defined(HAVE_TERM_H) |
| 61 #include <term.h> | 67 #include <term.h> |
| 62 #elif defined(HAVE_NCURSES_TERM_H) | 68 #elif defined(HAVE_NCURSES_TERM_H) |
| 63 #include <ncurses/term.h> | 69 #include <ncurses/term.h> |
| 64 #else | |
| 65 #include <term.h> | |
| 66 #endif | 70 #endif |
| 67 | 71 |
| 68 #include <stdio.h> | 72 #include <stdio.h> |
| 69 #include <fcntl.h> | 73 #include <fcntl.h> |
| 70 #include <limits.h> | 74 #include <limits.h> |
| 91 ESCDELAY=250; | 95 ESCDELAY=250; |
| 92 #endif | 96 #endif |
| 93 } | 97 } |
| 94 | 98 |
| 95 int | 99 int |
| 96 md_hasclreol() | 100 md_hasclreol(void) |
| 97 { | 101 { |
| 98 #ifndef attron | 102 #if defined(clr_eol) |
| 99 return(!CE); | 103 #ifdef NCURSES_VERSION |
| 100 #elif !defined(__PDCURSES__) | 104 if (cur_term == NULL) |
| 101 return(clr_eol != NULL); | 105 return(0); |
| 102 #else | 106 if (cur_term->type.Strings == NULL) |
| 107 return(0); | |
| 108 #endif | |
| 109 return((clr_eol != NULL) && (*clr_eol != 0)); | |
| 110 #elif defined(__PDCURSES__) | |
| 103 return(TRUE); | 111 return(TRUE); |
| 112 #else | |
| 113 return((CE != NULL) && (*CE != 0)); | |
| 104 #endif | 114 #endif |
| 105 } | 115 } |
| 106 | 116 |
| 107 #ifdef attron | 117 #ifdef attron |
| 108 # define _puts(s) tputs(s, 0, md_putchar); | 118 # define _puts(s) tputs(s, 0, md_putchar); |
