Howard Hinnant | 66c6f97 | 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 |
Saleem Abdulrasool | ab008f7 | 2016-07-12 14:39:13 +0000 | [diff] [blame] | 12 | #if !defined(_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS) |
Howard Hinnant | f755506 | 2013-10-04 21:14:44 +0000 | [diff] [blame] | 13 | #if defined(_MSC_VER) && ! defined(__clang__) |
Yaron Keren | 1823bea | 2013-11-15 23:41:01 +0000 | [diff] [blame] | 14 | _LIBCPP_WARNING("macro min is incompatible with C++. Try #define NOMINMAX " |
| 15 | "before any Windows header. #undefing min") |
Howard Hinnant | f755506 | 2013-10-04 21:14:44 +0000 | [diff] [blame] | 16 | #else |
Howard Hinnant | 460b4ca | 2012-09-03 18:13:11 +0000 | [diff] [blame] | 17 | #warning: macro min is incompatible with C++. #undefing min |
Howard Hinnant | f755506 | 2013-10-04 21:14:44 +0000 | [diff] [blame] | 18 | #endif |
Saleem Abdulrasool | ab008f7 | 2016-07-12 14:39:13 +0000 | [diff] [blame] | 19 | #endif |
Howard Hinnant | 66c6f97 | 2011-11-29 16:45:27 +0000 | [diff] [blame] | 20 | #undef min |
| 21 | #endif |
| 22 | |
| 23 | #ifdef max |
Saleem Abdulrasool | ab008f7 | 2016-07-12 14:39:13 +0000 | [diff] [blame] | 24 | #if !defined(_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS) |
Howard Hinnant | f755506 | 2013-10-04 21:14:44 +0000 | [diff] [blame] | 25 | #if defined(_MSC_VER) && ! defined(__clang__) |
Yaron Keren | 1823bea | 2013-11-15 23:41:01 +0000 | [diff] [blame] | 26 | _LIBCPP_WARNING("macro max is incompatible with C++. Try #define NOMINMAX " |
| 27 | "before any Windows header. #undefing max") |
Howard Hinnant | f755506 | 2013-10-04 21:14:44 +0000 | [diff] [blame] | 28 | #else |
Howard Hinnant | 460b4ca | 2012-09-03 18:13:11 +0000 | [diff] [blame] | 29 | #warning: macro max is incompatible with C++. #undefing max |
Howard Hinnant | f755506 | 2013-10-04 21:14:44 +0000 | [diff] [blame] | 30 | #endif |
Saleem Abdulrasool | ab008f7 | 2016-07-12 14:39:13 +0000 | [diff] [blame] | 31 | #endif |
Howard Hinnant | 66c6f97 | 2011-11-29 16:45:27 +0000 | [diff] [blame] | 32 | #undef max |
| 33 | #endif |