Commit 38406069 authored by Davis King's avatar Davis King

Changed the code a little in an attempt to make it more robust against Windows header

files that try and #define the words "min" and "max"

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403196
parent 15f5889e
......@@ -60,12 +60,13 @@ namespace std
}
#endif
#include "platform.h"
#include "windows_magic.h"
#include <algorithm> // for std::swap
#include <new> // for std::bad_alloc
#include <cstdlib>
#include "platform.h"
#include "assert.h"
#include "error.h"
#include "noncopyable.h"
......
......@@ -3,6 +3,8 @@
#ifndef DLIB_WINDOWS_MAGIc_
#define DLIB_WINDOWS_MAGIc_
#ifdef WIN32
// This file contains all the magical #defines you have to setup before you
// include the windows header files.
......@@ -10,6 +12,15 @@
#define NOMINMAX // prevent windows from messing with std::min and std::max
#endif
// now just for good measure undefine min and max if they are defined
#ifdef min
#undef min
#endif
#ifdef max
#undef max
#endif
#ifdef NO_MAKEFILE
// only define this if all the cpp files are going to be sucked into the headers
// because otherwise we don't need it since everything is isolated in the sockets
......@@ -26,5 +37,7 @@
#define _WIN32_WINNT 0x0500
#endif
#endif WIN32
#endif // DLIB_WINDOWS_MAGIc_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment