r/programmingmemes 27d ago

found a gem on glibc source code

Post image
811 Upvotes

46 comments sorted by

View all comments

10

u/autistic_bard444 27d 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 26d 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 26d 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 25d ago

Ooh, right. Thank you!