How many African states outlaw same-sex relations? (At least 34)

After the US president urged that gay and lesbian people be treated equally under the law in Africa, media reported that same-sex relations are illegal in 36 Africa states. Is this correct?