From aa30d516455051dca125e39b84f47b0923cc16e3 Mon Sep 17 00:00:00 2001 From: William McBrine Date: Sun, 26 Mar 2006 01:48:55 +0000 Subject: [PATCH] "if defined", "if !defined", "ifdef" and "ifndef" were used inconsistently. The new rule is: Use the shorter form wherever possible. --- curspriv.h | 10 +++++----- demos/testcurs.c | 8 ++++---- demos/tuidemo.c | 4 ++-- dos/pdckbd.c | 4 ++-- os2/pdcclip.c | 16 ++++++++-------- os2/pdcgetsc.c | 6 +++--- os2/pdckbd.c | 8 ++++---- os2/pdcscrn.c | 14 +++++++------- os2/pdcsetsc.c | 4 ++-- pdcurses/beep.c | 10 ++++------ pdcurses/color.c | 4 ++-- pdcurses/initscr.c | 12 ++++++------ pdcurses/kernel.c | 24 ++++++++++++------------ pdcurses/pdcutil.c | 4 ++-- term.h | 6 +++--- win32/pdckbd.c | 20 ++++++++++---------- win32/pdcscrn.c | 12 ++++++------ x11/pdcx11.h | 4 ++-- 18 files changed, 84 insertions(+), 86 deletions(-) diff --git a/curspriv.h b/curspriv.h index 99eec008..1c382bf8 100644 --- a/curspriv.h +++ b/curspriv.h @@ -15,7 +15,7 @@ * See the file maintain.er for details of the current maintainer. * ************************************************************************/ -/* $Id: curspriv.h,v 1.49 2006/03/25 23:57:40 wmcbrine Exp $ */ +/* $Id: curspriv.h,v 1.50 2006/03/26 01:48:44 wmcbrine Exp $ */ /* CURSPRIV.H @@ -79,7 +79,7 @@ # ifdef __TURBOC__ # define _FAR_POINTER(s,o) MK_FP(s,o) # else -# if defined(NDP) +# ifdef NDP # define _FAR_POINTER(s,o) ((((int)(s)) << 4) + ((int)(o))) # else # if defined(WATCOMC) && defined(__FLAT__) @@ -275,7 +275,7 @@ int PDC_query_adapter_type(void); void PDC_doupdate(void); #endif -#if defined(XCURSES) +#ifdef XCURSES int XCurses_display_cursor(int, int, int, int, int); int XCurses_rawgetch(int); bool XCurses_kbhit(void); @@ -311,7 +311,7 @@ void PDC_debug(const char *, ...); #define PDC_COLORS 8 /* Internal macros for attributes */ -#if defined(CHTYPE_LONG) +#ifdef CHTYPE_LONG # define PDC_COLOR_PAIRS 64 # define PDC_OFFSET 32 # define chtype_attr(ch) (atrtab[((ch >> PDC_ATTR_SHIFT) & 0xFFFF)] << 8) @@ -348,7 +348,7 @@ void PDC_debug(const char *, ...); #define TEMP_BUTTON_CHANGED(x) (Temp_Mouse_status.changes & (1 << ((x) - 1))) #define TEMP_BUTTON_STATUS(x) (Temp_Mouse_status.button[(x) - 1]) -#if defined(XCURSES) +#ifdef XCURSES #define CURSES_EXIT 999999 #define CURSES_REFRESH 999998 #define CURSES_CHILD 999997 diff --git a/demos/testcurs.c b/demos/testcurs.c index 12ed8e5e..fd7833e4 100644 --- a/demos/testcurs.c +++ b/demos/testcurs.c @@ -10,7 +10,7 @@ #ifdef PDCDEBUG # define CURSES_LIBRARY /* needed for the prototype of PDC_debug */ const char *rcsid_testcurs = - "$Id: testcurs.c,v 1.42 2006/03/25 12:20:20 wmcbrine Exp $"; + "$Id: testcurs.c,v 1.43 2006/03/26 01:48:47 wmcbrine Exp $"; #endif #include @@ -334,7 +334,7 @@ void inputTest(WINDOW *win) wtimeout(win, 200); -#if defined(PDCURSES) +#ifdef PDCURSES mouse_set(ALL_MOUSE_EVENTS); PDC_save_key_modifiers(TRUE); PDC_return_key_modifiers(TRUE); @@ -370,7 +370,7 @@ void inputTest(WINDOW *win) else wprintw(win, "Key Pressed: %s", unctrl(c)); -#if defined(PDCURSES) +#ifdef PDCURSES if (PDC_get_key_modifiers()) { waddstr(win, " Modifier(s):"); @@ -450,7 +450,7 @@ void inputTest(WINDOW *win) wtimeout(win, -1); /* turn off timeout() */ curs_set(1); /* turn cursor back on */ -#if defined(PDCURSES) +#ifdef PDCURSES mouse_set(0L); PDC_save_key_modifiers(FALSE); PDC_return_key_modifiers(FALSE); diff --git a/demos/tuidemo.c b/demos/tuidemo.c index d7083f0f..c3d1f207 100644 --- a/demos/tuidemo.c +++ b/demos/tuidemo.c @@ -22,10 +22,10 @@ #ifdef PDCDEBUG const char *rcsid_tuidemo = - "$Id: tuidemo.c,v 1.12 2006/02/16 21:51:30 wmcbrine Exp $"; + "$Id: tuidemo.c,v 1.13 2006/03/26 01:48:47 wmcbrine Exp $"; #endif -#if defined(XCURSES) +#ifdef XCURSES # define FNAME "demos/tui.c" /* change this if source at other location */ #else # define FNAME "demos\\tui.c" /* change this if source at other location */ diff --git a/dos/pdckbd.c b/dos/pdckbd.c index 54d1365e..b5a00680 100644 --- a/dos/pdckbd.c +++ b/dos/pdckbd.c @@ -26,7 +26,7 @@ #ifdef PDCDEBUG const char *rcsid_PDCkbd = - "$Id: pdckbd.c,v 1.20 2006/02/23 01:46:52 wmcbrine Exp $"; + "$Id: pdckbd.c,v 1.21 2006/03/26 01:48:48 wmcbrine Exp $"; #endif /************************************************************************ @@ -79,7 +79,7 @@ static int kptab[] = 0x89, KEY_F(35), 0x8a, KEY_F(36), 0x8b, KEY_F(47), 0x8c, KEY_F(48), 0x03, 0, /* NULL */ -#if defined(NUMKEYPAD) +#ifdef NUMKEYPAD 0xff, (int)'/', 0x0d, (int)'\n', 0xfa, (int)'*', 0xfd, (int)'-', 0xfb, (int)'+', #else diff --git a/os2/pdcclip.c b/os2/pdcclip.c index 0394e246..eff50fd0 100644 --- a/os2/pdcclip.c +++ b/os2/pdcclip.c @@ -16,7 +16,7 @@ ************************************************************************/ #define CURSES_LIBRARY 1 -#if !defined(EMXVIDEO) +#ifndef EMXVIDEO # define INCL_DOS # define INCL_WIN #endif @@ -26,7 +26,7 @@ #ifdef PDCDEBUG const char *rcsid_PDCclip = - "$Id: pdcclip.c,v 1.18 2006/02/27 08:13:03 wmcbrine Exp $"; + "$Id: pdcclip.c,v 1.19 2006/03/26 01:48:49 wmcbrine Exp $"; #endif /*man-start************************************************************** @@ -58,7 +58,7 @@ const char *rcsid_PDCclip = int PDC_getclipboard(char **contents, long *length) { -#if !defined(EMXVIDEO) +#ifndef EMXVIDEO HMQ hmq; HAB hab; PTIB ptib; @@ -69,7 +69,7 @@ int PDC_getclipboard(char **contents, long *length) #endif PDC_LOG(("PDC_getclipboard() - called\n")); -#if !defined(EMXVIDEO) +#ifndef EMXVIDEO DosGetInfoBlocks(&ptib, &ppib); ppib->pib_ultype = 3; hab = WinInitialize(0); @@ -134,7 +134,7 @@ int PDC_getclipboard(char **contents, long *length) int PDC_setclipboard(const char *contents, long length) { -#if !defined(EMXVIDEO) +#ifndef EMXVIDEO HAB hab; PTIB ptib; PPIB ppib; @@ -144,7 +144,7 @@ int PDC_setclipboard(const char *contents, long length) #endif PDC_LOG(("PDC_setclipboard() - called\n")); -#if !defined(EMXVIDEO) +#ifndef EMXVIDEO DosGetInfoBlocks(&ptib, &ppib); ppib->pib_ultype = 3; hab = WinInitialize(0); @@ -231,14 +231,14 @@ int PDC_freeclipboard(char *contents) int PDC_clearclipboard(void) { -#if !defined(EMXVIDEO) +#ifndef EMXVIDEO HAB hab; PTIB ptib; PPIB ppib; #endif PDC_LOG(("PDC_clearclipboard() - called\n")); -#if !defined(EMXVIDEO) +#ifndef EMXVIDEO DosGetInfoBlocks(&ptib, &ppib); ppib->pib_ultype = 3; hab = WinInitialize(0); diff --git a/os2/pdcgetsc.c b/os2/pdcgetsc.c index f619773b..52c7f017 100644 --- a/os2/pdcgetsc.c +++ b/os2/pdcgetsc.c @@ -21,7 +21,7 @@ #ifdef PDCDEBUG const char *rcsid_PDCgetsc = - "$Id: pdcgetsc.c,v 1.18 2006/02/23 01:46:52 wmcbrine Exp $"; + "$Id: pdcgetsc.c,v 1.19 2006/03/26 01:48:49 wmcbrine Exp $"; #endif /*man-start************************************************************** @@ -383,7 +383,7 @@ int PDC_get_rows(void) **man-end****************************************************************/ -#if defined(EMXVIDEO) +#ifdef EMXVIDEO int PDC_get_scrn_mode(void) #else int PDC_get_scrn_mode(VIOMODEINFO *modeinfo) @@ -423,7 +423,7 @@ int PDC_get_scrn_mode(VIOMODEINFO *modeinfo) **man-end****************************************************************/ -#if defined(EMXVIDEO) +#ifdef EMXVIDEO int PDC_query_adapter_type(void) #else int PDC_query_adapter_type(VIOCONFIGINFO *configinfo) diff --git a/os2/pdckbd.c b/os2/pdckbd.c index 4999a1ee..9adb3e67 100644 --- a/os2/pdckbd.c +++ b/os2/pdckbd.c @@ -28,7 +28,7 @@ #ifdef PDCDEBUG const char *rcsid_PDCkbd = - "$Id: pdckbd.c,v 1.19 2006/02/23 01:46:52 wmcbrine Exp $"; + "$Id: pdckbd.c,v 1.20 2006/03/26 01:48:49 wmcbrine Exp $"; #endif /************************************************************************ @@ -81,7 +81,7 @@ static int kptab[] = 0x89, KEY_F(35), 0x8a, KEY_F(36), 0x8b, KEY_F(47), 0x8c, KEY_F(48), 0x03, 0, /* NULL */ -#if defined(NUMKEYPAD) +#ifdef NUMKEYPAD 0xff, (int)'/', 0x0d, (int)'\n', 0xfa, (int)'*', 0xfd, (int)'-', 0xfb, (int)'+', #else @@ -251,7 +251,7 @@ bool PDC_check_bios_key(void) return (SP->tahead != -1); #else -# if !defined(MSC) +# ifndef MSC KbdPeek(&keyInfo, 0); /* peek at keyboard */ return (keyInfo.fbStatus != 0); # else @@ -409,7 +409,7 @@ int PDC_get_bios_key(void) bool PDC_get_ctrl_break(void) { #if defined(CURSES__32BIT__) || defined(CSET2) || defined(TC) -# if defined(TC) +# ifdef TC void __cdecl (*oldAction) (int); # else void (*oldAction) (int); diff --git a/os2/pdcscrn.c b/os2/pdcscrn.c index 9cf7da2e..3f3fb2ca 100644 --- a/os2/pdcscrn.c +++ b/os2/pdcscrn.c @@ -22,7 +22,7 @@ #ifdef PDCDEBUG const char *rcsid_PDCscrn = - "$Id: pdcscrn.c,v 1.21 2006/03/26 01:17:06 wmcbrine Exp $"; + "$Id: pdcscrn.c,v 1.22 2006/03/26 01:48:49 wmcbrine Exp $"; #endif #ifdef EMXVIDEO @@ -105,7 +105,7 @@ int PDC_scr_close(void) **man-end****************************************************************/ -#if !defined(EMXVIDEO) +#ifndef EMXVIDEO bool PDC_scrn_modes_equal(VIOMODEINFO mode1, VIOMODEINFO mode2) #else bool PDC_scrn_modes_equal(int mode1, int mode2) @@ -113,7 +113,7 @@ bool PDC_scrn_modes_equal(int mode1, int mode2) { PDC_LOG(("PDC_scrn_modes_equal() - called\n")); -#if !defined(EMXVIDEO) +#ifndef EMXVIDEO return ((mode1.cb == mode2.cb) && (mode1.fbType == mode2.fbType) && (mode1.color == mode2.color) && (mode1.col == mode2.col) && (mode1.row == mode2.row) && (mode1.hres == mode2.vres) @@ -145,7 +145,7 @@ bool PDC_scrn_modes_equal(int mode1, int mode2) int PDC_scr_open(SCREEN *internal, bool echo) { char *ptr; -#if !defined(EMXVIDEO) +#ifndef EMXVIDEO USHORT totchars; #endif @@ -167,11 +167,11 @@ int PDC_scr_open(SCREEN *internal, bool echo) internal->echo = echo; internal->visible_cursor = TRUE; /* Assume that it is visible */ internal->cursor = PDC_get_cursor_mode(); -#if defined(EMXVIDEO) +#ifdef EMXVIDEO internal->tahead = -1; #endif -#if !defined(EMXVIDEO) +#ifndef EMXVIDEO PDC_query_adapter_type(&internal->adapter); PDC_get_scrn_mode(&internal->scrnmode); PDC_get_keyboard_info(&internal->kbdinfo); @@ -298,7 +298,7 @@ int PDC_resize_screen(int nlines, int ncols) #endif } -#if !defined(EMXVIDEO) +#ifndef EMXVIDEO int PDC_reset_shell_mode(void) { diff --git a/os2/pdcsetsc.c b/os2/pdcsetsc.c index c354409e..72d595b8 100644 --- a/os2/pdcsetsc.c +++ b/os2/pdcsetsc.c @@ -21,7 +21,7 @@ #ifdef PDCDEBUG const char *rcsid_PDCsetsc = - "$Id: pdcsetsc.c,v 1.17 2006/02/27 07:28:32 wmcbrine Exp $"; + "$Id: pdcsetsc.c,v 1.18 2006/03/26 01:48:49 wmcbrine Exp $"; #endif /*man-start************************************************************** @@ -233,7 +233,7 @@ int PDC_set_rows(int rows) **man-end****************************************************************/ -#if !defined(EMXVIDEO) +#ifndef EMXVIDEO int PDC_set_scrn_mode(VIOMODEINFO new_mode) #else int PDC_set_scrn_mode(int new_mode) diff --git a/pdcurses/beep.c b/pdcurses/beep.c index 8e34e3cc..50c0389a 100644 --- a/pdcurses/beep.c +++ b/pdcurses/beep.c @@ -29,7 +29,7 @@ #ifdef PDCDEBUG const char *rcsid_beep = - "$Id: beep.c,v 1.17 2006/02/23 01:46:52 wmcbrine Exp $"; + "$Id: beep.c,v 1.18 2006/03/26 01:48:52 wmcbrine Exp $"; #endif /*man-start************************************************************** @@ -81,15 +81,13 @@ int flash(void) { PDC_LOG(("flash() - called\n")); -#if defined(DOS) || defined(OS2) || defined(WIN32) +#ifdef XCURSES + XCursesInstructAndWait(CURSES_FLASH); +#else PDC_scroll(0, 0, LINES - 1, COLS - 1, 0, A_NORMAL); napms(50); PDC_scroll(0, 0, LINES - 1, COLS - 1, 0, A_REVERSE); wrefresh(curscr); #endif - -#if defined(XCURSES) - XCursesInstructAndWait(CURSES_FLASH); -#endif return OK; } diff --git a/pdcurses/color.c b/pdcurses/color.c index c457bb72..2c0f41e7 100644 --- a/pdcurses/color.c +++ b/pdcurses/color.c @@ -36,7 +36,7 @@ static void PDC_init_pair(short, short, short); #ifdef PDCDEBUG const char *rcsid_color = - "$Id: color.c,v 1.43 2006/02/28 02:04:57 wmcbrine Exp $"; + "$Id: color.c,v 1.44 2006/03/26 01:48:52 wmcbrine Exp $"; #endif /*man-start************************************************************** @@ -124,7 +124,7 @@ static bool colorstarted = FALSE; /* COLOR_PAIR to attribute encoding table. */ -#if defined(XCURSES) +#ifdef XCURSES unsigned char *atrtab = NULL; #else unsigned char atrtab[MAX_ATRTAB]; diff --git a/pdcurses/initscr.c b/pdcurses/initscr.c index dd6810f8..b811a63a 100644 --- a/pdcurses/initscr.c +++ b/pdcurses/initscr.c @@ -43,7 +43,7 @@ #ifdef PDCDEBUG const char *rcsid_initscr = - "$Id: initscr.c,v 1.39 2006/02/28 02:09:15 wmcbrine Exp $"; + "$Id: initscr.c,v 1.40 2006/03/26 01:48:52 wmcbrine Exp $"; #endif const char *_curses_notice = "PDCurses 2.8 - Public Domain 2006"; @@ -60,7 +60,7 @@ MOUSE_STATUS Mouse_status; int use_emalloc = FALSE; -#if defined DOS +#ifdef DOS Regs regs; #endif @@ -86,7 +86,7 @@ extern void *ecalloc(size_t, size_t); /* user's ecalloc(num, size) */ extern void efree(void *); /* user's efree(ptr) */ #endif -#if !defined(XCURSES) +#ifndef XCURSES extern void *malloc(size_t); /* runtime's malloc(size) */ extern void *calloc(size_t, size_t); /* runtime's calloc(num, size) */ extern void free(void *); /* runtime's free(ptr) */ @@ -215,12 +215,12 @@ WINDOW *Xinitscr(int argc, char *argv[]) reallc = realloc; } -#if defined (XCURSES) +#ifdef XCURSES if (XCursesInitscr(NULL, argc, argv) == ERR) exit(7); #endif -#if defined (XCURSES) +#ifdef XCURSES if (SP == (SCREEN*)NULL) /* SP already attached in XCursesInitscr() */ #else if ((SP = (SCREEN*)callc(1, sizeof(SCREEN))) == (SCREEN*)NULL) @@ -346,7 +346,7 @@ int endwin(void) /* Position cursor to the bottom left of the screen. */ -#if defined(WIN32) +#ifdef WIN32 PDC_gotoxy(PDC_get_buffer_rows() - 2, 0); #else PDC_gotoxy(PDC_get_rows() - 2, 0); diff --git a/pdcurses/kernel.c b/pdcurses/kernel.c index 6caf3c7f..76139dd8 100644 --- a/pdcurses/kernel.c +++ b/pdcurses/kernel.c @@ -19,7 +19,7 @@ #ifdef HAVE_CONFIG_H # include #endif -#if !defined(XCURSES) +#ifndef XCURSES # define INCLUDE_WINDOWS_H #endif #include @@ -71,7 +71,7 @@ #ifdef PDCDEBUG const char *rcsid_kernel = - "$Id: kernel.c,v 1.37 2006/03/25 01:37:35 wmcbrine Exp $"; + "$Id: kernel.c,v 1.38 2006/03/26 01:48:52 wmcbrine Exp $"; #endif RIPPEDOFFLINE linesripped[5]; @@ -231,9 +231,9 @@ int reset_prog_mode(void) SP->font = PDC_get_font(); PDC_set_font(c_pr_tty.saved.font); -#if !defined(XCURSES) -# if !defined(EMXVIDEO) -# if defined(OS2) +#ifndef XCURSES +# ifndef EMXVIDEO +# ifdef OS2 PDC_get_scrn_mode(&modeInfo); if (!PDC_scrn_modes_equal(modeInfo, c_pr_tty.saved.scrnmode)) @@ -280,9 +280,9 @@ int reset_shell_mode(void) SP->font = PDC_get_font(); PDC_set_font(c_sh_tty.saved.font); -#if !defined(XCURSES) -# if !defined(EMXVIDEO) -# if defined(OS2) +#ifndef XCURSES +# ifndef EMXVIDEO +# ifdef OS2 PDC_get_scrn_mode(&modeInfo); if (!PDC_scrn_modes_equal(modeInfo, c_sh_tty.saved.scrnmode)) @@ -295,7 +295,7 @@ int reset_shell_mode(void) # endif #endif -# if defined(OS2) +# ifdef OS2 PDC_resize_screen(c_sh_tty.saved.lines, c_sh_tty.saved.cols); # else PDC_set_rows(c_sh_tty.saved.lines); @@ -333,9 +333,9 @@ int resetty(void) SP->font = PDC_get_font(); PDC_set_font(c_save_tty.saved.font); -#if !defined(XCURSES) -# if !defined(EMXVIDEO) -# if defined(OS2) +#ifndef XCURSES +# ifndef EMXVIDEO +# ifdef OS2 PDC_get_scrn_mode(&modeInfo); if (!PDC_scrn_modes_equal(modeInfo, c_save_tty.saved.scrnmode)) diff --git a/pdcurses/pdcutil.c b/pdcurses/pdcutil.c index 40c1d4bf..20dab74e 100644 --- a/pdcurses/pdcutil.c +++ b/pdcurses/pdcutil.c @@ -19,14 +19,14 @@ #ifdef HAVE_CONFIG_H # include #endif -#if !defined(XCURSES) +#ifndef XCURSES # define INCLUDE_WINDOWS_H #endif #include #ifdef PDCDEBUG const char *rcsid_PDCutil = - "$Id: pdcutil.c,v 1.29 2006/03/20 17:30:31 wmcbrine Exp $"; + "$Id: pdcutil.c,v 1.30 2006/03/26 01:48:52 wmcbrine Exp $"; #endif void PDC_beep(void) diff --git a/term.h b/term.h index 6c58e7da..13a79ca8 100644 --- a/term.h +++ b/term.h @@ -15,7 +15,7 @@ * See the file maintain.er for details of the current maintainer. * ************************************************************************/ -/* $Id: term.h,v 1.10 2006/02/27 09:20:16 wmcbrine Exp $ */ +/* $Id: term.h,v 1.11 2006/03/26 01:48:46 wmcbrine Exp $ */ /* PDCurses doesn't operate with terminfo, but we need these functions for compatibility, to allow some things (notably, interface libraries for @@ -37,8 +37,8 @@ typedef struct const char *_termname; } TERMINAL; -#if defined(PDC_DLL_BUILD) -# if !defined(CURSES_LIBRARY) +#ifdef PDC_DLL_BUILD +# ifndef CURSES_LIBRARY __declspec(dllimport) TERMINAL *cur_term; # else __declspec(dllexport) extern TERMINAL *cur_term; diff --git a/win32/pdckbd.c b/win32/pdckbd.c index c13e5000..ebf83dd9 100644 --- a/win32/pdckbd.c +++ b/win32/pdckbd.c @@ -21,7 +21,7 @@ #ifdef PDCDEBUG const char *rcsid_PDCkbd = - "$Id: pdckbd.c,v 1.40 2006/03/25 04:11:21 wmcbrine Exp $"; + "$Id: pdckbd.c,v 1.41 2006/03/26 01:48:53 wmcbrine Exp $"; #endif #define KEY_STATE TRUE @@ -58,7 +58,7 @@ static unsigned long pdc_key_modifiers = 0L; extern HANDLE hConIn; -#if defined(PDC_THREAD_BUILD) +#ifdef PDC_THREAD_BUILD extern HANDLE hPipeRead; extern HANDLE hPipeWrite; extern HANDLE hSemKeyCount; @@ -360,7 +360,7 @@ unsigned long PDC_get_input_fd(void) { PDC_LOG(("PDC_get_input_fd() - called\n")); -#if defined(PDC_THREAD_BUILD) +#ifdef PDC_THREAD_BUILD return (unsigned long)hSemKeyCount; #else return 0L; @@ -1053,12 +1053,12 @@ static int GetInterestingEvent(INPUT_RECORD *ip) static unsigned numpadChar = 0; #ifdef PDCDEBUG -#if defined(PDC_THREAD_BUILD) -# define PDC_DEBUG_THREADING1 "-->" -# define PDC_DEBUG_THREADING2 "THREADING" +# ifdef PDC_THREAD_BUILD +# define PDC_DEBUG_THREADING1 "-->" +# define PDC_DEBUG_THREADING2 "THREADING" # else -# define PDC_DEBUG_THREADING1 "" -# define PDC_DEBUG_THREADING2 "" +# define PDC_DEBUG_THREADING1 "" +# define PDC_DEBUG_THREADING2 "" # endif char *ptr = ""; @@ -1269,7 +1269,7 @@ static int GetInterestingEvent(INPUT_RECORD *ip) return numKeys; } -#if defined(PDC_THREAD_BUILD) +#ifdef PDC_THREAD_BUILD static int win32_kbhit(int timeout) { @@ -1388,7 +1388,7 @@ unsigned long PDC_get_key_modifiers(void) return pdc_key_modifiers; } -#if defined(PDC_THREAD_BUILD) +#ifdef PDC_THREAD_BUILD LONG InputThread(LPVOID lpThreadData) { diff --git a/win32/pdcscrn.c b/win32/pdcscrn.c index 3f2d0231..0c26124f 100644 --- a/win32/pdcscrn.c +++ b/win32/pdcscrn.c @@ -21,7 +21,7 @@ #ifdef PDCDEBUG const char *rcsid_PDCscrn = - "$Id: pdcscrn.c,v 1.30 2006/03/26 01:17:11 wmcbrine Exp $"; + "$Id: pdcscrn.c,v 1.31 2006/03/26 01:48:53 wmcbrine Exp $"; #endif #define PDC_RESTORE_NONE 0 @@ -30,7 +30,7 @@ const char *rcsid_PDCscrn = HANDLE hConOut = INVALID_HANDLE_VALUE; HANDLE hConIn = INVALID_HANDLE_VALUE; -#if defined(PDC_THREAD_BUILD) +#ifdef PDC_THREAD_BUILD HANDLE hPipeRead = INVALID_HANDLE_VALUE; HANDLE hPipeWrite = INVALID_HANDLE_VALUE; HANDLE hSemKeyCount = INVALID_HANDLE_VALUE; @@ -103,7 +103,7 @@ int PDC_scr_close(void) SetConsoleActiveScreenBuffer(hConOut); SetConsoleMode(hConIn, dwConsoleMode); -#if defined(PDC_THREAD_BUILD) +#ifdef PDC_THREAD_BUILD if (hPipeRead != INVALID_HANDLE_VALUE) CloseHandle(hPipeRead); @@ -168,7 +168,7 @@ int PDC_scr_open(SCREEN *internal, bool echo) const char *str; CONSOLE_SCREEN_BUFFER_INFO csbi; -#if defined(PDC_THREAD_BUILD) +#ifdef PDC_THREAD_BUILD HANDLE hThread; DWORD dwThreadID; #endif @@ -331,7 +331,7 @@ int PDC_scr_open(SCREEN *internal, bool echo) internal->linesrippedoffontop = 0; internal->delaytenths = 0; -#if defined(PDC_THREAD_BUILD) +#ifdef PDC_THREAD_BUILD /* Create the anonymous pipe and thread for handling input */ @@ -575,7 +575,7 @@ int PDC_reset_shell_mode(void) return OK; } -#if defined(PDC_DLL_BUILD) +#ifdef PDC_DLL_BUILD BOOL WINAPI DllMain(HINSTANCE hDLL, DWORD dwReason, LPVOID pReserved) { diff --git a/x11/pdcx11.h b/x11/pdcx11.h index e19950ff..03622a5e 100644 --- a/x11/pdcx11.h +++ b/x11/pdcx11.h @@ -3,7 +3,7 @@ * Hessling 1994-1999. M.Hessling@qut.edu.au * ************************************************************************/ -/* $Id: pdcx11.h,v 1.25 2006/03/25 10:37:17 wmcbrine Exp $ */ +/* $Id: pdcx11.h,v 1.26 2006/03/26 01:48:55 wmcbrine Exp $ */ #define CURSES_LIBRARY 1 #ifdef HAVE_CONFIG_H @@ -29,7 +29,7 @@ #include #include -#if !defined(XPOINTER_TYPEDEFED) +#ifndef XPOINTER_TYPEDEFED typedef char * XPointer; #endif