1 // Copyright 2020 The PDFium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef CORE_FXCODEC_JPEG_JPEG_COMMON_H_ 8 #define CORE_FXCODEC_JPEG_JPEG_COMMON_H_ 9 10 // Common code for interacting with libjpeg shared by other files in 11 // core/fxcodec/jpeg/. Not intended to be included in headers. 12 13 #include <stdio.h> 14 15 #include "build/build_config.h" 16 17 #if BUILDFLAG(IS_WIN) 18 // windows.h must come before the third_party/libjpeg_turbo includes. 19 #include <windows.h> 20 #endif 21 22 extern "C" { 23 24 #undef FAR 25 #if defined(USE_SYSTEM_LIBJPEG) 26 #include <jerror.h> 27 #include <jpeglib.h> 28 #elif defined(USE_LIBJPEG_TURBO) 29 #include "third_party/libjpeg_turbo/jerror.h" 30 #include "third_party/libjpeg_turbo/jpeglib.h" 31 #else 32 #include "third_party/libjpeg/jerror.h" 33 #include "third_party/libjpeg/jpeglib.h" 34 #endif 35 36 void src_do_nothing(jpeg_decompress_struct* cinfo); 37 boolean src_fill_buffer(j_decompress_ptr cinfo); 38 boolean src_resync(j_decompress_ptr cinfo, int desired); 39 void error_do_nothing(j_common_ptr cinfo); 40 void error_do_nothing_int(j_common_ptr cinfo, int); 41 void error_do_nothing_char(j_common_ptr cinfo, char*); 42 43 } // extern "C" 44 45 #endif // CORE_FXCODEC_JPEG_JPEG_COMMON_H_ 46