From patchwork Thu May 24 04:35:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel F. T. Gomes" X-Patchwork-Id: 27478 Received: (qmail 27089 invoked by alias); 24 May 2018 04:36:15 -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 26945 invoked by uid 89); 24 May 2018 04:36:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=thousands, H*F:D*br X-HELO: mo19.mail-out.ovh.net From: "Gabriel F. T. Gomes" To: Subject: [RFC PATCH 2/5] Do not define and undefine vfprintf in vfprintf.c Date: Thu, 24 May 2018 01:35:50 -0300 Message-ID: <20180524043553.23569-3-gabriel@inconstante.eti.br> In-Reply-To: <20180524043553.23569-1-gabriel@inconstante.eti.br> References: <20180524043553.23569-1-gabriel@inconstante.eti.br> MIME-Version: 1.0 X-ClientProxiedBy: EX1.emp.local (172.16.2.1) To EX4.emp.local (172.16.2.4) X-Ovh-Tracer-Id: 4700350636932845251 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedthedrgeeigddugecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecu In preparation for the transition of the long double format on powerpc64le, this patch replaces the uses of 'vfprintf' with '___vfprintf', thus avoiding the need to '#undef vfprintf' before creating the externally visible symbols. In a future, powerpc64le specific patch, a new file will define 'vfprintf' to an alternate name to be used by the long double implementation with binary128 format. Tested for powerpc64le. * stdio-common/vfprintf.c (vfprintf): Rename function name to ___vfprintf, which is redefined to _IO_vfprintf or _IO_vfprintf_internal, depending on whether support for wide or regular characters is being built. --- stdio-common/vfprintf.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c index ae412e4b84..0ab7ade1d6 100644 --- a/stdio-common/vfprintf.c +++ b/stdio-common/vfprintf.c @@ -78,7 +78,7 @@ } while (0) #ifndef COMPILE_WPRINTF -# define vfprintf _IO_vfprintf_internal +# define ___vfprintf _IO_vfprintf_internal # define CHAR_T char # define UCHAR_T unsigned char # define INT_T int @@ -105,7 +105,7 @@ typedef const char *THOUSANDS_SEP_T; # define ORIENT if (_IO_vtable_offset (s) == 0 && _IO_fwide (s, -1) != -1)\ return -1 #else -# define vfprintf _IO_vfwprintf +# define ___vfprintf _IO_vfwprintf # define CHAR_T wchar_t /* This is a hack!!! There should be a type uwchar_t. */ # define UCHAR_T unsigned int /* uwchar_t */ @@ -1235,7 +1235,7 @@ static CHAR_T *group_number (CHAR_T *, CHAR_T *, CHAR_T *, const char *, /* The function itself. */ int -vfprintf (FILE *s, const CHAR_T *format, va_list ap) +___vfprintf (FILE *s, const CHAR_T *format, va_list ap) { /* The character used as thousands separator. */ THOUSANDS_SEP_T thousands_sep = 0; @@ -2321,7 +2321,7 @@ buffered_vfprintf (FILE *s, const CHAR_T *format, va_list args) #ifndef COMPILE_WPRINTF result = _IO_vfprintf (hp, format, args); #else - result = vfprintf (hp, format, args); + result = _IO_vfwprintf (hp, format, args); #endif /* Lock stream. */ @@ -2352,7 +2352,6 @@ buffered_vfprintf (FILE *s, const CHAR_T *format, va_list args) return result; } -#undef vfprintf #ifdef COMPILE_WPRINTF strong_alias (_IO_vfwprintf, __vfwprintf); ldbl_weak_alias (_IO_vfwprintf, vfwprintf);