Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tooks/kconfig: Win32 build (GIT8266O-816) #1239

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tools/kconfig/confdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,10 @@ int conf_write(const char *name)
if (*tmpname) {
strcat(dirname, basename);
strcat(dirname, ".old");
#ifdef WIN32
// On Windows rename() fails if a file exists
unlink(dirname);
#endif
rename(newname, dirname);
if (rename(tmpname, newname))
return 1;
Expand Down
11 changes: 11 additions & 0 deletions tools/kconfig/lxdialog/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,17 @@ int on_key_esc(WINDOW *win)
nodelay(win, TRUE);
keypad(win, FALSE);
key = wgetch(win);
#ifdef WIN32
/*
* On Windowa ncurses uses terminal driver, which reads keys directly
* from Windows API, so it doesn't have to recognize ESC sequences and
* buffer the first ESC as a consequence. ESC is emitted instantly to
* an application, so second nodelay read will return ERR.
* Yes, there's no need to press Esc twice.
*/
if (key == ERR)
return KEY_ESC;
#endif
key2 = wgetch(win);
do {
key3 = wgetch(win);
Expand Down
4 changes: 4 additions & 0 deletions tools/kconfig/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
#include <stdlib.h>
#include <string.h>
#include <regex.h>
#ifndef _WIN32
#include <sys/utsname.h>
#endif

#include "lkc.h"

Expand Down Expand Up @@ -44,6 +46,7 @@ static void sym_add_default(struct symbol *sym, const char *def)

void sym_init(void)
{
#ifndef _WIN32
struct symbol *sym;
struct utsname uts;
static bool inited = false;
Expand All @@ -58,6 +61,7 @@ void sym_init(void)
sym->type = S_STRING;
sym->flags |= SYMBOL_AUTO;
sym_add_default(sym, uts.release);
#endif
}

enum symbol_type sym_get_type(struct symbol *sym)
Expand Down