Remove double underscore (__) from header include guards
ClosedPublic

Authored by kossebau on Oct 18 2018, 2:13 PM.

Details

Summary

Names containing a double underscore (__) are reserved to the
C++ implementation, so better just avoid it, even with KATE namespace.

Needs rename of global config include guards to avoid guard name clash.

Test Plan

Still builds

Diff Detail

Repository
R39 KTextEditor
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Oct 18 2018, 2:13 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptOct 18 2018, 2:13 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
kossebau requested review of this revision.Oct 18 2018, 2:13 PM
cullmann accepted this revision.Oct 18 2018, 2:16 PM
cullmann added a subscriber: cullmann.

Yep, makes sense!

This revision is now accepted and ready to land.Oct 18 2018, 2:16 PM
This revision was automatically updated to reflect the committed changes.

It could have just gone #pramga once

It could have just gone #pramga once

conjunctive "could" -> not specified in KF policies if possible.

Seems even Qt devs are undecided about it and rejected it again, so myself tend to avoid for now. As much as something like it is desired.

In certain instances #pragma once fails when using MSVC, while traditional #define include guards are fully reliable.

fyi, krazy in strict mode will check for leading and trailing underscores on the include guards.
I don't run krazy in strict mode on the EBN, however.

I could make this a standard check if we want so the EBN would pick it up too.

Thanks!

Qt decided against #pragma once. I wouldn't want to use it in KDE unless it is decided on kde-frameworks-devel.