public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Michael Frysinger <vapier@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] newlib: rename mallocr.c to _mallocr.c
Date: Wed,  9 Mar 2022 09:44:40 +0000 (GMT)	[thread overview]
Message-ID: <20220309094440.B7E843858D28@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=b1b44f777c740f8b4317c1a8e44286f228e21541

commit b1b44f777c740f8b4317c1a8e44286f228e21541
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Tue Mar 1 00:30:46 2022 -0500

    newlib: rename mallocr.c to _mallocr.c
    
    This file is a little confusing: it provides all of the mallocr logic,
    but is compiled multiple times to produce a unique symbol each time.
    For example, building mallocr.c with -DDEFINE_FREER produces freer.o
    that only defines _free_r().  This is fine for most symbols, but it's
    a little confusing when defining mallocr itself -- we produce a file
    with the same symbol name, but we still need -DDEFINE_MALLOCR.  In
    order to move the logic from the build rules to source files, using
    mallocr.c both as a multiplexer and for defining a single symbol is a
    bit tricky.  It's possible (if we add a lot of redundant preprocessor
    checks to mallocr.c, or we add complicated build flags just for this
    one files), but it's easier if we simply rename this to a dedicated
    file.  So let's do that.
    
    We do this as a dedicated commit because the next one will create a
    new mallocr.c file and git's automatic diff algorithms can handle
    trivial renames, but it can't handle renames+creates in the same
    commit.

Diff:
---
 newlib/libc/stdlib/Makefile.am               | 24 ++++++++++++------------
 newlib/libc/stdlib/Makefile.in               | 24 ++++++++++++------------
 newlib/libc/stdlib/{mallocr.c => _mallocr.c} |  0
 3 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/newlib/libc/stdlib/Makefile.am b/newlib/libc/stdlib/Makefile.am
index 950ad98ac..cb2fbe850 100644
--- a/newlib/libc/stdlib/Makefile.am
+++ b/newlib/libc/stdlib/Makefile.am
@@ -180,40 +180,40 @@ lib_a_CFLAGS = $(AM_CFLAGS)
 lib_a_DEPENDENCIES = $(LIBADD_OBJS) $(ELIX_OBJS)
 LIB_COMPILE = $(AM_V_CC)$(COMPILE)
 
-$(lpfx)mallocr.o: mallocr.c
+$(lpfx)mallocr.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_MALLOC -c $< -o $@
 
-$(lpfx)freer.o: mallocr.c
+$(lpfx)freer.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_FREE -c $< -o $@
 
-$(lpfx)reallocr.o: mallocr.c
+$(lpfx)reallocr.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_REALLOC -c $< -o $@
 
-$(lpfx)callocr.o: mallocr.c
+$(lpfx)callocr.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_CALLOC -c $< -o $@
 
-$(lpfx)cfreer.o: mallocr.c
+$(lpfx)cfreer.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_CFREE -c $< -o $@
 
-$(lpfx)malignr.o: mallocr.c
+$(lpfx)malignr.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_MEMALIGN -c $< -o $@
 
-$(lpfx)vallocr.o: mallocr.c
+$(lpfx)vallocr.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_VALLOC -c $< -o $@
 
-$(lpfx)pvallocr.o: mallocr.c
+$(lpfx)pvallocr.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_PVALLOC -c $< -o $@
 
-$(lpfx)mallinfor.o: mallocr.c
+$(lpfx)mallinfor.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_MALLINFO -c $< -o $@
 
-$(lpfx)mallstatsr.o: mallocr.c
+$(lpfx)mallstatsr.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_MALLOC_STATS -c $< -o $@
 
-$(lpfx)msizer.o: mallocr.c
+$(lpfx)msizer.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_MALLOC_USABLE_SIZE -c $< -o $@
 
-$(lpfx)malloptr.o: mallocr.c
+$(lpfx)malloptr.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_MALLOPT -c $< -o $@
 
 $(lpfx)dtoa.o: dtoa.c mprec.h
diff --git a/newlib/libc/stdlib/Makefile.in b/newlib/libc/stdlib/Makefile.in
index b201e0555..10426ddab 100644
--- a/newlib/libc/stdlib/Makefile.in
+++ b/newlib/libc/stdlib/Makefile.in
@@ -1475,40 +1475,40 @@ uninstall-am:
 .PRECIOUS: Makefile
 
 
-$(lpfx)mallocr.o: mallocr.c
+$(lpfx)mallocr.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_MALLOC -c $< -o $@
 
-$(lpfx)freer.o: mallocr.c
+$(lpfx)freer.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_FREE -c $< -o $@
 
-$(lpfx)reallocr.o: mallocr.c
+$(lpfx)reallocr.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_REALLOC -c $< -o $@
 
-$(lpfx)callocr.o: mallocr.c
+$(lpfx)callocr.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_CALLOC -c $< -o $@
 
-$(lpfx)cfreer.o: mallocr.c
+$(lpfx)cfreer.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_CFREE -c $< -o $@
 
-$(lpfx)malignr.o: mallocr.c
+$(lpfx)malignr.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_MEMALIGN -c $< -o $@
 
-$(lpfx)vallocr.o: mallocr.c
+$(lpfx)vallocr.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_VALLOC -c $< -o $@
 
-$(lpfx)pvallocr.o: mallocr.c
+$(lpfx)pvallocr.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_PVALLOC -c $< -o $@
 
-$(lpfx)mallinfor.o: mallocr.c
+$(lpfx)mallinfor.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_MALLINFO -c $< -o $@
 
-$(lpfx)mallstatsr.o: mallocr.c
+$(lpfx)mallstatsr.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_MALLOC_STATS -c $< -o $@
 
-$(lpfx)msizer.o: mallocr.c
+$(lpfx)msizer.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_MALLOC_USABLE_SIZE -c $< -o $@
 
-$(lpfx)malloptr.o: mallocr.c
+$(lpfx)malloptr.o: _mallocr.c
 	$(LIB_COMPILE) -DDEFINE_MALLOPT -c $< -o $@
 
 $(lpfx)dtoa.o: dtoa.c mprec.h
diff --git a/newlib/libc/stdlib/mallocr.c b/newlib/libc/stdlib/_mallocr.c
similarity index 100%
rename from newlib/libc/stdlib/mallocr.c
rename to newlib/libc/stdlib/_mallocr.c


                 reply	other threads:[~2022-03-09  9:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220309094440.B7E843858D28@sourceware.org \
    --to=vapier@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).