top | item 43681600

(no title)

gthompson512 | 10 months ago

Minor correction, macros CANT have newlines, you need to splice them during preprocessing using \ followed by a new line, the actual code has these:

from https://github.com/codr7/hacktical-c/blob/main/macro/macro.h

#define hc_align(base, size) ({ \ __auto_type _base = base; \ __auto_type _size = hc_min((size), _Alignof(max_align_t)); \ (_base) + _size - ((ptrdiff_t)(_base)) % _size; \ }) \

After preprocessing it is a single line.

discuss

order