Module Name:    src
Committed By:   rillig
Date:           Sat Aug 29 16:47:45 UTC 2020

Modified Files:
        src/usr.bin/make: make_malloc.c make_malloc.h

Log Message:
make(1): fix build with -DUSE_EMALLOC


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/make/make_malloc.c
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/make_malloc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/make_malloc.c
diff -u src/usr.bin/make/make_malloc.c:1.16 src/usr.bin/make/make_malloc.c:1.17
--- src/usr.bin/make/make_malloc.c:1.16	Sat Aug 29 11:24:54 2020
+++ src/usr.bin/make/make_malloc.c	Sat Aug 29 16:47:45 2020
@@ -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 @@ bmake_strldup(const char *str, size_t le
 	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 @@ bmake_realloc(void *ptr, size_t size)
 	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));
+}

Index: src/usr.bin/make/make_malloc.h
diff -u src/usr.bin/make/make_malloc.h:1.9 src/usr.bin/make/make_malloc.h:1.10
--- src/usr.bin/make/make_malloc.h:1.9	Sat Aug 29 11:24:54 2020
+++ src/usr.bin/make/make_malloc.h	Sat Aug 29 16:47:45 2020
@@ -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_malloc(size_t);
 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 @@ char *bmake_strsedup(const char *, const
 #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.

Reply via email to