Skip to content

Commit

Permalink
Add missing #pragma once's in ReactCommon
Browse files Browse the repository at this point in the history
Summary:
## Changelog:
[Internal] -

Was writing some unit tests, accidentally included `ImageProps.h` twice (once directly and once transitively) and realized that we have a handful of files without `#pragma once`.

This fixes it for header files inside `ReactCommon`.

Reviewed By: zeyap

Differential Revision: D54258058
  • Loading branch information
rshest authored and facebook-github-bot committed Feb 27, 2024
1 parent 15f0895 commit c6f5414
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/react-native/ReactCommon/cxxreact/ErrorUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#pragma once

#include <jsi/jsi.h>

namespace facebook::react {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#pragma once

#include <memory>

#include <cxxreact/CxxModule.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
// For recoverable conditions that can be violated by user mistake (e.g. JS
// code passes an unexpected prop value), consider react_native_expect instead.

#pragma once

#include "flags.h"

#undef react_native_assert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
// will see a helpful diagnostic (beyond a low level log). That concern is the
// caller's responsibility.

#pragma once

#include "flags.h"

#undef react_native_expect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#pragma once

#include <glog/logging.h>
#include <react/renderer/animations/primitives.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#pragma once

#include <react/renderer/components/view/ViewProps.h>
#include <react/renderer/core/PropsParserContext.h>
#include <react/renderer/graphics/Color.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#pragma once

#include <folly/dynamic.h>
#include <react/renderer/components/rncore/Props.h>
#include <react/renderer/core/propsConversions.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#pragma once

#include <folly/dynamic.h>
#include <react/renderer/attributedstring/conversions.h>
#include <react/renderer/components/text/ParagraphState.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#pragma once

#include <jsi/jsi.h>

namespace facebook::react {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#pragma once

#include <ReactCommon/RuntimeExecutor.h>
#include <react/renderer/core/EventBeat.h>
#include <react/utils/RunLoopObserver.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#pragma once

#include <vector>

namespace facebook::react {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#pragma once

#include <ReactCommon/CallInvoker.h>
#include <ReactCommon/RuntimeExecutor.h>
#include <functional>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#pragma once

#include <ReactCommon/CallInvoker.h>
#include <cxxreact/MessageQueueThread.h>
#include <functional>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#pragma once

#include <ReactCommon/RuntimeExecutor.h>
#include <jsi/jsi.h>
#include <atomic>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#pragma once

#include <functional>
#include <memory>
#include <mutex>
Expand Down

0 comments on commit c6f5414

Please sign in to comment.