xiaoyifang / goldendict-ng

The Next Generation GoldenDict
https://xiaoyifang.github.io/goldendict-ng/
Other
1.71k stars 95 forks source link

clean: just use `#pragma once` #1919

Closed shenlebantongying closed 2 weeks ago

shenlebantongying commented 2 weeks ago

Very random, but the “include once” problem was solved perfectly for almost 4 decades ago. See Page 72 about #import of Objective-C which was invented in literally 1984 https://www.gnustep.org/resources/documentation/ObjectivCBook.pdf

Code is converted by https://github.com/cgmb/guardonce

sonarcloud[bot] commented 2 weeks ago

Quality Gate Passed Quality Gate passed

Issues
7 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

xiaoyifang commented 2 weeks ago

See Page 72 about #import of Objective-C which was invented in literally 1984

Does this rule has been applied by c++ group or standards?

shenlebantongying commented 2 weeks ago

It is not on the standard, but not having it will break at least ten millions files on just GitHub alone.

https://github.com/search?q=%22%23pragma+once%22+language%3AC%2B%2B+&type=code

It is so widely used that should be considered as a standard by itself.

The edge case is nobody's problem.