SDL_shader_tools
SDL_shader_tools copied to clipboard
X-macros don't expand correctly
#define FOREACH_LIST(X) \
X(item1) \
X(item2)
#define F(A) func(A);
FOREACH_LIST(F)
should expand to:
func(item1); func(item2);
but sdl-shader-compiler -P expands it to:
func ( item1 ) ; func ( item2 ) ;
I traced the extra spaces back to this buffer_append.
This is likely a leftover from when this was an HLSL preprocessor (which does some questionable things to the output like this).
If the rest of the tests still pass (after being corrected if they relied on this spacing), feel free to make the change.