From 0897952a579f2119415dde6c702336a79f398ee1 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 31 Jul 2022 17:34:09 +0900 Subject: [PATCH] Fix windows compile issues ulong seems to be defined somewhere on Linux, thus I missed that, and of course there's the fun with aligned memory allocation :/ --- libs/gamecode/convert.py | 2 +- tools/qfcc/source/value.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/gamecode/convert.py b/libs/gamecode/convert.py index ce3637c7c..b148eb1c2 100644 --- a/libs/gamecode/convert.py +++ b/libs/gamecode/convert.py @@ -110,7 +110,7 @@ for width in range(4): elif width == 2: print(f"{case} VectorCompUop(&{dst},{cast},&{src}); break;") else: - expand = expand_str(width, src, f"({types[dst_type]})") + expand = expand_str(width, src, f"(pr_{types[dst_type]}_t)") print(f"{case} {dst} = {cast} {expand}; break;") elif mode == 2: one = one_str(width, src_type) diff --git a/tools/qfcc/source/value.c b/tools/qfcc/source/value.c index 59de51d21..54972f4d0 100644 --- a/tools/qfcc/source/value.c +++ b/tools/qfcc/source/value.c @@ -59,6 +59,12 @@ #include "tools/qfcc/include/type.h" #include "tools/qfcc/include/value.h" +//FIXME I don't like this being here (or aligned_alloc being necessary in +//the first place, but not at all sure what to do about that) +#ifdef _WIN32 +#define aligned_alloc(al, sz) _aligned_malloc(sz, al) +#endif + typedef struct { def_t *def; union {