Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[linux-port] Support full IID comparison on GCC #3062

Merged
merged 9 commits into from
Nov 20, 2020
Prev Previous commit
WinAdapter: Remove dead code
  • Loading branch information
MarijnS95 committed Nov 19, 2020
commit b863d3aeb96114b36d846604036782e9711756e1
13 changes: 0 additions & 13 deletions include/dxc/Support/WinAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -560,14 +560,6 @@ constexpr uint8_t nybble_from_hex(char c) {
? (c - 'a' + 10)
: ((c >= 'A' && c <= 'F') ? (c - 'A' + 10)
: /* Should be an error */ -1)));
// if constexpr (c >= '0' && c <= '9')
// return c - '0';
// else if constexpr (c >= 'a' && c <= 'f')
// return c - 'a' + 10;
// else if constexpr (c >= 'A' && c <= 'F')
// return c - 'A' + 10;
// throw -1;
// return -1;
}

constexpr uint8_t byte_from_hex(char c1, char c2) {
Expand All @@ -579,11 +571,6 @@ constexpr uint8_t byte_from_hexstr(const char str[2]) {
}

constexpr GUID guid_from_string(const char str[37]) {
// error: non-constant condition for static assertion :(
// static_assert(str[8] == '-', "Expected -");
// static_assert(str[13] == '-', "Expected -");
// static_assert(str[18] == '-', "Expected -");
// static_assert(str[23] == '-', "Expected -");
return GUID{static_cast<uint32_t>(byte_from_hexstr(str)) << 24 |
static_cast<uint32_t>(byte_from_hexstr(str + 2)) << 16 |
static_cast<uint32_t>(byte_from_hexstr(str + 4)) << 8 |
Expand Down