From patchwork Wed Nov 28 11:48:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Couret Charles-Antoine X-Patchwork-Id: 1004486 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-97624-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=essensium.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="g0kbYdtU"; dkim=pass (2048-bit key; unprotected) header.d=essensium-com.20150623.gappssmtp.com header.i=@essensium-com.20150623.gappssmtp.com header.b="c7JlFxih"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 434f7q30nJz9s55 for ; Wed, 28 Nov 2018 22:49:11 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; q=dns; s=default; b=EEU gr5PbPADHPY7wgJIyYAxdRNHgzoXghO7k0mMnncS18baPmS+RgIeL/iIUlCIPa7I In7h0W2j869Orwt+htpsQ7a5Kz87MX9NOHV/cAtDAGRkMgLTGGFfXjN1iP1RgJpi 7WXvAFQpnIZgF0+8KIiKyCu0o2ALf9YupiAGKJZ8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; s=default; bh=J8vs6yF9c waVQMr4a9b2JG5NTZA=; b=g0kbYdtUe5lI1N+ZyI5nDVNOJlqa4979Q6RhWBtPN vhXok4Hy2DxbCHen7IeCZf0ZH6l9dV6Qc60jTTBY5MAzeMMkDmPi1FFQRqjFcT/5 M47KqR0h+BC4qjAwOCmNaTrAD8OWgFt4KxoUA5eUVIC3SRh+sXdmWAZzlH8rKjf9 BY= Received: (qmail 74635 invoked by alias); 28 Nov 2018 11:49:05 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 74458 invoked by uid 89); 28 Nov 2018 11:48:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=Hx-spam-relays-external:209.85.208.66, H*RU:209.85.208.66, HContent-Transfer-Encoding:8bit X-HELO: mail-ed1-f66.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=essensium-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=g9DnobZGDyF8vXyTp43cb/I7dUquhEyZfTzLolXG0cI=; b=c7JlFxihsI7ch6IIg0H5bZKYg483rtt8oMFb7HKA5+cgs/EvOrEpAAWcKxyKQW58s4 PdpWSbAShIwkVvQLLIRjDAzDcjFGHn8jTCwthnTKnaJ31fy7GUCCUulOwr7qf5qFUb9x VBlaCaC75XG0iJz1ZRUQKINDFEXhpGU3HHk43DPX7U0+iyNxMekfB4eikmO/kIWAgxoC dGGtRd0kH6oGjybjvzahLGubu3RqGXmtica20DHZ9DIFuyGydecsnNfzecfcmDTpAJHa 2esrRAC9G5foCXeXkdHGmROr0QYeCUrv1JqeXNJAHzvwggazAevfI5BnnpTiVsAqNXwE Wipg== From: Charles-Antoine Couret To: libc-alpha@sourceware.org Cc: Charles-Antoine Couret Subject: [PATCH] argp: do not call _IO_fwide() if _LIBC is not defined Date: Wed, 28 Nov 2018 12:48:39 +0100 Message-Id: <20181128114839.5680-1-charles-antoine.couret@essensium.com> MIME-Version: 1.0 _IO_fwide() is defined in libio.h file. This file is included only when _LIBC is defined. So, in case of compilation of these files without _LIBC definition, the compilation failed due to this unknown function. Now this function is called when libio.h file is included. --- argp/argp-fmtstream.c | 4 ++++ argp/argp-help.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/argp/argp-fmtstream.c b/argp/argp-fmtstream.c index e43a0c7cf1..e9e4c0e5cc 100644 --- a/argp/argp-fmtstream.c +++ b/argp/argp-fmtstream.c @@ -149,9 +149,11 @@ __argp_fmtstream_update (argp_fmtstream_t fs) size_t i; for (i = 0; i < pad; i++) { +#ifdef _LIBC if (_IO_fwide (fs->stream, 0) > 0) putwc_unlocked (L' ', fs->stream); else +#endif putc_unlocked (' ', fs->stream); } } @@ -312,9 +314,11 @@ __argp_fmtstream_update (argp_fmtstream_t fs) *nl++ = ' '; else for (i = 0; i < fs->wmargin; ++i) +#ifdef _LIBC if (_IO_fwide (fs->stream, 0) > 0) putwc_unlocked (L' ', fs->stream); else +#endif putc_unlocked (' ', fs->stream); /* Copy the tail of the original buffer into the current buffer diff --git a/argp/argp-help.c b/argp/argp-help.c index 2b6b0775d6..a17260378c 100644 --- a/argp/argp-help.c +++ b/argp/argp-help.c @@ -1873,9 +1873,11 @@ __argp_failure (const struct argp_state *state, int status, int errnum, #endif } +#ifdef _LIBC if (_IO_fwide (stream, 0) > 0) putwc_unlocked (L'\n', stream); else +#endif putc_unlocked ('\n', stream); #if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)