It depends where he's a president of.
One of the more accepting countries would probably be France. In France it has long been known and accepted that politicians are real people who have relationships, sex lives and all that sort of thing.
In the US or with a UK PM.... Even putting aside the gay factor, it would be a bit weird for a leader to be active unless it was as part of a well established relationship (which would remove the sudden revelation factor).
France is the country where the first and only female Prime ministre, a socialist one, openly said "the english are all gay ! There must be 25% of them.
(she also said "the japanese live like ants.)
So I strongly doubt the reaction would be very different from those in America or Britain.
Of course France, like other western countries, has become openly and legally tolerant on homosexuality.
But it's probable that there would be discrimination against a gay candidate to the presidency.
The french model of head of State is virility, be it for male of female candidates.
What I think is that the whole point, in any western country, is about this question : is the gay candidate to the top office a militant of the cause or not ?
If yes, I think he or she will never win election because a large majority don't feel confortable with militants of the gay cause.
If he or she just happens to be gay, there is number 2 question : does he/she seem to be a potential great head of State or just the usual politician ?
If potential great head of State, he/she will overcome the unavowed but enduring reluctance of quite many people towards gays. If just the usual politician, he/she Will be defeated.