custom memset since clang ignores fno-builtin/nostdlib/ffreestanding
This commit is contained in:
parent
e015927089
commit
035de52e31
2 changed files with 11 additions and 6 deletions
13
main.c
13
main.c
|
|
@ -5,6 +5,11 @@
|
||||||
#include "axl_vlq.h"
|
#include "axl_vlq.h"
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
void *memset(void *s, int c, size_t n)
|
||||||
|
{
|
||||||
|
return axl_memset(s, (i8)c, n);
|
||||||
|
}
|
||||||
|
|
||||||
int _start(void)
|
int _start(void)
|
||||||
{
|
{
|
||||||
SetConsoleOutputCP(CP_UTF8);
|
SetConsoleOutputCP(CP_UTF8);
|
||||||
|
|
@ -38,11 +43,11 @@ int _start(void)
|
||||||
axl_puts("{");
|
axl_puts("{");
|
||||||
for(int base = 2; base < 17; ++base)
|
for(int base = 2; base < 17; ++base)
|
||||||
{
|
{
|
||||||
i8 buff[32];
|
i8 buff[32] = {'\0'};
|
||||||
axl_memset(buff, '\0', 32);
|
//axl_memset(buff, '\0', 32);
|
||||||
|
|
||||||
i8 text[256];
|
i8 text[256] = {'\0'};
|
||||||
axl_memset(text, '\0', 256);
|
//axl_memset(text, '\0', 256);
|
||||||
|
|
||||||
axl_strcat(text, axl_itoa(i, buff, 10));
|
axl_strcat(text, axl_itoa(i, buff, 10));
|
||||||
axl_strcat(text, "\tof base\t");
|
axl_strcat(text, "\tof base\t");
|
||||||
|
|
|
||||||
4
makefile
4
makefile
|
|
@ -1,8 +1,8 @@
|
||||||
CC = clang
|
CC = clang
|
||||||
AXL_SOURCES = $(filter-out main.c %_test.c, $(wildcard *.c))
|
AXL_SOURCES = $(filter-out main.c %_test.c, $(wildcard *.c))
|
||||||
TEST_EXES = $(patsubst %.c,%.exe,$(wildcard *_test.c))
|
TEST_EXES = $(patsubst %.c,%.exe,$(wildcard *_test.c))
|
||||||
TEST_CFLAGS = -Wall -Wextra -Werror -pedantic -std=c11 -static -Oz -fsigned-char
|
TEST_CFLAGS = -Wall -Wextra -Werror -pedantic -std=c17 -static -Oz -fsigned-char
|
||||||
CFLAGS = $(TEST_CFLAGS) -nostdlib -ffreestanding
|
CFLAGS = $(TEST_CFLAGS) -nostdlib -ffreestanding -fno-builtin
|
||||||
LDFLAGS = -Wl,/SUBSYSTEM:CONSOLE,/ENTRY:_start -fuse-ld=lld
|
LDFLAGS = -Wl,/SUBSYSTEM:CONSOLE,/ENTRY:_start -fuse-ld=lld
|
||||||
LIBS = -lkernel32
|
LIBS = -lkernel32
|
||||||
SOURCES = $(AXL_SOURCES) main.c
|
SOURCES = $(AXL_SOURCES) main.c
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue