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: Charles-Antoine Couret X-Patchwork-Id: 30358 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== Return-Path: 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)