nail.h: adjust really_rewind(): POSIX Issue 7 defined a way..
commite0504b35f6fdcdb129cec9ad63ef4de4752b9be7
authorSteffen (Daode) Nurpmeso <sdaoden@users.sf.net>
Mon, 3 Mar 2014 19:16:02 +0000 (3 20:16 +0100)
committerSteffen (Daode) Nurpmeso <sdaoden@users.sf.net>
Tue, 4 Mar 2014 12:44:11 +0000 (4 13:44 +0100)
tree54663c1aea871b1adac0129c8ecad8104a7a2791
parent6b394c7204866a0f02cc16532c7cbad6d8eb457d
nail.h: adjust really_rewind(): POSIX Issue 7 defined a way..

Oh!  I was much too loud stating things on "fucking standard I/O"
and "no standard way to do this"!
Instead, POSIX Issue 7 overloaded the fflush(3) function:

  [CX] For a stream open for reading, if the file is not already at
  EOF, and the file is one capable of seeking, the file offset of
  the underlying open file description shall be set to the file
  position of the stream, and any characters pushed back onto the
  stream by ungetc() or ungetwc() that have not subsequently been
  read from the stream shall be discarded (without further changing
  the file offset).

So use the hack unless _POSIX_VERSION>=200809L, then do the
standard-defined 'rewind()+fflush()'.
I still hope i'll be able to replace that with our own homebrew
layer somewhen in the future.
nail.h