mirror of
https://github.com/VARCem/PDCurses.git
synced 2026-09-25 08:15:27 +00:00
Finally eliminated the platform defines from curses.h, except for X11-
specific SCREEN elements and functions. The last reason to keep them was the automatic definition of XCURSES; but x11.c will now work with either set of color macros at build time, and the other two XCURSES ifdefs don't affect how normal apps work. Downside: Dynamically-linked XCurses apps built against the old library will have their red and blue swapped until rebuilt. (I included a test for PDC_RGB where XCURSES used to be, to allow building the library with the old color scheme, to get around this; but it would have to be defined when building any new app, too.) Because of this, I hesitated -- there goes the binary compatibility of the 3.x series -- but then, I never did really commit to that. Also, any app that depends on PDCurses to determine the platform it's building on, by checking for DOS, WIN32, or OS2, will be disappointed. (I wouldn't think that any app did that, but it looks like THE might, with certain compilers/platforms.)
This commit is contained in:
205
curses.h
205
curses.h
@@ -11,7 +11,7 @@
|
||||
* See the file maintain.er for details of the current maintainer. *
|
||||
************************************************************************/
|
||||
|
||||
/* $Id: curses.h,v 1.284 2007/05/28 19:47:16 wmcbrine Exp $ */
|
||||
/* $Id: curses.h,v 1.285 2007/05/29 07:02:29 wmcbrine Exp $ */
|
||||
|
||||
/*----------------------------------------------------------------------*
|
||||
* PDCurses *
|
||||
@@ -24,9 +24,6 @@
|
||||
|
||||
PDCurses definitions list: (Only define those needed)
|
||||
|
||||
DOS True if compiling for DOS.
|
||||
OS2 True if compiling for OS/2.
|
||||
WIN32 True if compiling for Windows.
|
||||
XCURSES True if compiling for X11.
|
||||
|
||||
PDCurses portable platform definitions list:
|
||||
@@ -39,208 +36,15 @@ PDCurses portable platform definitions list:
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
#define PDC_BUILD 3103
|
||||
#define PDC_BUILD 3104
|
||||
#define PDCURSES 1 /* PDCurses-only routines */
|
||||
#define XOPEN 1 /* X/Open Curses routines */
|
||||
#define SYSVcurses 1 /* System V Curses routines */
|
||||
#define BSDcurses 1 /* BSD Curses routines */
|
||||
#define CHTYPE_LONG 1 /* size of chtype; long */
|
||||
|
||||
/*----------------------------------------
|
||||
* BORLAND COMPILERS Turbo C[++], Borland C[++]
|
||||
*
|
||||
* Borland definitions:
|
||||
* DOS
|
||||
* OS2
|
||||
*
|
||||
* __TURBOC__, __MSDOS__,
|
||||
* __OS2__ and __WIN32__
|
||||
* are predefined by compiler.
|
||||
*/
|
||||
|
||||
#ifdef __TURBOC__
|
||||
# ifdef __MSDOS__
|
||||
# define DOS 6 /* Major release of DOS supported */
|
||||
# endif
|
||||
# ifdef __OS2__
|
||||
# define OS2 3 /* Major release of OS/2 supported */
|
||||
# endif
|
||||
# ifdef __WIN32__
|
||||
# ifndef WIN32
|
||||
# define WIN32 1
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*----------------------------------------
|
||||
* METAWARE COMPILERS High C
|
||||
*
|
||||
* Metaware definitions:
|
||||
* DOS
|
||||
*/
|
||||
|
||||
#ifdef __HIGHC__
|
||||
# ifdef __MSDOS__
|
||||
# define DOS 6
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*----------------------------------------
|
||||
* MICROSOFT COMPILERS MSC
|
||||
*
|
||||
* Microsoft definitions:
|
||||
* DOS || OS2
|
||||
*/
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# ifdef __OS2__ /* You will have to define in makefile */
|
||||
# define OS2 3
|
||||
# else
|
||||
# ifdef _WIN32
|
||||
# ifndef WIN32
|
||||
# define WIN32
|
||||
# endif
|
||||
# else
|
||||
# define DOS 6
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*----------------------------------------
|
||||
* MICROSOFT QUICK C COMPILERS QC
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef _QC
|
||||
# define DOS 6
|
||||
#endif
|
||||
|
||||
/*----------------------------------------
|
||||
* TOPSPEED compilers TSC
|
||||
*
|
||||
* TOPSPEED definitions:
|
||||
* DOS || OS2
|
||||
*/
|
||||
|
||||
#ifdef __TSC__ /* You may have to define in makefile */
|
||||
# ifdef __OS2__
|
||||
# define OS2 3
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*----------------------------------------
|
||||
* IBM C Set/2 Compiler CSET2
|
||||
*
|
||||
* IBM definitions:
|
||||
* OS2
|
||||
*/
|
||||
|
||||
#ifdef __IBMC__
|
||||
# ifdef __OS2__
|
||||
# define OS2 3
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*----------------------------------------
|
||||
* GNU compilers emx
|
||||
*
|
||||
* emx definitions:
|
||||
* OS2
|
||||
*/
|
||||
|
||||
#ifdef __EMX__ /* You may have to define in makefile */
|
||||
# ifndef __OS2__
|
||||
# define __OS2__ /* EMX does not define this :-( */
|
||||
# endif
|
||||
# define OS2 3
|
||||
#endif
|
||||
|
||||
/*----------------------------------------
|
||||
* GNU compilers djgpp
|
||||
*
|
||||
* djgpp definitions:
|
||||
* DOS
|
||||
*/
|
||||
|
||||
#ifdef __DJGPP__ /* You may have to define in makefile */
|
||||
# define DOS 6
|
||||
#endif
|
||||
|
||||
/*----------------------------------------
|
||||
* GNU compilers Cygnus Win32
|
||||
*
|
||||
* cygnus definitions:
|
||||
* WIN32
|
||||
*/
|
||||
|
||||
#ifdef __CYGWIN32__ /* You may have to define in makefile */
|
||||
# if !defined(WIN32) && !defined(XCURSES)
|
||||
# define WIN32
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*----------------------------------------
|
||||
* GNU compilers Ming Win32
|
||||
*
|
||||
* Ming definitions:
|
||||
* WIN32
|
||||
*/
|
||||
|
||||
#ifdef __MINGW32__
|
||||
# ifndef WIN32
|
||||
# define WIN32
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*----------------------------------------
|
||||
* LCC WIN32
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __LCC__
|
||||
# ifndef WIN32
|
||||
# define WIN32
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*----------------------------------------
|
||||
* Watcom C/C++ 10.6 compiler
|
||||
*
|
||||
* WATCOM definitions:
|
||||
* OS2
|
||||
* WIN32
|
||||
*/
|
||||
|
||||
#ifdef __WATCOMC__
|
||||
# if defined(__DOS__) || defined(__DOS4G__)
|
||||
# define DOS 7
|
||||
# endif
|
||||
# if defined(__OS2__) || defined(__OS2V2__)
|
||||
# define OS2 3
|
||||
# endif
|
||||
# if defined(__NT__)
|
||||
# ifndef WIN32
|
||||
# define WIN32
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
/* If it's not DOS, or OS/2, or Windows, it must be XCurses */
|
||||
|
||||
#if !defined(DOS) && !defined(OS2) && !defined(WIN32)
|
||||
# ifndef XCURSES
|
||||
# define XCURSES
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef PDC_WIDE
|
||||
# if !defined(CHTYPE_LONG) || !(defined(WIN32) || defined(XCURSES))
|
||||
# undef PDC_WIDE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h> /* Required by X/Open usage below */
|
||||
@@ -462,6 +266,9 @@ typedef struct _win /* definition of a window */
|
||||
struct _win *_parent; /* subwin's pointer to parent win */
|
||||
} WINDOW;
|
||||
|
||||
/* Avoid using the SCREEN struct directly -- use the corresponding
|
||||
functions if possible. This struct may eventually be made private. */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool alive; /* if initscr() called, and not endwin() */
|
||||
@@ -790,7 +597,7 @@ bits), 8 bits for other attributes, and 16 bits for character data.
|
||||
|
||||
#define COLOR_BLACK 0
|
||||
|
||||
#ifdef XCURSES /* RGB */
|
||||
#ifdef PDC_RGB /* RGB */
|
||||
# define COLOR_RED 1
|
||||
# define COLOR_GREEN 2
|
||||
# define COLOR_BLUE 4
|
||||
|
||||
@@ -297,5 +297,6 @@ The XCursesExit() function is now called automatically via atexit().
|
||||
(Multiple calls to it are OK, so you don't need to remove it if you've
|
||||
already added it for previous versions of PDCurses.)
|
||||
|
||||
It is no longer necessary to explicitly define XCURSES, except if
|
||||
building under Cygwin. (It's defined automatically.)
|
||||
XCURSES is no longer defined automatically, but need not be defined,
|
||||
unless you want the X11-specific prototypes. (Normal curses programs
|
||||
won't need it.)
|
||||
|
||||
Reference in New Issue
Block a user