From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25126 invoked by alias); 17 Oct 2016 14:16:34 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 25113 invoked by uid 89); 17 Oct 2016 14:16:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Oct 2016 14:16:31 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 87218C05678E; Mon, 17 Oct 2016 14:16:30 +0000 (UTC) Received: from cascais.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9HEGTXF025185; Mon, 17 Oct 2016 10:16:29 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Fix phony iconv build Date: Mon, 17 Oct 2016 14:16:00 -0000 Message-Id: <1476713788-18547-1-git-send-email-palves@redhat.com> X-SW-Source: 2016-10/txt/msg00478.txt.bz2 Cross building for mingw32, I see: x86_64-w64-mingw32-g++ -g -O2 [...] ../../src/gdb/charset.c In file included from ../../src/gdb/charset.c:21:0: ../../src/gdb/charset.h:134:3: error: 'iconv_t' does not name a type iconv_t m_desc; ^ ../../src/gdb/charset.c: In constructor 'wchar_iterator::wchar_iterator(const gdb_byte*, size_t, const char*, size_t)': ../../src/gdb/charset.c:600:3: error: 'm_desc' was not declared in this scope m_desc = iconv_open (INTERMEDIATE_ENCODING, charset); ^ ../../src/gdb/charset.c: In destructor 'wchar_iterator::~wchar_iterator()': ../../src/gdb/charset.c:607:7: error: 'm_desc' was not declared in this scope if (m_desc != (iconv_t) -1) ^ ../../src/gdb/charset.c: In member function 'int wchar_iterator::iterate(wchar_iterate_result*, gdb_wchar_t**, const gdb_byte**, size_t*)': ../../src/gdb/charset.c:633:25: error: 'm_desc' was not declared in this scope size_t r = iconv (m_desc, &inptr, &m_bytes, &outptr, &out_avail); ^ This is a regression caused by commit cda6c55bd399 (Turn wchar iterator into a class). The problem is that iconv_t is now exposed in charset.h, while before it was only used in charset.c. gdb/charset.c, under #ifdef PHONY_ICONV, does: #undef iconv_t #define iconv_t int So it seems the simplest is to use 'int' in the header file too. Tromey, WDYT? gdb/ChangeLog: yyyy-mm-dd Pedro Alves * charset.h (class wchar_iterator) [PHONY_ICONV] : Use 'int' as type. --- gdb/charset.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdb/charset.h b/gdb/charset.h index 64aa58d..c5feb08 100644 --- a/gdb/charset.h +++ b/gdb/charset.h @@ -131,7 +131,11 @@ class wchar_iterator private: /* The underlying iconv descriptor. */ +#ifdef PHONY_ICONV + int m_desc; +#else iconv_t m_desc; +#endif /* The input string. This is updated as we convert characters. */ const gdb_byte *m_input; -- 2.5.5