mongodb/mongo-perl-driver — pull request #53 by Stevie-O (2012-12-19 03:24:27+00:00)
Title: Fix for PERL-202

I hope I did all this correctly. I'm not very familiar with Git and have never used Github before today.

PERL-202 asserts that the driver doesn't build for StrawberryPerl (Windows Perl) because timegm is missing. While I can't speak to StrawberryPerl, I can confirm the fix doesn't work on ActivePerl, because MSVCRT doesn't have setenv() either!

I threw together a quick-and-dirty timegm() implementation and stuffed it into perl_mongo.c wrapped in #ifdef WIN32 / #endif.

The resulting code compiles and appears to work. Note that it still fails tests on win32, in fsync.t, because on Windows, MongoDB doesn't support async flushes. I figured I'd leave that sort of thing until next time.