Make FORCE_INLINE aware of DISABLE_INLINING. DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4893 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2015-01-11 04:53:16 +00:00
parent 70cd0d2425
commit 4bc18d631e

View file

@ -206,6 +206,9 @@
# define DEBUG_MAIN_ARRAYS # define DEBUG_MAIN_ARRAYS
#endif #endif
#ifndef DISABLE_INLINING
# define EXTERN_INLINE static inline
# define EXTERN_INLINE_HEADER static inline
# ifndef FORCE_INLINE # ifndef FORCE_INLINE
# ifdef _MSC_VER // Visual Studio # ifdef _MSC_VER // Visual Studio
# define FORCE_INLINE static __forceinline # define FORCE_INLINE static __forceinline
@ -217,13 +220,10 @@
# endif # endif
# endif # endif
# endif # endif
#ifndef DISABLE_INLINING
# define EXTERN_INLINE static inline
# define EXTERN_INLINE_HEADER static inline
#else #else
# define EXTERN_INLINE __fastcall # define EXTERN_INLINE __fastcall
# define EXTERN_INLINE_HEADER extern __fastcall # define EXTERN_INLINE_HEADER extern __fastcall
# define FORCE_INLINE
#endif #endif
#if !defined DEBUG_MAIN_ARRAYS #if !defined DEBUG_MAIN_ARRAYS
@ -342,8 +342,12 @@
# error Unknown endianness # error Unknown endianness
#endif #endif
#if defined _LP64 || defined __LP64__ || defined __64BIT__ || _ADDR64 || defined _WIN64 || defined __arch64__ || __WORDSIZE == 64 || (defined __sparc && defined __sparcv9) || defined __x86_64 || defined __amd64 || defined __x86_64__ || defined __amd64__ || defined _M_X64 || defined _M_IA64 || defined __ia64 || defined __IA64__ #if defined _LP64 || defined __LP64__ || defined __64BIT__ || _ADDR64 || defined _WIN64 || defined __arch64__ || \
__WORDSIZE == 64 || (defined __sparc && defined __sparcv9) || defined __x86_64 || defined __amd64 || \
defined __x86_64__ || defined __amd64__ || defined _M_X64 || defined _M_IA64 || defined __ia64 || defined __IA64__
# define BITNESS64 # define BITNESS64
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
@ -536,28 +540,16 @@ FORCE_INLINE int32_t Blrintf(const float x)
#endif #endif
// Clamp <in> to [<min>..<max>]. The case in <= min is handled first. // Clamp <in> to [<min>..<max>]. The case in <= min is handled first.
CLAMP_DECL int32_t clamp(int32_t in, int32_t min, int32_t max) CLAMP_DECL int32_t clamp(int32_t in, int32_t min, int32_t max) { return in <= min ? min : (in >= max ? max : in); }
{
return in <= min ? min : (in >= max ? max : in);
}
// Clamp <in> to [<min>..<max>]. The case in >= max is handled first. // Clamp <in> to [<min>..<max>]. The case in >= max is handled first.
CLAMP_DECL int32_t clamp2(int32_t in, int32_t min, int32_t max) CLAMP_DECL int32_t clamp2(int32_t in, int32_t min, int32_t max) { return in >= max ? max : (in <= min ? min : in); }
{
return in >= max ? max : (in <= min ? min : in);
}
// Clamp <in> to [<min>..<max>]. The case in <= min is handled first. // Clamp <in> to [<min>..<max>]. The case in <= min is handled first.
CLAMP_DECL float fclamp(float in, float min, float max) CLAMP_DECL float fclamp(float in, float min, float max) { return in <= min ? min : (in >= max ? max : in); }
{
return in <= min ? min : (in >= max ? max : in);
}
// Clamp <in> to [<min>..<max>]. The case in >= max is handled first. // Clamp <in> to [<min>..<max>]. The case in >= max is handled first.
CLAMP_DECL float fclamp2(float in, float min, float max) CLAMP_DECL float fclamp2(float in, float min, float max) { return in >= max ? max : (in <= min ? min : in); }
{
return in >= max ? max : (in <= min ? min : in);
}
#define BMAX_PATH 256 #define BMAX_PATH 256
@ -791,7 +783,7 @@ int32_t Bcorrectfilename(char *filename, int32_t removefn);
int32_t Bcanonicalisefilename(char *filename, int32_t removefn); int32_t Bcanonicalisefilename(char *filename, int32_t removefn);
char *Bgetsystemdrives(void); char *Bgetsystemdrives(void);
int32_t Bfilelength(int32_t fd); int32_t Bfilelength(int32_t fd);
char *Bstrtoken(char *s, const char *delim, char **ptrptr, int32_t chop); char *Bstrtoken(char *s, const char *delim, char **ptrptr, int chop);
char *Bstrtolower(char *str); char *Bstrtolower(char *str);
#define Bwildmatch wildmatch #define Bwildmatch wildmatch