From 1c8e58a7362e4dc5f0780ecfda43d81e4866c973 Mon Sep 17 00:00:00 2001 From: Henri Nurmi Date: Sun, 10 Dec 2023 08:15:41 +0200 Subject: [PATCH] cxxrtl: Fix formating --- backends/cxxrtl/cxxrtl_backend.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/backends/cxxrtl/cxxrtl_backend.cc b/backends/cxxrtl/cxxrtl_backend.cc index ab4456bba..1ab865a27 100644 --- a/backends/cxxrtl/cxxrtl_backend.cc +++ b/backends/cxxrtl/cxxrtl_backend.cc @@ -630,18 +630,16 @@ std::string escape_cxx_string(const std::string &input) std::string basename(const std::string &filepath) { -#ifndef _WIN32 - const std::string dir_seps = "/"; -#else +#ifdef _WIN32 const std::string dir_seps = "\\/"; +#else + const std::string dir_seps = "/"; #endif size_t sep_pos = filepath.find_last_of(dir_seps); - if (sep_pos != std::string::npos) { + if (sep_pos != std::string::npos) return filepath.substr(sep_pos + 1); - } - else { + else return filepath; - } } template