Howard Hinnant | 66c6f97 | 2011-11-29 16:45:27 | [diff] [blame] | 1 | // -*- C++ -*- |
Eric Fiselier | 018a3d5 | 2017-05-31 22:07:49 | [diff] [blame] | 2 | //===------------------------ __undef_macros ------------------------------===// |
Howard Hinnant | 66c6f97 | 2011-11-29 16:45:27 | [diff] [blame] | 3 | // |
Chandler Carruth | 4abbf7d | 2019-01-19 08:50:56 | [diff] [blame] | 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 5 | // See https://llvm.org/LICENSE.txt for license information. |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Howard Hinnant | 66c6f97 | 2011-11-29 16:45:27 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
Eric Fiselier | 018a3d5 | 2017-05-31 22:07:49 | [diff] [blame] | 10 | |
Howard Hinnant | 66c6f97 | 2011-11-29 16:45:27 | [diff] [blame] | 11 | #ifdef min |
Saleem Abdulrasool | ab008f7 | 2016-07-12 14:39:13 | [diff] [blame] | 12 | #if !defined(_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS) |
Eric Fiselier | ab2f54f | 2017-05-10 21:40:58 | [diff] [blame] | 13 | #if defined(_LIBCPP_WARNING) |
Yaron Keren | 1823bea | 2013-11-15 23:41:01 | [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 | [diff] [blame] | 16 | #else |
Howard Hinnant | 460b4ca | 2012-09-03 18:13:11 | [diff] [blame] | 17 | #warning: macro min is incompatible with C++. #undefing min |
Howard Hinnant | f755506 | 2013-10-04 21:14:44 | [diff] [blame] | 18 | #endif |
Saleem Abdulrasool | ab008f7 | 2016-07-12 14:39:13 | [diff] [blame] | 19 | #endif |
Howard Hinnant | 66c6f97 | 2011-11-29 16:45:27 | [diff] [blame] | 20 | #undef min |
| 21 | #endif |
| 22 | |
| 23 | #ifdef max |
Saleem Abdulrasool | ab008f7 | 2016-07-12 14:39:13 | [diff] [blame] | 24 | #if !defined(_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS) |
Eric Fiselier | ab2f54f | 2017-05-10 21:40:58 | [diff] [blame] | 25 | #if defined(_LIBCPP_WARNING) |
Yaron Keren | 1823bea | 2013-11-15 23:41:01 | [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 | [diff] [blame] | 28 | #else |
Howard Hinnant | 460b4ca | 2012-09-03 18:13:11 | [diff] [blame] | 29 | #warning: macro max is incompatible with C++. #undefing max |
Howard Hinnant | f755506 | 2013-10-04 21:14:44 | [diff] [blame] | 30 | #endif |
Saleem Abdulrasool | ab008f7 | 2016-07-12 14:39:13 | [diff] [blame] | 31 | #endif |
Howard Hinnant | 66c6f97 | 2011-11-29 16:45:27 | [diff] [blame] | 32 | #undef max |
| 33 | #endif |