2026-01-26 14:29:55 +00:00
|
|
|
/* 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 <conio.h>
|
|
|
|
|
/* PDCurses on DOS uses curses.h */
|
|
|
|
|
#include <curses.h>
|
|
|
|
|
|
|
|
|
|
/* DOS path definitions */
|
|
|
|
|
#define PATH_SEP "\\"
|
2026-01-28 08:33:37 +00:00
|
|
|
#define WORDLIST_PATH_1 "WORDS"
|
|
|
|
|
#define WORDLIST_PATH_2 "D:\\CORDLE\\WORDS"
|
|
|
|
|
#define WORDLIST_PATH_3 "C:\\CORDLE\\WORDS"
|
|
|
|
|
#define WORDLIST_PATH_4 NULL
|
2026-01-26 14:29:55 +00:00
|
|
|
|
|
|
|
|
/* DOS doesn't have HOME environment variable */
|
|
|
|
|
#define HAS_HOME_ENV 0
|
|
|
|
|
#else
|
|
|
|
|
/* Unix/Linux/macOS */
|
|
|
|
|
#include <curses.h>
|
|
|
|
|
|
|
|
|
|
/* Unix path definitions */
|
|
|
|
|
#define PATH_SEP "/"
|
2026-01-28 08:33:37 +00:00
|
|
|
#define WORDLIST_PATH_1 "WORDS"
|
|
|
|
|
#define WORDLIST_PATH_2 "/usr/local/share/cordle/WORDS"
|
2026-01-28 08:38:50 +00:00
|
|
|
#define WORDLIST_PATH_3 "%s/.local/share/cordle/WORDS"
|
2026-01-28 08:33:37 +00:00
|
|
|
#define WORDLIST_PATH_3_FMT "%s/.local/share/cordle/WORDS"
|
2026-01-26 14:29:55 +00:00
|
|
|
|
|
|
|
|
#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 */
|