]> git.lizzy.rs Git - dragonblocks_alpha.git/commitdiff
Use Windows-compatible linenoise
authorElias Fleckenstein <eliasfleckenstein@web.de>
Sun, 24 Apr 2022 15:48:19 +0000 (17:48 +0200)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Sun, 24 Apr 2022 15:48:19 +0000 (17:48 +0200)
.gitmodules
deps/linenoise
src/CMakeLists.txt
src/client/client_auth.c

index 6ced1b8ea5d67a45618e27d7d7443808d6ffac06..6404413c83f38c6672380d99e1ae2e956e2ad71e 100644 (file)
@@ -21,7 +21,7 @@
        url = https://github.com/dragonblocks/dragonnet
 [submodule "deps/linenoise"]
        path = deps/linenoise
-       url = https://github.com/antirez/linenoise
+       url = https://github.com/msteveb/linenoise
 [submodule "deps/protogen"]
        path = deps/protogen
        url = https://github.com/dragonblocks/protogen
index 97d2850af13c339369093b78abe5265845d78220..9430e6e4e7fc09e8ca6a2fd5e3fcafa07818542e 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 97d2850af13c339369093b78abe5265845d78220
+Subproject commit 9430e6e4e7fc09e8ca6a2fd5e3fcafa07818542e
index bb6123108aca7e5ac4cc4c3a442ca900691090e0..44f309419d891a31d124a6574d4aae7fce4c09f0 100644 (file)
@@ -29,7 +29,7 @@ endif()
 add_compile_definitions("USE_DRAGONNET")
 add_compile_definitions("RESSOURCE_PATH=\"${RESSOURCE_PATH}\"")
 
-add_compile_options(-Wall -Wextra -Werror -Wno-address-of-packed-member -fmax-errors=4)
+add_compile_options(-Wall -Wextra -Werror -Wno-address-of-packed-member -Wno-implicit-fallthrough -fmax-errors=4)
 
 link_libraries(
        pthread
@@ -73,6 +73,8 @@ set(COMMON_SOURCES
        "${DEPS_DIR}/dragonstd/tree.c"
        "${DEPS_DIR}/dragonstd/bits/compare.c"
        "${DEPS_DIR}/linenoise/linenoise.c"
+       "${DEPS_DIR}/linenoise/stringbuf.c"
+       "${DEPS_DIR}/linenoise/utf8.c"
        "${DEPS_DIR}/perlin/perlin.c"
        color.c
        config.c
index afa3ebde092363335bfc91a29aa5febad2efab58..b955cd5c7711196ed4ea03a97075ca9a9d2af14e 100644 (file)
@@ -15,7 +15,7 @@ static void auth_loop()
        while (!interrupt.set) switch (client_auth.state) {
                case AUTH_INIT:
                        if (client_auth.name)
-                               linenoiseFree(client_auth.name);
+                               free(client_auth.name);
 
                        if (!(client_auth.name = linenoise("Enter name: ")))
                                return;
@@ -64,5 +64,5 @@ void client_auth_deinit()
 {
        pthread_cond_destroy(&client_auth.cv);
        pthread_mutex_destroy(&client_auth.mtx);
-       linenoiseFree(client_auth.name);
+       free(client_auth.name);
 }