X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gnushogi%2Fdspwrappers.c;h=ebe0f052fe69241207f6ea4577013b74342263b6;hb=de68af0b286eb210b5a3fb4bf4deb44b1b7a727e;hp=382c43878bcb7a908958cb9e4e291b679ab238fe;hpb=3f589711eb3ecc7644378d6a0f2f29bc4b4c7db9;p=gnushogi.git diff --git a/gnushogi/dspwrappers.c b/gnushogi/dspwrappers.c index 382c438..ebe0f05 100644 --- a/gnushogi/dspwrappers.c +++ b/gnushogi/dspwrappers.c @@ -126,3 +126,32 @@ void RequestInputString(char* buffer, unsigned bufsize) } doRequestInputString(fmt, buffer); } + +/*********/ + +#define CASE_DSPFUNC_RAW(func,args) \ + case DISPLAY_RAW: \ + case DISPLAY_X: \ + return (func args); \ + break + +#ifdef HAVE_LIBCURSES +#define CASE_DSPFUNC_CURSES(func,args) \ + case DISPLAY_CURSES: \ + return (func args); \ + break; +#else +#define CASE_DSPFUNC_CURSES(func,args) +#endif + +#define DISPLAY_INTFUNC(func,argsdecl,args) \ + int func argsdecl \ + { \ + switch (display_type) { \ + CASE_DSPFUNC_RAW(Raw_ ## func, args); \ + CASE_DSPFUNC_CURSES(Curses_ ## func, args); \ + } \ + assert(0); \ + } + +DISPLAY_INTFUNC(GetString, (char* sx), (sx))