From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128908 invoked by alias); 12 Jul 2017 09:50:30 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 127582 invoked by uid 89); 12 Jul 2017 09:50:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=UD:But, Hx-languages-length:4482 X-HELO: mail-qk0-f195.google.com Received: from mail-qk0-f195.google.com (HELO mail-qk0-f195.google.com) (209.85.220.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 12 Jul 2017 09:50:27 +0000 Received: by mail-qk0-f195.google.com with SMTP id 16so2402809qkg.2 for ; Wed, 12 Jul 2017 02:50:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=hIMLLjVVWgF480x5oqCipfrrknqKrdVH2vHzWqlrGUI=; b=Pttzwk4IkISDZaI+bdrNJsOS2HVoKl4ukPfR+pFxg4PoVqlo779+5bmxEVxZRke/kt v4M6YaDlJiyV+3/131XW7ZXZCSthtk+ewSc4zPLD5yHkyBkrMTLHFzZCJLf+t2CSWqO+ QK4l7+8FpChu/LNIw0qjmT/Iql/HBiGkWepSMM73IDFXbb+q4t70othAnkhd5WAllgMT TAWkroExMqHnmaGVAT8hcr0bHkLvOdCLY2fFOU0YLCNzyOyP8tO4bP+npQylpyge5tLk eKJ5KuoESBHL14i4+EoBUoJOYjdOjgvn9PxdyTek/gX3QdR4X46rCzSyklUlMF4cLBGv 8iXw== X-Gm-Message-State: AIVw112ZrE1snYPLLzrWyVD3Mpkx0pPcPJLfXlBqB+f4CJVK6H2UUh4c OLm49je1mt3lC7NlNC1QRSMKdHtP1A== X-Received: by 10.55.1.140 with SMTP id u12mr4699888qkg.108.1499853025587; Wed, 12 Jul 2017 02:50:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.233.235.73 with HTTP; Wed, 12 Jul 2017 02:50:25 -0700 (PDT) In-Reply-To: References: <20170711090601.GD30071@calimero.vinschen.de> From: Aditya Upadhyay Date: Wed, 12 Jul 2017 09:50:00 -0000 Message-ID: Subject: Re: Importing inttypes methods from FreeBSD To: newlib@sourceware.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00587.txt.bz2 So, instead of xlocale_private.h, can we use reent.h for thread local locale information ? Previously i had ported the code from mingw-w64, and it was working. Can we use that ported code here ? Thanks & Regards, Aditya Upadhyay On Wed, Jul 12, 2017 at 10:30 AM, Aditya Upadhyay wrote: > Can i port these methods from mingw-w64 libraries ?. > Previousl i had ported these methods for rtems and it was working well. > > On Tue, Jul 11, 2017 at 2:36 PM, Corinna Vinschen wrote: >> On Jul 11 08:58, Aditya Upadhyay wrote: >>> Hello Developers, >>> >>> I have ported these inttypes methods from FreeBSD. I am requesting you >>> to please review the same and suggest me changes. >> > I am sorry for a big gap. I was not feeling well and . > > I had ported these inttypes methods from mingw-w64 libraries > previously. it was working well for rtems and Testsuite for these > methods, psxinttypes01 was also working.But after suggestion, i have > ported these methods from FreeBSD. I have used xlocale_private.h which > is differently implemented in newlib already. Corinna suggested me to > use reent.h. > > > >> Nope, sorry, patch 3 is no-go. Adding the infrastructure from >> xlocale_private.h is not the right thing to do. You're adding a >> completely new way of doing stuff, which is differently implemented >> in newlib already. The thread-local stuff is in the reent struct, >> which also points to thread local locale info. States for >> multibyte/wide char conversion are already kept in reent. Use those. >> If something's missing, add it there. >> >>> diff --git a/newlib/libc/stdlib/Makefile.am b/newlib/libc/stdlib/Makefile.am >>> index ebae00a..bf44953 100644 >>> --- a/newlib/libc/stdlib/Makefile.am >>> +++ b/newlib/libc/stdlib/Makefile.am >>> @@ -33,6 +33,7 @@ GENERAL_SOURCES = \ >>> getenv.c \ >>> getenv_r.c \ >>> itoa.c \ >>> + imaxabs.c \ >> >> tab, not spaces >> >>> labs.c \ >>> ldiv.c \ >>> ldtoa.c \ >>> [...] >>> From: Aditya Upadhyay >>> Date: Mon, 10 Jul 2017 18:41:38 +0530 >>> Subject: [PATCH 2/4] Importing imaxdiv inttypes method from FreeBSD. >>> >>> --- >>> newlib/libc/stdlib/Makefile.am | 1 + >>> newlib/libc/stdlib/imaxdiv.c | 44 ++++++++++++++++++++++++++++++++++++++++++ >>> 2 files changed, 45 insertions(+) >>> create mode 100644 newlib/libc/stdlib/imaxdiv.c >>> >>> diff --git a/newlib/libc/stdlib/Makefile.am b/newlib/libc/stdlib/Makefile.am >>> index bf44953..5a50c3a 100644 >>> --- a/newlib/libc/stdlib/Makefile.am >>> +++ b/newlib/libc/stdlib/Makefile.am >>> @@ -34,6 +34,7 @@ GENERAL_SOURCES = \ >>> getenv_r.c \ >>> itoa.c \ >>> imaxabs.c \ >>> + imaxdiv.c \ >> >> Same here >> >>> labs.c \ >>> ldiv.c \ >>> ldtoa.c \ >> >>> From 1e914a2098de912d3d0e8c2fb350dd4f9f9b5435 Mon Sep 17 00:00:00 2001 >>> From: Aditya Upadhyay >>> Date: Tue, 11 Jul 2017 08:32:42 +0530 >>> Subject: [PATCH 4/4] Importing strtoimax inttypes methods from FreeBSD. >>> >>> --- >>> newlib/libc/locale/Makefile.am | 2 +- >>> newlib/libc/stdlib/Makefile.am | 1 + >>> newlib/libc/stdlib/strtoimax.c | 0 >>> 3 files changed, 2 insertions(+), 1 deletion(-) >>> create mode 100644 newlib/libc/stdlib/strtoimax.c >>> >>> diff --git a/newlib/libc/locale/Makefile.am b/newlib/libc/locale/Makefile.am >>> index 7312654..5f00d72 100644 >>> --- a/newlib/libc/locale/Makefile.am >>> +++ b/newlib/libc/locale/Makefile.am >>> @@ -4,7 +4,7 @@ AUTOMAKE_OPTIONS = cygnus >>> >>> INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) >>> >>> -GENERAL_SOURCES = setlocale.h locale.c localeconv.c >>> +GENERAL_SOURCES = setlocale.h locale.c localeconv.c xlocale_private.h >>> >>> ## The following interfaces are EL/IX level 2 >>> if ELIX_LEVEL_1 >>> diff --git a/newlib/libc/stdlib/Makefile.am b/newlib/libc/stdlib/Makefile.am >>> index 5a50c3a..0f05154 100644 >>> --- a/newlib/libc/stdlib/Makefile.am >>> +++ b/newlib/libc/stdlib/Makefile.am >>> @@ -59,6 +59,7 @@ GENERAL_SOURCES = \ >>> sb_charsets.c \ >>> strtod.c \ >>> strtodg.c \ >>> + strtoimax.c \ >> >> Same here >> >>> strtol.c \ >>> strtorx.c \ >>> strtoul.c \ >>> diff --git a/newlib/libc/stdlib/strtoimax.c b/newlib/libc/stdlib/strtoimax.c >>> new file mode 100644 >>> index 0000000..e69de29 >> >> The function is missing. If it uses the new code from xlocale_private.h, >> you'll have to reevaluate. >> >> >> Corinna >> >> -- >> Corinna Vinschen >> Cygwin Maintainer >> Red Hat