[Lldb-commits] [PATCH] D79999: [lldb] [Windows] Provide vasprintf only for MSVC

Mateusz MikuĊ‚a via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri May 15 14:10:28 PDT 2020


mati865 updated this revision to Diff 264339.
mati865 added a comment.

With `_GNU_SOURCE` removed I was able to successfully build everything without this diff.
I cannot test it today but I believe this updated diff would have fixed the error.

It's up to you whether this should be considered as user error and not supported configuration.


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

https://reviews.llvm.org/D79999

Files:
  lldb/include/lldb/Host/windows/PosixApi.h
  lldb/source/Host/windows/Windows.cpp


Index: lldb/source/Host/windows/Windows.cpp
===================================================================
--- lldb/source/Host/windows/Windows.cpp
+++ lldb/source/Host/windows/Windows.cpp
@@ -42,6 +42,7 @@
 }
 }
 
+#ifndef _GNU_SOURCE
 int vasprintf(char **ret, const char *fmt, va_list ap) {
   char *buf;
   int len;
@@ -63,6 +64,7 @@
   va_end(ap2);
   return len;
 }
+#endif
 
 char *strcasestr(const char *s, const char *find) {
   char c, sc;
Index: lldb/include/lldb/Host/windows/PosixApi.h
===================================================================
--- lldb/include/lldb/Host/windows/PosixApi.h
+++ lldb/include/lldb/Host/windows/PosixApi.h
@@ -94,9 +94,11 @@
 
 #endif // _MSC_VER
 
-// Various useful posix functions that are not present in Windows.  We provide
-// custom implementations.
+// Various useful posix functions that are typically not present in Windows.
+// We provide custom implementations.
+#ifndef _GNU_SOURCE
 int vasprintf(char **ret, const char *fmt, va_list ap);
+#endif
 char *strcasestr(const char *s, const char *find);
 char *realpath(const char *name, char *resolved);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79999.264339.patch
Type: text/x-patch
Size: 1123 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200515/9da61e52/attachment.bin>


More information about the lldb-commits mailing list