vkd3d-shader: Implement basic support for #if and #endif.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura
2020-12-21 14:37:06 -06:00
committed by Alexandre Julliard
parent 5304cabf46
commit 86cb863bc2
7 changed files with 258 additions and 10 deletions

View File

@@ -22,6 +22,7 @@
#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include "vkd3d_debug.h"
@@ -54,6 +55,16 @@ static inline void vkd3d_free(void *ptr)
free(ptr);
}
static inline char *vkd3d_strdup(const char *string)
{
size_t len = strlen(string) + 1;
char *ptr;
if ((ptr = vkd3d_malloc(len)))
memcpy(ptr, string, len);
return ptr;
}
bool vkd3d_array_reserve(void **elements, size_t *capacity,
size_t element_count, size_t element_size) DECLSPEC_HIDDEN;