try cuik?

This commit is contained in:
flysand7 2023-07-28 20:16:09 +11:00
parent 1f811d7646
commit bdce40092d
6 changed files with 34 additions and 3 deletions

View File

@ -200,6 +200,8 @@ def assemble(src, out):
sys.exit(code)
def compile(srcs, out, extra_flags = ''):
if cc == 'cuik' and out.endswith('.o'):
out = out[:-2]
flags = cc_flags_str + ' ' + extra_flags + ' '.join(args.cflags)
inputs = ' '.join(map(quote, srcs))
cmdline = f'{cc} {flags} {inputs} -o {quote(out)}'

View File

@ -42,9 +42,11 @@ typedef unsigned int uint32_t;
#endif
// stdbool.h
typedef _Bool bool;
#define true ((bool)1)
#define false ((bool)0)
#if !defined(__bool_true_false_are_defined)
typedef _Bool bool;
#define true ((bool)1)
#define false ((bool)0)
#endif
// Short type definitions
typedef int8_t i8;

0
include/ctype.h Normal file
View File

3
include/string.h Normal file
View File

@ -0,0 +1,3 @@
void memset(void *dest, int ch, size_t length);
int _wcsicmp(uint16_t *s1, uint16_t *s2);

View File

@ -4,3 +4,25 @@ static void _fileapi_init();
void _cia_init() {
_fileapi_init();
}
void memset(void *dest, int ch, size_t length) {
u8 *bytes = dest;
for(int i = 0; i != length; ++i) {
bytes[i] = ch;
}
}
int _wcsicmp(uint16_t *s1, uint16_t *s2) {
while(*s1 != 0 && *s2 != 0) {
if(*s1 != *s2) {
return *s1 - *s2;
}
}
if(*s1 == 0 && *s2 != 0) {
return -1;
}
if(*s1 != 0 && *s2 == 0) {
return 1;
}
return 0;
}

View File

@ -60,3 +60,5 @@ void __security_check_cookie(u64 retrieved) {
ExitProcess(1);
}
}