tremor: update to 91decb5f1b

since upstream(i.e. xiph) doesn't update it since 2018.

locally added NOMINMAX guard as well.
This commit is contained in:
roytam1 2023-08-27 18:05:50 +08:00
commit f1d0742012
14 changed files with 91 additions and 79 deletions

View file

@ -17,7 +17,10 @@
********************************************************************/
#include <math.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <ogg/os_types.h>
#ifndef _V_IFDEFJAIL_H_
@ -25,34 +28,55 @@
# ifdef __GNUC__
# define STIN static __inline__
# elif _WIN32
# elif defined(__VBCC__)
# define STIN static inline
# elif defined(_WIN32)
# define STIN static __inline
# elif defined(__WATCOMC__)
# define STIN static __inline
# else
# define STIN static
# endif
#else
# define STIN static
#endif
#ifndef M_PI
# define M_PI (3.1415926536f)
#endif
#ifdef _WIN32
# include <malloc.h>
# define rint(x) (floor((x)+0.5f))
# define NO_FLOAT_MATH_LIB
# define FAST_HYPOT(a, b) sqrt((a)*(a) + (b)*(b))
# define LITTLE_ENDIAN 1
# define BYTE_ORDER LITTLE_ENDIAN
#endif
#ifdef HAVE_ALLOCA_H
# include <alloca.h>
#if defined HAVE_ALLOCA
# ifdef _WIN32
# include <malloc.h>
# define VAR_STACK(type, var, size) type *var = ((type*)_alloca(sizeof(type)*(size)))
# else
# ifdef HAVE_ALLOCA_H
# include <alloca.h>
# else
# include <stdlib.h>
# endif
# if defined(__AROS__) && defined(__GNUC__)
/* bypass __alloca_get_stack_limit() call in alloca.h
from old AROS SDKs, directly use __builtin_alloca(). */
# undef alloca
# define alloca __builtin_alloca
# endif
# define VAR_STACK(type, var, size) type *var = ((type*) alloca(sizeof(type)*(size)))
# endif
#elif defined VAR_ARRAYS
# define VAR_STACK(type, var, size) type var[size]
#else
#error "Either VAR_ARRAYS or HAVE_ALLOCA must be defined to select the stack allocation mode"
#endif
#ifdef USE_MEMORY_H
# include <memory.h>
#endif
#ifndef NOMINMAX
#ifndef min
# define min(x,y) ((x)>(y)?(y):(x))
#endif
@ -60,5 +84,6 @@
#ifndef max
# define max(x,y) ((x)<(y)?(y):(x))
#endif
#endif
#endif /* _OS_H */