Fix compilation of jpgd.cpp on MSVC 2017

(cherry picked from commit 1e5a93a416)
This commit is contained in:
Pedro J. Estébanez 2020-04-21 21:12:05 +02:00 committed by Rémi Verschelde
parent 3b44f34166
commit 97a787aa71
3 changed files with 36 additions and 3 deletions

View file

@ -151,6 +151,8 @@ Files extracted from upstream source:
- `jpgd*.{c,h}` - `jpgd*.{c,h}`
Patches in the `patches` directory should be re-applied after updates.
## libogg ## libogg

View file

@ -2126,7 +2126,7 @@ namespace jpgd {
int jpeg_decoder::decode_next_mcu_row() int jpeg_decoder::decode_next_mcu_row()
{ {
if (setjmp(m_jmp_state)) if (::setjmp(m_jmp_state))
return JPGD_FAILED; return JPGD_FAILED;
const bool chroma_y_filtering = ((m_flags & cFlagBoxChromaFiltering) == 0) && ((m_scan_type == JPGD_YH2V2) || (m_scan_type == JPGD_YH1V2)); const bool chroma_y_filtering = ((m_flags & cFlagBoxChromaFiltering) == 0) && ((m_scan_type == JPGD_YH2V2) || (m_scan_type == JPGD_YH1V2));
@ -3042,7 +3042,7 @@ namespace jpgd {
jpeg_decoder::jpeg_decoder(jpeg_decoder_stream* pStream, uint32_t flags) jpeg_decoder::jpeg_decoder(jpeg_decoder_stream* pStream, uint32_t flags)
{ {
if (setjmp(m_jmp_state)) if (::setjmp(m_jmp_state))
return; return;
decode_init(pStream, flags); decode_init(pStream, flags);
} }
@ -3055,7 +3055,7 @@ namespace jpgd {
if (m_error_code) if (m_error_code)
return JPGD_FAILED; return JPGD_FAILED;
if (setjmp(m_jmp_state)) if (::setjmp(m_jmp_state))
return JPGD_FAILED; return JPGD_FAILED;
decode_start(); decode_start();

View file

@ -0,0 +1,31 @@
diff --git a/thirdparty/jpeg-compressor/jpgd.cpp b/thirdparty/jpeg-compressor/jpgd.cpp
index a0c494db61..257d0b7574 100644
--- a/thirdparty/jpeg-compressor/jpgd.cpp
+++ b/thirdparty/jpeg-compressor/jpgd.cpp
@@ -2126,7 +2126,7 @@ namespace jpgd {
int jpeg_decoder::decode_next_mcu_row()
{
- if (setjmp(m_jmp_state))
+ if (::setjmp(m_jmp_state))
return JPGD_FAILED;
const bool chroma_y_filtering = ((m_flags & cFlagBoxChromaFiltering) == 0) && ((m_scan_type == JPGD_YH2V2) || (m_scan_type == JPGD_YH1V2));
@@ -3042,7 +3042,7 @@ namespace jpgd {
jpeg_decoder::jpeg_decoder(jpeg_decoder_stream* pStream, uint32_t flags)
{
- if (setjmp(m_jmp_state))
+ if (::setjmp(m_jmp_state))
return;
decode_init(pStream, flags);
}
@@ -3055,7 +3055,7 @@ namespace jpgd {
if (m_error_code)
return JPGD_FAILED;
- if (setjmp(m_jmp_state))
+ if (::setjmp(m_jmp_state))
return JPGD_FAILED;
decode_start();