diff --git a/libretro-common/formats/libchdr/chd.c b/libretro-common/formats/libchdr/chd.c index 5ccc343337..d0b8dc20e6 100644 --- a/libretro-common/formats/libchdr/chd.c +++ b/libretro-common/formats/libchdr/chd.c @@ -49,13 +49,11 @@ #include "LzmaEnc.h" #include "LzmaDec.h" #include "retro_inline.h" +#include "minmax.h" #define TRUE 1 #define FALSE 0 -#define MAX(x, y) (((x) > (y)) ? (x) : (y)) -#define MIN(x, y) (((x) < (y)) ? (x) : (y)) - #define CHD_MAKE_TAG(a,b,c,d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d)) /*************************************************************************** diff --git a/libretro-common/formats/libchdr/flac.c b/libretro-common/formats/libchdr/flac.c index 5373eeb387..7499c9e806 100644 --- a/libretro-common/formats/libchdr/flac.c +++ b/libretro-common/formats/libchdr/flac.c @@ -12,6 +12,7 @@ #include #include #include "flac.h" +#include "minmax.h" /*************************************************************************** * FLAC DECODER @@ -206,8 +207,6 @@ uint32_t flac_decoder_finish(flac_decoder* decoder) *------------------------------------------------- */ -#define MIN(x, y) ((x) < (y) ? (x) : (y)) - FLAC__StreamDecoderReadStatus flac_decoder_read_callback_static(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data) { return flac_decoder_read_callback(client_data, buffer, bytes); diff --git a/libretro-common/formats/libchdr/minmax.h b/libretro-common/formats/libchdr/minmax.h new file mode 100644 index 0000000000..9456284d8c --- /dev/null +++ b/libretro-common/formats/libchdr/minmax.h @@ -0,0 +1,21 @@ +/* license:BSD-3-Clause + * copyright-holders:Aaron Giles + *************************************************************************** + + minmax.h + +***************************************************************************/ + +#pragma once + +#ifndef __MINMAX_H__ +#define __MINMAX_H__ + +#if defined(RARCH_INTERNAL) || defined(__LIBRETRO__) +#include +#else +#define MAX(x, y) (((x) > (y)) ? (x) : (y)) +#define MIN(x, y) ((x) < (y) ? (x) : (y)) +#endif + +#endif