From f83487869de063b606c4acfa57d21d6f1df009b1 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Wed, 10 Apr 2024 13:20:04 +0200 Subject: [PATCH] tool/xkb2ifcfg: adapt to current Genode version Thanks Florian for the nudge. --- tool/xkb2ifcfg/Makefile | 14 +++++++------ tool/xkb2ifcfg/genode.cc | 43 ---------------------------------------- tool/xkb2ifcfg/main.cc | 2 +- 3 files changed, 9 insertions(+), 50 deletions(-) delete mode 100644 tool/xkb2ifcfg/genode.cc diff --git a/tool/xkb2ifcfg/Makefile b/tool/xkb2ifcfg/Makefile index 96bef91e3a..4a856d94b9 100644 --- a/tool/xkb2ifcfg/Makefile +++ b/tool/xkb2ifcfg/Makefile @@ -15,22 +15,24 @@ endif TARGET = xkb2ifcfg -SRC_CC = $(wildcard *.cc) -SRC_H = $(wildcard *.h) +SRC_CC = $(wildcard *.cc) +SRC_CC += $(GENODE_DIR)/repos/base/src/lib/base/xml_generator.cc +SRC_CC += $(GENODE_DIR)/repos/base/src/lib/base/output.cc +SRC_H = $(wildcard *.h) -CFLAGS = -Werror -Wall -Wextra -Wno-attributes -std=gnu++17 -ggdb +CFLAGS = -Werror -Wall -Wextra -Wno-attributes -std=gnu++20 -ggdb CFLAGS += -I$(GENODE_DIR)/repos/os/include +CFLAGS += -I$(GENODE_DIR)/repos/base/src/include CFLAGS += -I$(GENODE_DIR)/repos/base/include CFLAGS += -I$(GENODE_DIR)/repos/base/include/spec/64bit CFLAGS += -I$(GENODE_DIR)/repos/base/include/spec/x86 CFLAGS += -I$(GENODE_DIR)/repos/base/include/spec/x86_64 CFLAGS += $(shell pkg-config --cflags --libs xkbcommon) -$(TARGET): $(SRC_CC) $(SRC_H) Makefile - g++ -o $@ $(SRC_CC) $(CFLAGS) +$(TARGET): $(SRC_CC) $(SRC_H) Makefile $(OBJECTS) + g++ -o $@ $(SRC_CC) $(OBJECTS) $(CFLAGS) cleanall clean: rm -f $(TARGET) *~ - .PHONY: cleanall clean diff --git a/tool/xkb2ifcfg/genode.cc b/tool/xkb2ifcfg/genode.cc deleted file mode 100644 index 3047ec5a94..0000000000 --- a/tool/xkb2ifcfg/genode.cc +++ /dev/null @@ -1,43 +0,0 @@ -/* - * \brief Genode utility support - * \author Christian Helmuth - * \date 2019-07-25 - */ - -/* - * Copyright (C) 2019 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU Affero General Public License version 3. - */ - -/* Genode includes */ -#include - -#include "util.h" - - -void Genode::Console::_out_string(char const *str) -{ - if (!str) - _out_string(""); - else - while (*str) _out_char(*str++); -} - - -void Genode::Console::printf(const char *format, ...) -{ - va_list list; - va_start(list, format); - vprintf(format, list); - va_end(list); -} - - -void Genode::Console::vprintf(const char *format, va_list list) -{ - Formatted str(format, list); - - _out_string(str.string()); -} diff --git a/tool/xkb2ifcfg/main.cc b/tool/xkb2ifcfg/main.cc index 2042302c78..4ad2090bfb 100644 --- a/tool/xkb2ifcfg/main.cc +++ b/tool/xkb2ifcfg/main.cc @@ -489,7 +489,7 @@ struct Main::Sequence _xml.attribute("second", Formatted("0x%04x", seq.at(1).utf32).string()); _xml.attribute("third", Formatted("0x%04x", seq.at(2).utf32).string()); _xml.attribute("fourth", Formatted("0x%04x", seq.at(3).utf32).string()); - } catch (std::out_of_range) { } + } catch (std::out_of_range &) { } _xml.attribute("code", Formatted("0x%04x", utf32).string()); });