SiegeLord / DAllegro5

D binding to the Allegro5 game development library
Other
42 stars 15 forks source link

Change ColorWrapper and _AL_EVENT_HEADER so that they are compatible with BetterC #52

Closed HumbleSolipsist closed 2 years ago

HumbleSolipsist commented 2 years ago

ColorWrapper and _AL_EVENT_HEADER use array concatenation on strings, which is not compatible with BetterC because it requires GC. However, both functions are only ever used to generate strings for mixins, so their arguments are never dynamic. I edited them to take their arguments as template parameters so that the project can be compiled with the --betterC option.

SimonN commented 2 years ago

Looks good to me! These are private compile-time helpers within DAllegro5, it makes sense to force the arguments to be compile-time, too.

SiegeLord commented 2 years ago

Thanks!