diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /public/minmax.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'public/minmax.h')
| -rw-r--r-- | public/minmax.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/public/minmax.h b/public/minmax.h new file mode 100644 index 0000000..1707fb9 --- /dev/null +++ b/public/minmax.h @@ -0,0 +1,33 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef MINMAX_H +#define MINMAX_H + +// Remove the MSVC defines +#ifdef min +#undef min +#endif +#ifdef max +#undef max +#endif + +// On older GCC #include <algorithm> gets obliterated by our silly -Dfopen=dont_use_fopen define. Since the other +// buildbots will fail if someone does use fopen, I'm partially turning off the safety here to fix this. + +// If you're getting some weird fopen error from this, it's because someone included stdio before this file. Usually +// moving the basetypes.h include higher in the file that is exploding fixes this. +#if defined( fopen ) && defined( __GNUC__ ) && __GNUC__ < 5 +#undef fopen +#endif + +#include <algorithm> + +using std::min; +using std::max; + +#endif // MINMAX_H |