shithub: scc

Download patch

ref: ca9626acadaf49449d51f8743f115ad6737691c8
parent: 8e0079cd303a4842c373fcf0b782c5b78ef6e43e
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Mon Feb 26 10:06:03 EST 2018

[lib/c] Rename assert.c to __assert.c

It is better to keep the name of the file synchronized with
the name of the symbol that it exports.

--- /dev/null
+++ b/lib/c/__assert.c
@@ -1,0 +1,9 @@
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+void __assert(char *exp, char *file, long line)
+{
+	fprintf(stderr, "%s:%ld: assertion failed '%s'\n", file, line, exp);
+	abort();
+}
--- a/lib/c/assert.c
+++ /dev/null
@@ -1,9 +1,0 @@
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-void __assert(char *exp, char *file, long line)
-{
-	fprintf(stderr, "%s:%ld: assertion failed '%s'\n", file, line, exp);
-	abort();
-}
--- a/lib/c/target/objlst.mk
+++ b/lib/c/target/objlst.mk
@@ -12,7 +12,7 @@
       setbuf.o setvbuf.o \
       fclose.o fopen.c freopen.c _fpopen.o stdio.o \
       realloc.o calloc.o malloc.o \
-      assert.o strcpy.o strcmp.o strlen.o strchr.o \
+      __assert.o strcpy.o strcmp.o strlen.o strchr.o \
       strrchr.o strcat.o strncmp.o strncpy.o strncat.o strcoll.o \
       strxfrm.o strstr.o strspn.o strcspn.o strpbrk.o strtok.o \
       memset.o memcpy.o memmove.o memcmp.o memchr.o \