title: support gmtime_r, timegm functions on windows mingw32
body: <p>I am trying to build legacy C program under Windows using mingw32 port.
  But gcc compiller informs me about next errors:</p>
  
  <pre><code>gmtime_r(const time_t*, struct tm*); //implicit declaration of function 
  timegm(struct tm*); //implicit declaration of function 
  </code></pre>
  
  <p>I tried to declare <code>_mkgmtime</code> as suggested <a href="https://stackoverflow.com/a/29411795">here</a> but then I get the same error about declaration.
  I also tried to declare <code>gmtime_r</code> based on <code>gmtime_s</code> as descibed <a href="https://github.com/nanomsg/nanomsg/issues/530" rel="nofollow noreferrer">here</a> but is seems that mingw does not support <code>gmtime_s</code> as well.</p>
  
  <p>Is there any idea? Might need to replace them to some equivalents?</p>
  
  <p>mingw-32 gcc 5.3.0-3
  windows 7</p>