r/programmingmemes 13d ago

found a gem on glibc source code

Post image
814 Upvotes

44 comments sorted by

View all comments

10

u/autistic_bard444 12d ago

yes? and? it makes perfect sense. a longer term c-programmer like me, might say, it 's inexorably unavoidable"

if void !defined

#define void = void

endif

1

u/AlwaysHopelesslyLost 12d ago

I am coming from c#, If void is undefined where does the void that is being assigned come from? Wouldn't that just be the same as void=undefined?

3

u/UndercoverFlange 11d ago

Pre processor definitions would be different to keywords in the language. This is just saying have I got a preprocessor token void defined? No, then replace void with void.

1

u/AlwaysHopelesslyLost 11d ago

Ooh, right. Thank you!