qxmpp-project / qxmpp

Cross-platform C++ XMPP client and server library
401 stars 197 forks source link

Replace '#ifndef QXMPP*_H' with '#pragma once' #588

Closed melvo closed 8 months ago

melvo commented 8 months ago

PR check list:

lnjX commented 8 months ago

I actually haven't replaced the header guards with #pragma once on purpose. #pragma once is afaik controversial and not every project using QXmpp might want to use it.

melvo commented 8 months ago

I actually haven't replaced the header guards with #pragma once on purpose. #pragma once is afaik controversial and not every project using QXmpp might want to use it.

@lnjX I thought using #pragma once would be the new way of doing it because you used it for the new files QXmppPubSubBaseItem.h and QXmppBlockingManager.h. What are the disadvantages?

lnjX commented 8 months ago

Sorry, I must have used pragma once in the BlockingManager and PubSubBaseItem by accident.

Using pragma once probably isn't a big problem, but I still think it's better to use include guards in a library like this. See e.g. https://stackoverflow.com/a/23699893