In the UK before 1967, any gay sex was illegal and an imprisonable offence (like Oscar Wilde), or "treated" by chemical castration (as they did with Alan Turing). The 1967 "Sexual offences Act" decriminalized gay sex in private for those over 21.
In 1994 that was reduced to 18 (even though the heterosexual age of consent was 16)
In 2000 the age of consent was equalized at 16 for both gays and heteros
There have been further amendments (such as removal of "gross misconduct" and "buggery" from the statute books), but true equality in the eyes of the law is a very recent thing indeed, as is gay marriage (2014).