title: What is the Windows XP equivalent of inet_pton or InetPton?
body: <p>I need to determine whether a particular string is a valid IPv4 or IPv6 address literal. If I understand correctly, the correct way to do this on POSIX systems is to use <code>inet_pton</code> to convert it into a network address structure and see if it succeeds. Windows Vista and later have <code>InetPton</code> which does essentially the same thing. But as far as I can tell, Windows XP doesn't declare either of those, and I need to be able to do this correctly on XP. So, the question is what system function to use to do this?</p>
  
  <p>Worst case, I can write a function to parse it myself, but I'd prefer a standard, system function which has therefore been thoroughly tested and properly handles all corner cases and whatnot. It's already bad enough that Microsoft couldn't just declare <code>inet_pton</code> like everyone else and went with <code>InetPton</code> for their newer OSes.</p>