Hi,
personally I really dislike constructs like you used:
#ifdef WIN32if (check_if_admin)
#endif check_root(progname);
It is hard to read and may confuse editors. Can you rewrite it?
The rest looks fine to me.
Best regards,
-- Christian Kruse http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services