/* platform.h - Platform-specific compatibility definitions */ #ifndef PLATFORM_H #define PLATFORM_H /* Platform detection */ #if defined(__MSDOS__) || defined(_MSDOS) || defined(__DOS__) || defined(MSDOS) #define PLATFORM_DOS 1 #else #define PLATFORM_UNIX 1 #endif /* Include appropriate curses library */ #ifdef PLATFORM_DOS #include /* PDCurses on DOS uses curses.h */ #include /* DOS path definitions */ #define PATH_SEP "\\" #define WORDLIST_PATH_1 "words" #define WORDLIST_PATH_2 "C:\\CORDLE\\words" #define WORDLIST_PATH_4 "D:\\CORDLE\\words" #define WORDLIST_PATH_3 NULL /* DOS doesn't have HOME environment variable */ #define HAS_HOME_ENV 0 #else /* Unix/Linux/macOS */ #include /* Unix path definitions */ #define PATH_SEP "/" #define WORDLIST_PATH_1 "words" #define WORDLIST_PATH_2 "/usr/local/share/cordle/words" #define WORDLIST_PATH_3_FMT "%s/.local/share/cordle/words" #define HAS_HOME_ENV 1 #endif /* Color code compatibility */ #ifdef PLATFORM_DOS /* PDCurses uses different color constants on some platforms */ #ifndef COLOR_WWHITE #define COLOR_WWHITE COLOR_WHITE #endif #else /* ncurses compatibility */ #ifndef COLOR_WWHITE #define COLOR_WWHITE COLOR_WHITE #endif #endif #endif /* PLATFORM_H */