-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[localization 1/n] First minor changes, mostly additive (#218)
* [localization 1/n] First minor changes, mostly additive Additionally, convert vcpkg.cpp over to using messages.h * oops, forgot to initialize the context also, build on msvc & gcc 6 * add cgmanifest and NOTICE * Add support for signing with fmt * switch to MAXDWORD * add localization file * turn `find_package(fmt)` into a Findfmt script * check sha * Raise default locale initialization above filesystem access * Avoid O(N^2) on happy path * Address CR comment on formatter<vcpkg::StringLiteral> Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
- Loading branch information
1 parent
72deea4
commit 5b939c9
Showing
37 changed files
with
926 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"Registrations": [ | ||
{ | ||
"Component": { | ||
"Type": "git", | ||
"git": { | ||
"RepositoryUrl": "https://github.com/catchorg/Catch2", | ||
"CommitHash": "2f631bb8087a0355d2b23a75a28d936ce237659d" | ||
} | ||
}, | ||
"DevelopmentDependency": true, | ||
"DependencyRoots": [] | ||
}, | ||
{ | ||
"Component": { | ||
"Type": "git", | ||
"git": { | ||
"RepositoryUrl": "https://github.com/fmtlib/fmt", | ||
"CommitHash": "d141cdbeb0fb422a3fb7173b285fd38e0d1772dc" | ||
} | ||
}, | ||
"DevelopmentDependency": false, | ||
"DependencyRoots": [] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
option(VCPKG_DEPENDENCY_EXTERNAL_FMT "Use an external version of the fmt library" OFF) | ||
|
||
include(FetchContent) | ||
FetchContent_Declare( | ||
fmt | ||
GIT_REPOSITORY https://github.com/fmtlib/fmt | ||
GIT_TAG d141cdbeb0fb422a3fb7173b285fd38e0d1772dc # 8.0.1 | ||
) | ||
|
||
if(NOT fmt_FIND_REQUIRED) | ||
message(FATAL_ERROR "fmt must be REQUIRED") | ||
endif() | ||
|
||
if(VCPKG_DEPENDENCY_EXTERNAL_FMT) | ||
find_package(fmt CONFIG REQUIRED) | ||
else() | ||
FetchContent_MakeAvailable(fmt) | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#pragma once | ||
|
||
#include <vcpkg/base/lineinfo.h> | ||
#include <vcpkg/base/pragmas.h> | ||
|
||
VCPKG_MSVC_WARNING(push) | ||
// notes: | ||
// C6239 is not a useful warning for external code; it is | ||
// (<non-zero constant> && <expression>) always evaluates to the result of <expression>. | ||
// C6385 is a useful warning, but it's incorrect in this case; it thinks that (on line 1238), | ||
// const char* top = data::digits[exp / 100]; | ||
// accesses outside the bounds of data::digits; however, `exp < 10000 => exp / 100 < 100`, | ||
// and thus the access is safe. | ||
VCPKG_MSVC_WARNING(disable : 6239 6385) | ||
#include <fmt/format.h> | ||
VCPKG_MSVC_WARNING(pop) | ||
|
||
namespace vcpkg | ||
{ | ||
constexpr auto basic_format_parse_impl(fmt::format_parse_context& ctx) -> decltype(ctx.begin()) | ||
{ | ||
if (ctx.begin() != ctx.end() && *ctx.begin() != '}') | ||
{ | ||
throw fmt::format_error("invalid format - must be empty"); | ||
} | ||
|
||
return ctx.begin(); | ||
} | ||
} | ||
|
||
namespace fmt | ||
{ | ||
template<> | ||
struct formatter<vcpkg::LineInfo> | ||
{ | ||
constexpr auto parse(format_parse_context& ctx) -> decltype(ctx.begin()) | ||
{ | ||
return vcpkg::basic_format_parse_impl(ctx); | ||
} | ||
template<class FormatContext> | ||
auto format(const vcpkg::LineInfo& li, FormatContext& ctx) -> decltype(ctx.out()) | ||
{ | ||
return format_to(ctx.out(), "{}({})", li.file_name, li.line_number); | ||
} | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#pragma once | ||
|
||
namespace vcpkg | ||
{ | ||
struct IgnoreErrors; | ||
struct Filesystem; | ||
struct Path; | ||
} |
Oops, something went wrong.