[libcxx-commits] [PATCH] D134210: [SystemZ][z/OS] Use __builtin_zos_va_copy when _VARARG_EXT_ is not defined

Muiez Ahmed via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 19 12:39:18 PDT 2022


muiez created this revision.
muiez added reviewers: SeanP, zibi, fanbo-meng, libc++, ldionne.
Herald added a project: All.
muiez requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added 1 blocking reviewer(s): libc++.

z/OS has two different definitions for for va_list. The two sets of builtins are needed to support this. Need to call __builtin_zos_va_copy() when _VARARG_EXT_ is not defined. The problem only happens with c++98 or c++03.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134210

Files:
  libcxx/include/__support/ibm/xlocale.h


Index: libcxx/include/__support/ibm/xlocale.h
===================================================================
--- libcxx/include/__support/ibm/xlocale.h
+++ libcxx/include/__support/ibm/xlocale.h
@@ -107,7 +107,11 @@
   va_list ap_copy;
   // va_copy may not be provided by the C library in C++ 03 mode.
 #if defined(_LIBCPP_CXX03_LANG) && __has_builtin(__builtin_va_copy)
+#if defined(__MVS__) && !defined(_VARARG_EXT_)
+  __builtin_zos_va_copy(ap_copy, ap);
+#else
   __builtin_va_copy(ap_copy, ap);
+#endif
 #else
   va_copy(ap_copy, ap);
 #endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134210.461306.patch
Type: text/x-patch
Size: 554 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220919/9d8a4df2/attachment.bin>


More information about the libcxx-commits mailing list