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);
 


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);
 
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to