Skip to content
Snippets Groups Projects
Commit 687d092c authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

We can't pollute the namespace with curses everywhere.

Just rename ESCDELAY member to escdelay.
parent 5b044471
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #1484 passed
......@@ -286,7 +286,7 @@ static int try_curses_init(int mode)
cio_api.setvideoflags=curs_setvideoflags;
cio_api.getvideoflags=curs_getvideoflags;
#if defined(NCURSES_VERSION_MAJOR) || defined (__NetBSD__)
cio_api.ESCDELAY=&ESCDELAY;
cio_api.escdelay=&ESCDELAY;
#endif
cio_api.setfont = curs_setfont;
cio_api.getfont = curs_getfont;
......@@ -319,7 +319,7 @@ static int try_ansi_init(int mode)
cio_api.setcursortype=ansi_setcursortype;
cio_api.getch=ansi_getch;
cio_api.textmode=ansi_textmode;
cio_api.ESCDELAY=&CIOLIB_ANSI_TIMEOUT;
cio_api.escdelay=&CIOLIB_ANSI_TIMEOUT;
cio_api.beep=ansi_beep;
cio_api.suspend=ansi_suspend;
return(1);
......
......@@ -41,16 +41,6 @@
#include "gen_defs.h"
#include "utf8_codepages.h"
#ifndef _WIN32
/* This is included because it seems openSUSE Leap-15.2 apparently contains this:
* #define ESCDELAY _nc_ESCDELAY.
* which means we need to not set the ESCDELAY member (because we can't), or we
* need to rename the member to _nc_ESCDELAY. Do the second because it's very
* *very* slightly less stupid.
*/
#include "curs_fix.h"
#endif
#ifdef CIOLIBEXPORT
#undef CIOLIBEXPORT
#endif
......@@ -379,7 +369,7 @@ typedef struct {
int (*getvideoflags) (void);
void (*setscaling) (int new_value);
int (*getscaling) (void);
int *ESCDELAY;
int *escdelay;
int (*setpalette) (uint32_t entry, uint16_t r, uint16_t g, uint16_t b);
int (*attr2palette) (uint8_t attr, uint32_t *fg, uint32_t *bg);
int (*setpixel) (uint32_t x, uint32_t y, uint32_t colour);
......
......@@ -101,7 +101,7 @@ static JSBool js_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
*vp=BOOLEAN_TO_JSVAL(cio_api.mouse);
break;
case PROP_ESCDELAY:
*vp=INT_TO_JSVAL(cio_api.ESCDELAY?*cio_api.ESCDELAY:0);
*vp=INT_TO_JSVAL(cio_api.escdelay?*cio_api.escdelay:0);
break;
case PROP_TEXTATTR:
*vp=INT_TO_JSVAL(cio_textinfo.attribute);
......@@ -185,8 +185,8 @@ static JSBool js_set(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval
JS_ValueToBoolean(cx, *vp, &puttext_can_move);
break;
case PROP_ESCDELAY:
if(cio_api.ESCDELAY) {
if(!JS_ValueToInt32(cx, *vp, (int32*)cio_api.ESCDELAY))
if(cio_api.escdelay) {
if(!JS_ValueToInt32(cx, *vp, (int32*)cio_api.escdelay))
return JS_FALSE;
}
break;
......
......@@ -359,8 +359,8 @@ int UIFCCALL uifcini32(uifcapi_t* uifcapi)
if(api->esc_delay < 10)
api->esc_delay=25;
if(cio_api.ESCDELAY)
*(cio_api.ESCDELAY)=api->esc_delay;
if(cio_api.escdelay)
*(cio_api.escdelay)=api->esc_delay;
for(i=0; i<MAX_BUFS; i++)
sav[i].buf=NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment