Skip to content

Commit

Permalink
Fix R15 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtj committed Jan 28, 2012
1 parent 515baab commit 7dd32be
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions c_src/cecho.c
Expand Up @@ -25,6 +25,11 @@
#include "ncurses.h"
#include "assert.h"

#if ERL_DRV_EXTENDED_MAJOR_VERSION < 2
#define ErlDrvSizeT int
#define ErlDrvSSizeT int
#endif

// State structure
typedef struct {
WINDOW *win[_MAXWINDOWS+1];
Expand Down Expand Up @@ -118,8 +123,9 @@ static void do_getch(ErlDrvData drvstate, ErlDrvEvent event) {
driver_output(st->drv_port, eixb.buff, eixb.index);
}

static int control(ErlDrvData drvstate, unsigned int command, char *args,
int argslen, char **rbuf, int rbuflen) {
static ErlDrvSSizeT control(ErlDrvData drvstate, unsigned int command,
char *args, ErlDrvSizeT argslen,
char **rbuf, ErlDrvSizeT rbuflen) {
state *st = (state *)drvstate;
init_state(st, args, argslen);

Expand Down Expand Up @@ -568,7 +574,15 @@ ErlDrvEntry driver_entry = {
NULL,
NULL,
control,
NULL
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
ERL_DRV_EXTENDED_MARKER,
ERL_DRV_EXTENDED_MAJOR_VERSION,
ERL_DRV_EXTENDED_MINOR_VERSION
};

// =============================================================================
Expand Down

0 comments on commit 7dd32be

Please sign in to comment.