[Lldb-commits] [lldb] r228822 - Fix Mingw build.

Hafiz Abid Qadeer hafiz_abid at mentor.com
Wed Feb 11 02:14:14 PST 2015


Author: abidh
Date: Wed Feb 11 04:14:13 2015
New Revision: 228822

URL: http://llvm.org/viewvc/llvm-project?rev=228822&view=rev
Log:
Fix Mingw build.

Following changes are done.

Add missing headers.
Replace _snprintf with snprintf. It is already changed to _snprintf for MSVC.
Add a file in the build for autoconf.
Call DynamicLoaderWindows::Terminate and DynamicLoaderWindows::Initialize only for MSVC build.

Reviewed in http://reviews.llvm.org/D7536.


Modified:
    lldb/trunk/source/Host/common/SocketAddress.cpp
    lldb/trunk/source/Host/windows/Makefile
    lldb/trunk/source/Utility/UriParser.cpp
    lldb/trunk/source/lldb.cpp

Modified: lldb/trunk/source/Host/common/SocketAddress.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/SocketAddress.cpp?rev=228822&r1=228821&r2=228822&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/SocketAddress.cpp (original)
+++ lldb/trunk/source/Host/common/SocketAddress.cpp Wed Feb 11 04:14:13 2015
@@ -9,10 +9,13 @@
 
 #include "lldb/Host/SocketAddress.h"
 #include <stddef.h>
+#include <stdio.h>
 
 // C Includes
 #if !defined(_WIN32)
 #include <arpa/inet.h>
+#else
+#include "lldb/Host/windows/win32.h"
 #endif
 #include <assert.h>
 #include <string.h>
@@ -54,7 +57,7 @@ const char* inet_ntop(int af, const void
             {
                 char tmp[INET6_ADDRSTRLEN] = {0};
                 const uint16_t* src16 = static_cast<const uint16_t*>(src);
-                int full_size = _snprintf(tmp, sizeof(tmp),
+                int full_size = ::snprintf(tmp, sizeof(tmp),
                                           "%x:%x:%x:%x:%x:%x:%x:%x",
                                           ntohs(src16[0]), ntohs(src16[1]), ntohs(src16[2]), ntohs(src16[3]),
                                           ntohs(src16[4]), ntohs(src16[5]), ntohs(src16[6]), ntohs(src16[7])

Modified: lldb/trunk/source/Host/windows/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/Makefile?rev=228822&r1=228821&r2=228822&view=diff
==============================================================================
--- lldb/trunk/source/Host/windows/Makefile (original)
+++ lldb/trunk/source/Host/windows/Makefile Wed Feb 11 04:14:13 2015
@@ -11,4 +11,6 @@ LLDB_LEVEL := ../../..
 LIBRARYNAME := lldbHostWindows
 BUILD_ARCHIVE = 1
 
+SOURCES = $(notdir $(wildcard $(PROJ_SRC_DIR)/*.cpp )) $(PROJ_SRC_DIR)/../posix/ConnectionFileDescriptorPosix.cpp
+
 include $(LLDB_LEVEL)/Makefile

Modified: lldb/trunk/source/Utility/UriParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/UriParser.cpp?rev=228822&r1=228821&r2=228822&view=diff
==============================================================================
--- lldb/trunk/source/Utility/UriParser.cpp (original)
+++ lldb/trunk/source/Utility/UriParser.cpp Wed Feb 11 04:14:13 2015
@@ -11,6 +11,7 @@
 
 // C Includes
 #include <stdlib.h>
+#include <stdio.h>
 
 // C++ Includes
 // Other libraries and framework includes

Modified: lldb/trunk/source/lldb.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/lldb.cpp?rev=228822&r1=228821&r2=228822&view=diff
==============================================================================
--- lldb/trunk/source/lldb.cpp (original)
+++ lldb/trunk/source/lldb.cpp Wed Feb 11 04:14:13 2015
@@ -209,7 +209,7 @@ lldb_private::Initialize ()
         //----------------------------------------------------------------------
         ProcessLinux::Initialize();
 #endif
-#if defined(_WIN32)
+#if defined(_MSC_VER)
         DynamicLoaderWindows::Initialize();
         ProcessWindows::Initialize();
 #endif
@@ -298,7 +298,7 @@ lldb_private::Terminate ()
 
     Debugger::SettingsTerminate ();
 
-#if defined (_WIN32)
+#if defined(_MSC_VER)
     DynamicLoaderWindows::Terminate();
 #endif
 





More information about the lldb-commits mailing list