Skip to content

Commit

Permalink
sync colorer with upstream;
Browse files Browse the repository at this point in the history
  • Loading branch information
ctapmex committed Nov 22, 2024
1 parent 63ae9f6 commit 4375911
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 20 deletions.
19 changes: 14 additions & 5 deletions colorer/src/Colorer-library/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ set(SRC_COLORER
colorer/parsers/VirtualEntry.h
colorer/utils/Environment.cpp
colorer/utils/Environment.h
colorer/utils/FileSystems.h
colorer/version.h
colorer/viewer/ParsedLineWriter.cpp
colorer/viewer/ParsedLineWriter.h
Expand Down Expand Up @@ -226,11 +227,19 @@ target_include_directories(colorer_lib PUBLIC
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)

set_target_properties(colorer_lib PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS YES
)
if(COLORER_BUILD_OLD_COMPILERS)
set_target_properties(colorer_lib PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS YES
)
else()
set_target_properties(colorer_lib PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO
)
endif()

target_link_libraries(colorer_lib
PUBLIC LibXml2::LibXml2
Expand Down
1 change: 0 additions & 1 deletion colorer/src/Colorer-library/src/colorer/base/BaseNames.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ const char16_t HrdClassRgb[] = u"rgb\0";
const char16_t HrdClassText[] = u"text\0";

UNICODE_LITERAL(jar, u"jar:")
//inline const auto jar = UnicodeString(u"jar:");

#endif // COLORER_BASENAMES_H
7 changes: 3 additions & 4 deletions colorer/src/Colorer-library/src/colorer/common/Logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
#define COLORER_LOGGER_H

#include <sstream>

#if __cplusplus < 201703L
# include <experimental/string_view>
#if __cplusplus < 201703L && !defined(_MSC_VER)
#include <experimental/string_view>
namespace std
{
typedef experimental::string_view string_view;
typedef experimental::string_view string_view;
}
#endif

Expand Down
10 changes: 1 addition & 9 deletions colorer/src/Colorer-library/src/colorer/utils/Environment.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,7 @@
#include <regex>
#include <vector>
#include "colorer/Common.h"

#ifdef COLORER_FEATURE_OLD_COMPILERS
#include "colorer/platform/filesystem.hpp"
namespace fs = ghc::filesystem;
#else
#include <filesystem>
namespace fs = std::filesystem;
#endif

#include "colorer/utils/FileSystems.h"

namespace colorer {

Expand Down
14 changes: 14 additions & 0 deletions colorer/src/Colorer-library/src/colorer/utils/FileSystems.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef COLORER_FILESYSTEMS_HPP
#define COLORER_FILESYSTEMS_HPP

#include <colorer/Common.h>

#ifdef COLORER_FEATURE_OLD_COMPILERS
#include "colorer/platform/filesystem.hpp"
namespace fs = ghc::filesystem;
#else
#include <filesystem>
namespace fs = std::filesystem;
#endif

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void LibXmlReader::getAttributes(const xmlNode* node, std::unordered_map<Unicode
{
for (xmlAttrPtr attr = node->properties; attr != nullptr; attr = attr->next) {
const auto content = xmlNodeGetContent(attr->children);
data.emplace(std::make_pair(reinterpret_cast<const char*>(attr->name), reinterpret_cast<const char*>(content)));
data.emplace(reinterpret_cast<const char*>(attr->name), reinterpret_cast<const char*>(content));
xmlFree(content);
}
}
Expand Down

0 comments on commit 4375911

Please sign in to comment.