Howard Hinnant | ab4f438 | 2011-11-29 16:45:27 +0000 | [diff] [blame] | 1 | // -*- C++ -*- |
| 2 | //===----------------------------------------------------------------------===// |
| 3 | // |
| 4 | // The LLVM Compiler Infrastructure |
| 5 | // |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 7 | // Source Licenses. See LICENSE.TXT for details. |
| 8 | // |
| 9 | //===----------------------------------------------------------------------===// |
| 10 | |
| 11 | #ifdef min |
Howard Hinnant | 80b84d4 | 2013-10-04 21:14:44 +0000 | [diff] [blame] | 12 | #if defined(_MSC_VER) && ! defined(__clang__) |
Yaron Keren | c0299d7 | 2013-11-15 23:41:01 +0000 | [diff] [blame^] | 13 | _LIBCPP_WARNING("macro min is incompatible with C++. Try #define NOMINMAX " |
| 14 | "before any Windows header. #undefing min") |
Howard Hinnant | 80b84d4 | 2013-10-04 21:14:44 +0000 | [diff] [blame] | 15 | #else |
Howard Hinnant | 49713b4 | 2012-09-03 18:13:11 +0000 | [diff] [blame] | 16 | #warning: macro min is incompatible with C++. #undefing min |
Howard Hinnant | 80b84d4 | 2013-10-04 21:14:44 +0000 | [diff] [blame] | 17 | #endif |
Howard Hinnant | ab4f438 | 2011-11-29 16:45:27 +0000 | [diff] [blame] | 18 | #undef min |
| 19 | #endif |
| 20 | |
| 21 | #ifdef max |
Howard Hinnant | 80b84d4 | 2013-10-04 21:14:44 +0000 | [diff] [blame] | 22 | #if defined(_MSC_VER) && ! defined(__clang__) |
Yaron Keren | c0299d7 | 2013-11-15 23:41:01 +0000 | [diff] [blame^] | 23 | _LIBCPP_WARNING("macro max is incompatible with C++. Try #define NOMINMAX " |
| 24 | "before any Windows header. #undefing max") |
Howard Hinnant | 80b84d4 | 2013-10-04 21:14:44 +0000 | [diff] [blame] | 25 | #else |
Howard Hinnant | 49713b4 | 2012-09-03 18:13:11 +0000 | [diff] [blame] | 26 | #warning: macro max is incompatible with C++. #undefing max |
Howard Hinnant | 80b84d4 | 2013-10-04 21:14:44 +0000 | [diff] [blame] | 27 | #endif |
Howard Hinnant | ab4f438 | 2011-11-29 16:45:27 +0000 | [diff] [blame] | 28 | #undef max |
| 29 | #endif |