You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I would like to submit some modifications to you in order to optimize compatibility with the standard library and VS compilers.
Compiling under Visual Studio 2022 with and without LLVM/Clang.
There's a missing include for the files:
cpp/temperature/temperature_cache.h(105,8): error : no template named 'optional' in namespace'std'
cpp/temperature/temperature_cache.h(106,8): error : no template named 'optional' in namespace'std'
cpp/temperature/temperature_cache.h(107,8): error : no template named 'optional' in namespace'std'
cpp/temperature/temperature_cache.h(108,8): error : no template named 'optional' in namespace'std'
Solution:
#include <optional>
Here, it's the famous unix-style M_PI, not found in VS system:
cpp\dynamiccolor\material_dynamic_colors.cc(54,28): error : use of undeclared identifier 'M_PI'
Solution:
constexpr double M_PI = 3.141592653589793;
for WIN_32 defined system.
Compiling under Visual Studio 2022 only, no error with LLVM/Clang.
In 'wsmeans.cc' we have a include #include "absl/container/flat_hash_map.h" for the better performance in the QuantizeWsmeans function. Just replace the include by :
Hello, I would like to submit some modifications to you in order to optimize compatibility with the standard library and VS compilers.
Compiling under Visual Studio 2022 with and without LLVM/Clang.
There's a missing include for the files:
Solution:
#include <optional>
Here, it's the famous unix-style
M_PI
, not found in VS system:cpp\dynamiccolor\material_dynamic_colors.cc(54,28): error : use of undeclared identifier 'M_PI'
Solution:
constexpr double M_PI = 3.141592653589793;
for
WIN_32
defined system.Compiling under Visual Studio 2022 only, no error with LLVM/Clang.
Where
error C4576
=a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax
Solution:
remove traditional style cast before initializer list, the conversion is implicit.
After changes
Build successfully done under internal VS2022 and LLVM/Clang compilers.
About the Abseil Common Libraries dependency.
In '
utils.cc
' and 'wsmeans.cc
' there's dependencies over Abseil Common Libraries (C++).A solution can be to make the Abseil library optional.
The HexFromArgb function:
In '
utils.cc
' we have a include#include "absl/strings/str_cat.h"
for the hexadecimal int string formatting. Just replace the include by :and modify the function with this one:
The QuantizeWsmeans function:
In '
wsmeans.cc
' we have a include#include "absl/container/flat_hash_map.h"
for the better performance in theQuantizeWsmeans
function. Just replace the include by :and modify the function with this one:
Conclusion
Thank you very much for this great library and the whole Material Design project.
The text was updated successfully, but these errors were encountered: