# HG changeset patch # User faust3 # Date 1063476140 0 # Node ID a2537e7d2d76ee077c140f8d35bc2f4359a2537a # Parent c2ec0a96101913d430c15266c9679825cc76eb06 make menu work on mingw (run command is still disabled), based on patch by Christophe Perinaud diff -r c2ec0a961019 -r a2537e7d2d76 libmenu/menu_console.c --- a/libmenu/menu_console.c Sat Sep 13 15:22:06 2003 +0000 +++ b/libmenu/menu_console.c Sat Sep 13 18:02:20 2003 +0000 @@ -7,7 +7,9 @@ #include #include #include +#ifndef __MINGW32__ #include +#endif #include #include @@ -223,6 +225,7 @@ } static void check_child(menu_t* menu) { +#ifndef __MINGW32__ fd_set rfd; struct timeval tv; int max_fd = mpriv->child_fd[2] > mpriv->child_fd[1] ? mpriv->child_fd[2] : @@ -268,12 +271,14 @@ w = 1; } } +#endif } #define close_pipe(pipe) close(pipe[0]); close(pipe[1]) static int run_shell_cmd(menu_t* menu, char* cmd) { +#ifndef __MINGW32__ int in[2],out[2],err[2]; printf("Console run %s ...\n",cmd); @@ -311,6 +316,7 @@ mpriv->child_fd[2] = err[0]; mpriv->prompt = mpriv->child_prompt; //add_line(mpriv,"Child process started"); +#endif return 1; } @@ -439,7 +445,7 @@ } -static int open(menu_t* menu, char* args) { +static int openMenu(menu_t* menu, char* args) { menu->draw = draw; @@ -469,5 +475,5 @@ &cfg_dflt, cfg_fields }, - open, + openMenu, }; diff -r c2ec0a961019 -r a2537e7d2d76 libmenu/menu_param.c --- a/libmenu/menu_param.c Sat Sep 13 15:22:06 2003 +0000 +++ b/libmenu/menu_param.c Sat Sep 13 18:02:20 2003 +0000 @@ -103,19 +103,19 @@ free(entry); } -static void close(menu_t* menu) { +static void closeMenu(menu_t* menu) { menu_list_uninit(menu,free_entry); if(mpriv->edit) free(mpriv->edit); } -static int open(menu_t* menu, char* args) { +static int openMenu(menu_t* menu, char* args) { list_entry_t* e; menu->draw = menu_list_draw; menu->read_cmd = menu_list_read_cmd; menu->read_key = read_key; - menu->close = close; + menu->close = closeMenu; if(!args) { @@ -155,5 +155,5 @@ &cfg_dflt, cfg_fields }, - open + openMenu };