SDL_shader_tools icon indicating copy to clipboard operation
SDL_shader_tools copied to clipboard

X-macros don't expand correctly

Open madebr opened this issue 2 years ago • 1 comments

#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.

madebr avatar Sep 22 '23 03:09 madebr

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.

icculus avatar Sep 22 '23 03:09 icculus