[libcxx-commits] [PATCH] D147356: Fixing conflicting macro definitions between curses.h and std::filesystem.

Nicole Rabjohn via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 31 16:42:50 PDT 2023


nicolerabjohn updated this revision to Diff 510149.
nicolerabjohn added a comment.

Addressing reviewer comment to rename testcase and generalizing __undef_macros to work for all platforms.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147356/new/

https://reviews.llvm.org/D147356

Files:
  libcxx/include/__undef_macros
  libcxx/test/libcxx/vendor/ibm/curses_macro_conflict.compile.pass.cpp


Index: libcxx/test/libcxx/vendor/ibm/curses_macro_conflict.compile.pass.cpp
===================================================================
--- /dev/null
+++ libcxx/test/libcxx/vendor/ibm/curses_macro_conflict.compile.pass.cpp
@@ -0,0 +1,14 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: target={{powerpc.*-ibm-aix.*}}
+
+#include "curses.h"
+#include <filesystem>
+
+int main() { return 0; }
Index: libcxx/include/__undef_macros
===================================================================
--- libcxx/include/__undef_macros
+++ libcxx/include/__undef_macros
@@ -14,3 +14,21 @@
 #ifdef max
 #  undef max
 #endif
+
+#ifdef refresh
+inline int refresh_impl() { return refresh(); }
+#  undef refresh
+inline int refresh() { return refresh_impl(); }
+#endif
+
+#ifdef move
+inline int move_impl(int x, int y) { return move(x, y); }
+#  undef move
+inline int move(int x, int y) { return move_impl(x, y); }
+#endif
+
+#ifdef erase
+inline int erase_impl() { return erase(); }
+#  undef erase
+inline int erase() { return erase_impl(); }
+#endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147356.510149.patch
Type: text/x-patch
Size: 1399 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230331/7f5b8d52/attachment.bin>


More information about the libcxx-commits mailing list