浏览代码

Minor cleanup

Eric Andersen 23 年之前
父节点
当前提交
f24155cd29
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. 1 1
      libc/stdlib/malloc/alloc.c
  2. 2 1
      libc/stdlib/malloc/malloc.c

+ 1 - 1
libc/stdlib/malloc/alloc.c

@@ -52,7 +52,7 @@ void free_dbg(void *ptr, char *function, char *file, int line)
 void *realloc_dbg(void *ptr, size_t size, char *function, char *file, int line)
 {
 	fprintf(stderr, "realloc of %p to %ld bytes at %s @%s;%d = ", ptr,
-			size, function, file, line);
+			(long)size, function, file, line);
 	ptr = realloc(ptr, size);
 	fprintf(stderr, "%p\n", ptr);
 	return ptr;

+ 2 - 1
libc/stdlib/malloc/malloc.c

@@ -54,8 +54,9 @@
  */
 
 #include <features.h>
-#define _POSIX_SOURCE
+#ifndef _XOPEN_SOURCE
 #define _XOPEN_SOURCE
+#endif
 #include <sys/types.h>
 #include <unistd.h>
 #include <limits.h>