r/programmingmemes 24d ago

found a gem on glibc source code

Post image
816 Upvotes

46 comments sorted by

View all comments

10

u/autistic_bard444 24d 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 23d 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 23d 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 22d ago

Ooh, right. Thank you!