Unverified Commit 6f758832 authored by Edgar Andrés Margffoy Tuay's avatar Edgar Andrés Margffoy Tuay Committed by GitHub
Browse files

Check JPEG_FOUND macro in jpeg common definitions (#2725)

parent 6afb3496
#include "jpegcommon.h"
#include <string>
#if JPEG_FOUND
void torch_jpeg_error_exit(j_common_ptr cinfo) {
/* cinfo->err really points to a torch_jpeg_error_mgr struct, so coerce
* pointer */
......@@ -15,3 +16,4 @@ void torch_jpeg_error_exit(j_common_ptr cinfo) {
/* Return control to the setjmp point */
longjmp(myerr->setjmp_buffer, 1);
}
#endif
......@@ -4,6 +4,8 @@
#include <cstdio>
#include <cstddef>
// clang-format on
#if JPEG_FOUND
#include <jpeglib.h>
#include <setjmp.h>
#include <string>
......@@ -17,3 +19,5 @@ struct torch_jpeg_error_mgr {
typedef struct torch_jpeg_error_mgr* torch_jpeg_error_ptr;
void torch_jpeg_error_exit(j_common_ptr cinfo);
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment