File indexing completed on 2024-04-28 15:40:25

0001 /*
0002   SPDX-FileCopyrightText: 2007-2010 Tuomas Suutari <thsuut@utu.fi>
0003 
0004   SPDX-License-Identifier: GPL-2.0-or-later
0005 
0006   This program is distributed in the hope that it will be useful, but
0007   WITHOUT ANY WARRANTY; without even the implied warranty of
0008   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0009   General Public License for more details.
0010 
0011   You should have received a copy of the GNU General Public License
0012   along with this program (see the file COPYING); if not, write to the
0013   Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
0014   MA 02110-1301 USA.
0015 */
0016 
0017 #ifndef UTILITIES_JPEGLIBWITHFIX_H
0018 #define UTILITIES_JPEGLIBWITHFIX_H
0019 // FIXME: Hacky work-around for HAVE_STDLIB_H redifiniton warning.
0020 
0021 // Some systems (like mine) have HAVE_STDLIB_H defined in jconfig.h
0022 // which is included from jpeglib.h, but then it's also defined in our
0023 // config.h, so GCC complains about HAVE_STDLIB_H redifinition. Here
0024 // is my hacky fix for it. If you know a better way please let me
0025 // know.  -- Tuomas
0026 
0027 #ifdef HAVE_STDLIB_H
0028 #undef HAVE_STDLIB_H
0029 #define HAVE_STDLIB_H_WAS_DEFINED
0030 #endif
0031 
0032 // clang-format off
0033 extern "C" {
0034 #define XMD_H // prevent INT32 clash from jpeglib
0035 #include <stdlib.h>
0036 #include <stdio.h>
0037 #include <jpeglib.h>
0038 }
0039 // clang-format on
0040 
0041 #ifdef HAVE_STDLIB_H_WAS_DEFINED
0042 #ifndef HAVE_STDLIB_H
0043 #define HAVE_STDLIB_H
0044 #endif
0045 #endif
0046 
0047 #undef HAVE_STDLIB_H_WAS_DEFINED
0048 
0049 #endif /* UTILITIES_JPEGLIBWITHFIX_H */
0050 // vi:expandtab:tabstop=4 shiftwidth=4: