29 lines
911 B
Diff
29 lines
911 B
Diff
From bfba5ea15528ce6fa66f04735f285a10667ca386 Mon Sep 17 00:00:00 2001
|
|
From: okuoku <mjt@cltn.org>
|
|
Date: Mon, 19 Dec 2022 00:48:36 +0900
|
|
Subject: [PATCH 228/233] fix: fix shaderconv compile on MSVC
|
|
|
|
---
|
|
src/gl/shaderconv.c | 4 ++++
|
|
1 file changed, 4 insertions(+)
|
|
|
|
diff --git a/src/gl/shaderconv.c b/src/gl/shaderconv.c
|
|
index 91a77497..210b37d7 100644
|
|
--- a/src/gl/shaderconv.c
|
|
+++ b/src/gl/shaderconv.c
|
|
@@ -529,7 +529,11 @@ char* ConvertShader(const char* pEntry, int isVertex, shaderconv_need_t *need)
|
|
while (strstr(Tmp, "#extension") && strstr(Tmp, "#extension")>GetLine(Tmp, headline-2)) {
|
|
char* ext = strstr(Tmp, "#extension");
|
|
size_t l = (uintptr_t)strstr(ext, "\n")-(uintptr_t)ext + sizeof("\n");
|
|
+#ifndef _MSC_VER
|
|
char e[l];
|
|
+#else
|
|
+ char* e = _alloca(l);
|
|
+#endif
|
|
memset(e, 0, l);
|
|
strncpy(e, ext, l-1);
|
|
Tmp = InplaceReplaceSimple(Tmp, &tmpsize, e, "");
|
|
--
|
|
2.11.0
|
|
|