Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Compilation fixes for VS2015 #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

pps83
Copy link

@pps83 pps83 commented Jul 2, 2018

  • corrected printf modifier for size_t (replaced %lu with %zu)
  • missing <algorith> include added (needed by std::min/max)
  • added static_cast<uint8_t*> for nullptr to be able to resolve ctor for bytes_

 - corrected printf modifier for size_t (replaced %lu with %zu)
 - missing <algorithm> include added (needed by std::min/max)
 - added static_cast<uint8_t*> for nullptr to be able to resolve ctor for bytes_
@@ -216,7 +216,7 @@ class Image {
public:
using T = ComponentType;

Image() : xsize_(0), ysize_(0), bytes_per_row_(0), bytes_(nullptr, Ignore) {}
Image() : xsize_(0), ysize_(0), bytes_per_row_(0), bytes_(static_cast<uint8_t*>(nullptr), Ignore) {}
Copy link
Author

@pps83 pps83 Jul 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no idea why VS doesn't compile it. Without this fix it fails with this error:

1>c:\butteraugli\butteraugli.h(219): error C2661: 'std::unique_ptr<uint8_t [],void (__cdecl *)(void *)>::unique_ptr': no overloaded function takes 2 arguments
1>  c:\butteraugli\butteraugli.h(219): note: while compiling class template member function 'butteraugli::Image<float>::Image(void)'
1>  c:\butteraugli\butteraugli.cc(1839): note: see reference to function template instantiation 'butteraugli::Image<float>::Image(void)' being compiled
1>  c:\butteraugli\butteraugli.cc(106): note: see reference to class template instantiation 'butteraugli::Image<float>' being compiled

Also it seems that vs2017 doesn't have that problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant