diff --git a/bin/GCStress/stdafx.h b/bin/GCStress/stdafx.h index 80aae811ca7..1f199f492d3 100644 --- a/bin/GCStress/stdafx.h +++ b/bin/GCStress/stdafx.h @@ -10,16 +10,10 @@ #include #include #include -#else -#include -#endif -#ifdef _MSC_VER #pragma warning(disable:4985) #include -#endif -#ifndef USING_PAL_STDLIB #include #include #endif @@ -30,11 +24,6 @@ void DoVerify(bool value, const char * expr, const char * file, int line); -inline unsigned int GetRandomInteger(unsigned int limit) -{ - return rand() % limit; -} - #include "WeightedTable.h" #include "Common.h" @@ -45,3 +34,7 @@ extern Recycler * recyclerInstance; #include "GCStress.h" #include "RecyclerTestObject.h" +inline unsigned int GetRandomInteger(unsigned int limit) +{ + return rand() % limit; +} diff --git a/pal/inc/pal.h b/pal/inc/pal.h index 6c6b6500ea5..d33e0987676 100644 --- a/pal/inc/pal.h +++ b/pal/inc/pal.h @@ -6406,11 +6406,6 @@ PALIMPORT char * __cdecl _strdup(const char *); #define alloca __builtin_alloca #endif // __GNUC__ -#ifndef NO_PAL_MINMAX -#define max(a, b) (((a) > (b)) ? (a) : (b)) -#define min(a, b) (((a) < (b)) ? (a) : (b)) -#endif - #endif // !PAL_STDCPP_COMPAT PALIMPORT PAL_NORETURN void __cdecl exit(int); diff --git a/pal/src/include/pal/palinternal.h b/pal/src/include/pal/palinternal.h index 92032909d36..bd6f77cacf0 100644 --- a/pal/src/include/pal/palinternal.h +++ b/pal/src/include/pal/palinternal.h @@ -672,13 +672,6 @@ inline T* InterlockedCompareExchangePointerT( #endif // __cplusplus -#ifndef max -#define max(a,b) (((a) > (b)) ? (a) : (b)) -#endif -#ifndef min -#define min(a,b) (((a) < (b)) ? (a) : (b)) -#endif - #define StackOverflowMessage "Process is terminated due to StackOverflowException.\n" #ifdef __ANDROID__ @@ -693,4 +686,13 @@ inline T* InterlockedCompareExchangePointerT( __android_log_print(ANDROID_LOG_ERROR, CC_AND_TAG, __VA_ARGS__) #endif +// do not change the location of the definitions below. +// these defs should be always at the end +#ifndef max +#define max(a,b) (((a) > (b)) ? (a) : (b)) +#endif +#ifndef min +#define min(a,b) (((a) < (b)) ? (a) : (b)) +#endif + #endif /* _PAL_INTERNAL_H_ */