diff options
Diffstat (limited to 'scripts/kconfig/mconf.c')
-rw-r--r-- | scripts/kconfig/mconf.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 006d03708..d3ad12d90 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c | |||
@@ -12,8 +12,10 @@ | |||
12 | /* On Darwin, this may be needed to get SIGWINCH: */ | 12 | /* On Darwin, this may be needed to get SIGWINCH: */ |
13 | #define _DARWIN_C_SOURCE 1 | 13 | #define _DARWIN_C_SOURCE 1 |
14 | 14 | ||
15 | #ifndef __MINGW32__ | ||
15 | #include <sys/ioctl.h> | 16 | #include <sys/ioctl.h> |
16 | #include <sys/wait.h> | 17 | #include <sys/wait.h> |
18 | #endif | ||
17 | #include <ctype.h> | 19 | #include <ctype.h> |
18 | #include <errno.h> | 20 | #include <errno.h> |
19 | #include <fcntl.h> | 21 | #include <fcntl.h> |
@@ -23,7 +25,9 @@ | |||
23 | #include <stdlib.h> | 25 | #include <stdlib.h> |
24 | #include <string.h> | 26 | #include <string.h> |
25 | #include <strings.h> /* for strcasecmp */ | 27 | #include <strings.h> /* for strcasecmp */ |
28 | #ifndef __MINGW32__ | ||
26 | #include <termios.h> | 29 | #include <termios.h> |
30 | #endif | ||
27 | #include <unistd.h> | 31 | #include <unistd.h> |
28 | #include <locale.h> | 32 | #include <locale.h> |
29 | 33 | ||
@@ -266,11 +270,15 @@ static char input_buf[4096]; | |||
266 | static const char filename[] = ".config"; | 270 | static const char filename[] = ".config"; |
267 | static char *args[1024], **argptr = args; | 271 | static char *args[1024], **argptr = args; |
268 | static int indent; | 272 | static int indent; |
273 | #ifndef __MINGW32__ | ||
269 | static struct termios ios_org; | 274 | static struct termios ios_org; |
275 | #endif | ||
270 | static int rows = 0, cols = 0; | 276 | static int rows = 0, cols = 0; |
271 | static struct menu *current_menu; | 277 | static struct menu *current_menu; |
272 | static int child_count; | 278 | static int child_count; |
279 | #ifndef __MINGW32__ | ||
273 | static int do_resize; | 280 | static int do_resize; |
281 | #endif | ||
274 | static int single_menu_mode; | 282 | static int single_menu_mode; |
275 | 283 | ||
276 | static void conf(struct menu *menu); | 284 | static void conf(struct menu *menu); |
@@ -290,6 +298,9 @@ static int cprint(const char *fmt, ...); | |||
290 | 298 | ||
291 | static void init_wsize(void) | 299 | static void init_wsize(void) |
292 | { | 300 | { |
301 | #ifdef __MINGW32__ | ||
302 | fprintf(stderr, "Skipping attempt to change window size\n"); | ||
303 | #else | ||
293 | struct winsize ws; | 304 | struct winsize ws; |
294 | char *env; | 305 | char *env; |
295 | 306 | ||
@@ -321,6 +332,7 @@ static void init_wsize(void) | |||
321 | 332 | ||
322 | rows -= 4; | 333 | rows -= 4; |
323 | cols -= 5; | 334 | cols -= 5; |
335 | #endif | ||
324 | } | 336 | } |
325 | 337 | ||
326 | static void cprint_init(void) | 338 | static void cprint_init(void) |
@@ -457,6 +469,10 @@ static void winch_handler(int sig) | |||
457 | 469 | ||
458 | static int exec_conf(void) | 470 | static int exec_conf(void) |
459 | { | 471 | { |
472 | #ifdef __MINGW32__ | ||
473 | fprintf(stderr, "exec_conf not implemented\n"); | ||
474 | exit(1); | ||
475 | #else | ||
460 | int pipefd[2], stat, size; | 476 | int pipefd[2], stat, size; |
461 | sigset_t sset, osset; | 477 | sigset_t sset, osset; |
462 | 478 | ||
@@ -530,6 +546,7 @@ static int exec_conf(void) | |||
530 | sigprocmask(SIG_SETMASK, &osset, NULL); | 546 | sigprocmask(SIG_SETMASK, &osset, NULL); |
531 | 547 | ||
532 | return WEXITSTATUS(stat); | 548 | return WEXITSTATUS(stat); |
549 | #endif | ||
533 | } | 550 | } |
534 | 551 | ||
535 | static void search_conf(void) | 552 | static void search_conf(void) |
@@ -783,7 +800,7 @@ static void conf(struct menu *menu) | |||
783 | switch (type) { | 800 | switch (type) { |
784 | case 'm': | 801 | case 'm': |
785 | if (single_menu_mode) | 802 | if (single_menu_mode) |
786 | submenu->data = (void *) (long) !submenu->data; | 803 | submenu->data = (void *) (intptr_t) !submenu->data; |
787 | else | 804 | else |
788 | conf(submenu); | 805 | conf(submenu); |
789 | break; | 806 | break; |
@@ -1044,7 +1061,9 @@ static void conf_save(void) | |||
1044 | 1061 | ||
1045 | static void conf_cleanup(void) | 1062 | static void conf_cleanup(void) |
1046 | { | 1063 | { |
1064 | #ifndef __MINGW32__ | ||
1047 | tcsetattr(1, TCSAFLUSH, &ios_org); | 1065 | tcsetattr(1, TCSAFLUSH, &ios_org); |
1066 | #endif | ||
1048 | unlink(".help.tmp"); | 1067 | unlink(".help.tmp"); |
1049 | unlink("lxdialog.scrltmp"); | 1068 | unlink("lxdialog.scrltmp"); |
1050 | } | 1069 | } |
@@ -1073,7 +1092,9 @@ int main(int ac, char **av) | |||
1073 | single_menu_mode = 1; | 1092 | single_menu_mode = 1; |
1074 | } | 1093 | } |
1075 | 1094 | ||
1095 | #ifndef __MINGW32__ | ||
1076 | tcgetattr(1, &ios_org); | 1096 | tcgetattr(1, &ios_org); |
1097 | #endif | ||
1077 | atexit(conf_cleanup); | 1098 | atexit(conf_cleanup); |
1078 | init_wsize(); | 1099 | init_wsize(); |
1079 | conf(&rootmenu); | 1100 | conf(&rootmenu); |