[PATCH] D33080: [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 10 16:31:46 PDT 2017


EricWF created this revision.
Herald added a subscriber: krytarowski.

This patch improves how libc++ handles min/max macros within the headers. Previously libc++ would undef them and emit a warning.
This patch changes libc++ to use `#pragma push_macro`  to save the macro before undefining it, and `#pragma pop_macro` to restore the macros and the end of the header.


https://reviews.llvm.org/D33080

Files:
  include/__bit_reference
  include/__config
  include/__hash_table
  include/__mutex_base
  include/__split_buffer
  include/__std_stream
  include/__string
  include/__threading_support
  include/__tree
  include/__undef_macros
  include/__undef_min_max
  include/algorithm
  include/array
  include/bitset
  include/chrono
  include/deque
  include/experimental/algorithm
  include/experimental/functional
  include/experimental/optional
  include/forward_list
  include/fstream
  include/istream
  include/limits
  include/list
  include/locale
  include/memory
  include/module.modulemap
  include/mutex
  include/optional
  include/random
  include/ratio
  include/regex
  include/shared_mutex
  include/sstream
  include/string
  include/string_view
  include/valarray
  include/vector
  test/libcxx/min_max_macros.sh.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33080.98557.patch
Type: text/x-patch
Size: 32297 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170510/81fb5975/attachment-0001.bin>


More information about the cfe-commits mailing list