Actually no software rewrite is needed because the Berkeley Sockets API is agnostic to address format. If your software requires a particular address format, that's a bug. if you pass an IPv6 literal to getaddrinfo, you get a result with an IPv6 address structure and it tells you the IPv6 socket type you need to connect to it.
getaddrinfo was added after ipv6. Software had to be rewritten to use getaddrinfo.
Prior to that programs used gethostbyname() etc, which only works with ipv4.