richgel999 / jpeg-compressor

C++ JPEG compression/fuzzed low-RAM JPEG decompression codec with Public Domain or Apache 2.0 license
210 stars 57 forks source link

Fix compile error on MSVC 2017 #12

Closed RandomShaper closed 4 years ago

RandomShaper commented 4 years ago

MSVC 2017 was giving errors about those setjmp() calls:

jpgd.cpp(2129): error C2668: 'jpgd::_setjmp': ambiguous call to overloaded function
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\intrin.h(920): note: could be 'int jpgd::_setjmp(_JBTYPE [])'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\setjmp.h(157): note: or       'int _setjmp(_JBTYPE [])' [found using argument-dependent lookup]
jpgd.cpp(2129): note: while trying to match the argument list '(jmp_buf)'
jpgd.cpp(3045): error C2668: 'jpgd::_setjmp': ambiguous call to overloaded function
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\intrin.h(920): note: could be 'int jpgd::_setjmp(_JBTYPE [])'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\setjmp.h(157): note: or       'int _setjmp(_JBTYPE [])' [found using argument-dependent lookup]
jpgd.cpp(3045): note: while trying to match the argument list '(jmp_buf)'
jpgd.cpp(3058): error C2668: 'jpgd::_setjmp': ambiguous call to overloaded function
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\intrin.h(920): note: could be 'int jpgd::_setjmp(_JBTYPE [])'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\setjmp.h(157): note: or       'int _setjmp(_JBTYPE [])' [found using argument-dependent lookup]
jpgd.cpp(3058): note: while trying to match the argument list '(jmp_buf)'

This PR fixes them by unambiguating via the scope resolution operator.

BTW, greetings from the Godot team! I found this after Godot was upgraded to the last version of this library.

richgel999 commented 4 years ago

Got it - thanks!