__undef_macros 1.0 KB

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