diff options
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/putenv.c | 2 | ||||
-rw-r--r-- | stdlib/stdlib.h | 18 |
2 files changed, 4 insertions, 16 deletions
diff --git a/stdlib/putenv.c b/stdlib/putenv.c index 85890fec26..c0488fc505 100644 --- a/stdlib/putenv.c +++ b/stdlib/putenv.c @@ -60,7 +60,7 @@ putenv (char *string) int use_malloc = !__libc_use_alloca (name_end - string + 1); if (__builtin_expect (use_malloc, 0)) { - name = strndup (string, name_end - string); + name = __strndup (string, name_end - string); if (name == NULL) return -1; } diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h index 292c6a2f05..7cfbcafe79 100644 --- a/stdlib/stdlib.h +++ b/stdlib/stdlib.h @@ -25,16 +25,13 @@ #include <bits/libc-header-start.h> /* Get size_t, wchar_t and NULL from <stddef.h>. */ -#define __need_size_t -#ifndef __need_malloc_and_calloc -# define __need_wchar_t -# define __need_NULL -#endif +#define __need_size_t +#define __need_wchar_t +#define __need_NULL #include <stddef.h> __BEGIN_DECLS -#ifndef __need_malloc_and_calloc #define _STDLIB_H 1 #if (defined __USE_XOPEN || defined __USE_XOPEN2K8) && !defined _SYS_WAIT_H @@ -434,10 +431,6 @@ extern int lcong48_r (unsigned short int __param[7], # endif /* Use misc. */ #endif /* Use misc or X/Open. */ -#endif /* don't just need malloc and calloc */ - -#ifndef __malloc_and_calloc_defined -# define __malloc_and_calloc_defined __BEGIN_NAMESPACE_STD /* Allocate SIZE bytes of memory. */ extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur; @@ -445,9 +438,7 @@ extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur; extern void *calloc (size_t __nmemb, size_t __size) __THROW __attribute_malloc__ __wur; __END_NAMESPACE_STD -#endif -#ifndef __need_malloc_and_calloc __BEGIN_NAMESPACE_STD /* Re-allocate the previously allocated block in PTR, making the new block SIZE bytes long. */ @@ -944,9 +935,6 @@ extern int ttyslot (void) __THROW; # include <bits/stdlib-ldbl.h> #endif -#endif /* don't just need malloc and calloc */ -#undef __need_malloc_and_calloc - __END_DECLS #endif /* stdlib.h */ |