__undef_min_max 1.0 KB

123456789101112131415161718192021222324252627282930313233
  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. #ifdef min
  11. #if !defined(_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS)
  12. #if defined(_MSC_VER) && ! defined(__clang__)
  13. _LIBCPP_WARNING("macro min is incompatible with C++. Try #define NOMINMAX "
  14. "before any Windows header. #undefing min")
  15. #else
  16. #warning: macro min is incompatible with C++. #undefing min
  17. #endif
  18. #endif
  19. #undef min
  20. #endif
  21. #ifdef max
  22. #if !defined(_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS)
  23. #if defined(_MSC_VER) && ! defined(__clang__)
  24. _LIBCPP_WARNING("macro max is incompatible with C++. Try #define NOMINMAX "
  25. "before any Windows header. #undefing max")
  26. #else
  27. #warning: macro max is incompatible with C++. #undefing max
  28. #endif
  29. #endif
  30. #undef max
  31. #endif