From patchwork Thu Mar 1 20:20:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Durigan Junior X-Patchwork-Id: 26144 Received: (qmail 117605 invoked by alias); 1 Mar 2018 20:20:14 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 117596 invoked by uid 89); 1 Mar 2018 20:20:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 01 Mar 2018 20:20:12 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 034DF40744C6; Thu, 1 Mar 2018 20:20:11 +0000 (UTC) Received: from psique.yyz.redhat.com (unused-10-15-17-196.yyz.redhat.com [10.15.17.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F01E9C06F; Thu, 1 Mar 2018 20:20:08 +0000 (UTC) From: Sergio Durigan Junior To: GDB Patches Cc: Simon Marchi , Pedro Alves , Joel Brobecker , Christophe Lyon , Sergio Durigan Junior Subject: [PATCH] Conditionally include "" on common/pathstuff.c (and unbreak build on mingw*) Date: Thu, 1 Mar 2018 15:20:05 -0500 Message-Id: <20180301202005.11563-1-sergiodj@redhat.com> In-Reply-To: References: X-IsSubscribed: yes commit b4987c956dfa44ca9fd8552f63e15f5fa094b2a4 Author: Sergio Durigan Junior Date: Fri Feb 9 18:44:59 2018 -0500 Create new common/pathstuff.[ch] Introduced a regression when compiling for mingw*: /gdb/common/pathstuff.c: In function 'gdb::unique_xmalloc_ptr gdb_realpath(const char*)': /gdb/common/pathstuff.c:56:14: error: 'MAX_PATH' was not declared in this scope char buf[MAX_PATH]; ^ /gdb/common/pathstuff.c:57:5: error: 'DWORD' was not declared in this scope DWORD len = GetFullPathName (filename, MAX_PATH, buf, NULL); ^ /gdb/common/pathstuff.c:57:11: error: expected ';' before 'len' DWORD len = GetFullPathName (filename, MAX_PATH, buf, NULL); ^ /gdb/common/pathstuff.c:63:9: error: 'len' was not declared in this scope if (len > 0 && len < MAX_PATH) ^ /gdb/common/pathstuff.c:64:54: error: 'buf' was not declared in this scope return gdb::unique_xmalloc_ptr (xstrdup (buf)); ^ make[2]: *** [pathstuff.o] Error 1 The proper fix is to conditionally include "". This commit does that, without introducing any regressions as per tests made by our BuildBot. gdb/ChangeLog: 2018-03-01 Sergio Durigan Junior PR gdb/22907 * common/pathstuff.c: Conditionally include "". --- gdb/common/pathstuff.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdb/common/pathstuff.c b/gdb/common/pathstuff.c index fc574dc32e..8c4093fc38 100644 --- a/gdb/common/pathstuff.c +++ b/gdb/common/pathstuff.c @@ -23,6 +23,10 @@ #include "filenames.h" #include "gdb_tilde_expand.h" +#ifdef USE_WIN32API +#include +#endif + /* See common/pathstuff.h. */ gdb::unique_xmalloc_ptr