X-Profiler / xprofiler

🌀An addon for node.js, which supporting output performance log and real-time profiling through sampling.
Other
427 stars 57 forks source link

refactor: replace unique macro definition with program once #225

Closed hyj1991 closed 1 year ago

hyj1991 commented 1 year ago

Use

#pragma once

instead of

#ifndef XXX_H
#define XXX_H

//...

#endif
codecov[bot] commented 1 year ago

Codecov Report

Merging #225 (e063720) into master (47d814f) will not change coverage. The diff coverage is n/a.

:exclamation: Current head e063720 differs from pull request most recent head 54e8c13. Consider uploading reports for the commit 54e8c13 to get more accurate results

@@            Coverage Diff            @@
##            master      #225   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines          318       318           
=========================================
  Hits           318       318           

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

legendecas commented 1 year ago

Google C++ Style Guide 推荐用 include guard:https://google.github.io/styleguide/cppguide.html#The__define_Guard 。虽然编译器基本都支持 pragma once 但是这个不是 c++ 标准。

hyj1991 commented 1 year ago

@legendecas 不是标准那就不改了,我看到不少开源项目直接使用 #pragma once

fengmk2 commented 1 year ago

其实是事实标准吧,不会有编译器不支持。。。