Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make(1): fix build with -DUSE_EMALLOC



details:   https://anonhg.NetBSD.org/src/rev/6090f18a5ed6
branches:  trunk
changeset: 943276:6090f18a5ed6
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Aug 29 16:47:45 2020 +0000

description:
make(1): fix build with -DUSE_EMALLOC

diffstat:

 usr.bin/make/make_malloc.c |  18 +++++++++---------
 usr.bin/make/make_malloc.h |   4 ++--
 2 files changed, 11 insertions(+), 11 deletions(-)

diffs (68 lines):

diff -r 17900c61e036 -r 6090f18a5ed6 usr.bin/make/make_malloc.c
--- a/usr.bin/make/make_malloc.c        Sat Aug 29 16:13:27 2020 +0000
+++ b/usr.bin/make/make_malloc.c        Sat Aug 29 16:47:45 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make_malloc.c,v 1.16 2020/08/29 11:24:54 rillig Exp $  */
+/*     $NetBSD: make_malloc.c,v 1.17 2020/08/29 16:47:45 rillig Exp $  */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #ifdef MAKE_NATIVE
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: make_malloc.c,v 1.16 2020/08/29 11:24:54 rillig Exp $");
+__RCSID("$NetBSD: make_malloc.c,v 1.17 2020/08/29 16:47:45 rillig Exp $");
 #endif
 
 #include <stdio.h>
@@ -92,13 +92,6 @@
        return p;
 }
 
-/* Allocate a string from start up to but excluding end. */
-char *
-bmake_strsedup(const char *start, const char *end)
-{
-       return bmake_strldup(start, (size_t)(end - start));
-}
-
 /*
  * bmake_realloc --
  *     realloc, but die on error.
@@ -111,3 +104,10 @@
        return ptr;
 }
 #endif
+
+/* Allocate a string from start up to but excluding end. */
+char *
+bmake_strsedup(const char *start, const char *end)
+{
+    return bmake_strldup(start, (size_t)(end - start));
+}
diff -r 17900c61e036 -r 6090f18a5ed6 usr.bin/make/make_malloc.h
--- a/usr.bin/make/make_malloc.h        Sat Aug 29 16:13:27 2020 +0000
+++ b/usr.bin/make/make_malloc.h        Sat Aug 29 16:47:45 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make_malloc.h,v 1.9 2020/08/29 11:24:54 rillig Exp $   */
+/*     $NetBSD: make_malloc.h,v 1.10 2020/08/29 16:47:45 rillig Exp $  */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,6 @@
 void *bmake_realloc(void *, size_t);
 char *bmake_strdup(const char *);
 char *bmake_strldup(const char *, size_t);
-char *bmake_strsedup(const char *, const char *);
 #else
 #include <util.h>
 #define bmake_malloc(x)         emalloc(x)
@@ -39,6 +38,7 @@
 #define bmake_strdup(x)         estrdup(x)
 #define bmake_strldup(x,y)      estrndup(x,y)
 #endif
+char *bmake_strsedup(const char *, const char *);
 
 /* Thin wrapper around free(3) to avoid the extra function call in case
  * p is NULL, which on x86_64 costs about 12 machine instructions.



Home | Main Index | Thread Index | Old Index