Move date_h to pragma onceChange-Id: I04864e8c47c8bb1763016b6ba1e5826450afdc72Signed-off-by: Ed Tanous <edtanous@google.com>
utils: date: fix clang warning```../redfish-core/include/utils/extern/date.h:983:34: error: identifier '_d' preceded by whitespace in a literal operator declaration is deprecated [-Werror,-Wdeprec
utils: date: fix clang warning```../redfish-core/include/utils/extern/date.h:983:34: error: identifier '_d' preceded by whitespace in a literal operator declaration is deprecated [-Werror,-Wdeprecated-literal-operator] 983 | CONSTCD11 date::day operator "" _d(unsigned long long d) NOEXCEPT; | ~~~~~~~~~~~~^~ | operator""_d../redfish-core/include/utils/extern/date.h:984:34: error: identifier '_y' preceded by whitespace in a literal operator declaration is deprecated [-Werror,-Wdeprecated-literal-operator] 984 | CONSTCD11 date::year operator "" _y(unsigned long long y) NOEXCEPT; | ~~~~~~~~~~~~^~ | operator""_y```Signed-off-by: Patrick Williams <patrick@stwcx.xyz>Change-Id: I2304818ddc498441f9ed2ede54c92b7f7c48b7c1
show more ...
Simplify datetime parsingThis code as it stands pulls in the full datetime library from boost,including io, and a bunch of timezone code. The bmc doesn't make use ofany of this, so we can rely o
Simplify datetime parsingThis code as it stands pulls in the full datetime library from boost,including io, and a bunch of timezone code. The bmc doesn't make use ofany of this, so we can rely on a much simplified version.Unfortunately for us, gcc still doesn't implement the c++20std::chrono::parse[1]. There is a reference library available from [2]that backports the parse function to compilers that don't yet supportit, and is the basis for the libc++ version. This commit opts to copyin the header as-written, under the assumption that we will never needto pull in new versions of this library, and will move to the stdersion as soon as it's available in the next gcc version.This commit simplifies things down to improve compile times and binarysize. It saves ~22KB of compressed binary size, or about 3%.Tested: Unit tests pass. Pretty good coverage.[1] https://en.cppreference.com/w/cpp/chrono/parse[2] https://github.com/HowardHinnant/date/blob/master/include/date/date.hSigned-off-by: Ed Tanous <edtanous@google.com>Change-Id: I706b91cc3d9df3f32068125bc47ff0c374eb8d87