Open craouette opened 3 months ago
Are there parts of this something you might be able to contribute behind some #if defined(WIN32)
macro guards?
Why do you have to comment-out log2
, btw? Is that name a windows-only thing or is it hitting some other compile error?
For the unsigned char** ptrs = new unsigned char*[height];
change -- that's a memory leak. I'd recommend storing it in a std::unique_ptr<unsigned char>
instead so that it avoids the leak.
It is true that the current use of const unsigned char* ptrs[height];
is a GCC extension ("variable-length arrays"), so replacing that would be worth it IMO.
Hi,
In order to compile on windows with Visual studio 2022, I needed to:
from inline double log2(double x) { return log(x) 1.4426950408889634; } to //inline double log2(double x) { return log(x) 1.4426950408889634; }
from const unsigned char* ptrs[height]; to unsigned char* ptrs = new unsigned char[height];
from const unsigned char* ptrs[height]; to unsigned char* ptrs = new unsigned char[height];
These changes should not impact other platform.
Pierre