Skip to content

Instantly share code, notes, and snippets.

@dx7
Created March 8, 2014 02:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dx7/9424562 to your computer and use it in GitHub Desktop.
Save dx7/9424562 to your computer and use it in GitHub Desktop.
Ternário do stdio.h
/*
* This has been tuned to generate reasonable code on the vax using pcc.
*/
#define __sputc(c, p) \
(--(p)->_w < 0 ? \
(p)->_w >= (p)->_lbfsize ? \
(*(p)->_p = (c)), *(p)->_p != '\n' ? \
(int)*(p)->_p++ : \
__swbuf('\n', p) : \
__swbuf((int)(c), p) : \
(*(p)->_p = (c), (int)*(p)->_p++))
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment