summaryrefslogtreecommitdiffhomepage
path: root/src/build/cmeta.c
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2022-01-06 23:04:26 +0000
committerMichael Smith <mikesmiffy128@gmail.com>2022-01-06 23:04:26 +0000
commit6dac66008d2617d7eb4bd6efa09a2c7de47944b4 (patch)
tree6c8038e9857d8f6ce64e636009aa06d4ff8289e6 /src/build/cmeta.c
parent0da31e9f420e573621712420bf71eb1ca8f6d07f (diff)
Fix build scripts and codegen on Linux
SST itself doesn't build, but it's a start! Really interesting is the declaration after a switch label. That's of course invalid, but Clang on Windows never complained. I guess it's an MSVC extension, eh? How annoying. Also, haha yes the script wasn't even executable. Forgot to update-index when I remade the repo, I guess...
Diffstat (limited to 'src/build/cmeta.c')
-rw-r--r--src/build/cmeta.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/build/cmeta.c b/src/build/cmeta.c
index 157ba92..7b7a767 100644
--- a/src/build/cmeta.c
+++ b/src/build/cmeta.c
@@ -98,13 +98,23 @@ static void die1(const char *s) {
exit(100);
}
+#ifndef _WIN32
+static void die2(const char *s1, const char *s2) {
+ fprintf(stderr, "cmeta: fatal: %s%s\n", s1, s2);
+ exit(100);
+}
+#endif
+
static char *readsource(const os_char *f) {
int fd = os_open(f, O_RDONLY);
#ifndef _WIN32
if (fd == -1) die2("couldn't open ", f);
#else
- // TODO/FIXME/TEMP this is dumb and bad
- if (fd == -1) { fprintf(stderr, "couldn't open %S", f); exit(100); }
+ // XXX: this is dumb and bad
+ if (fd == -1) {
+ fprintf(stderr, "cmeta: fatal: couldn't open %S", f);
+ exit(100);
+ }
#endif
uint bufsz = 8192;
char *buf = malloc(bufsz);