Add Windows support and clean up toolchain (#10)

Reviewed-on: xt-sys/xtchain#10
Co-authored-by: Aiken Harris <harraiken@noreply.codingworkshop.git>
Co-committed-by: Aiken Harris <harraiken@noreply.codingworkshop.git>
This commit is contained in:
2025-07-10 12:37:41 +02:00
committed by CodingWorkshop Signing Team
parent ef1065278b
commit 97491fb72a
16 changed files with 793 additions and 3446 deletions

View File

@@ -7,57 +7,13 @@
* Rafal Kupiec <belliash@codingworkshop.eu.org>
*/
#ifdef UNICODE
#define _UNICODE
#endif
#include <ctype.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#define _T(x) x
#ifdef _UNICODE
#define TS "%ls"
#else
#define TS "%s"
#endif
static
inline
int
_tcsicmp(const char *a,
const char *b)
{
while(*a && tolower(*a) == tolower(*b))
{
a++;
b++;
}
return *a - *b;
}
static
inline
char *
concat(const char *prefix,
const char *suffix)
{
int prefixlen = strlen(prefix);
int suffixlen = strlen(suffix);
char *buf = malloc((prefixlen + suffixlen + 1) * sizeof(*buf));
strcpy(buf, prefix);
strcpy(buf + prefixlen, suffix);
return buf;
}
static
inline
char *
@@ -148,15 +104,3 @@ split_argv(const char *argv0,
*exe_ptr = exe;
}
}
static
inline
int
run_final(const char *executable,
const char *const *argv)
{
execvp(executable, (char **) argv);
perror(executable);
return 1;
}