This commit is contained in:
Yamozha
2021-04-02 02:24:13 +03:00
parent c23950b545
commit 7256d79e2c
31493 changed files with 3036630 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
Checks: '>
clang-diagnostic-*,
'
...

57
node_modules/react-native/ReactCommon/better/BUCK generated vendored Normal file
View File

@ -0,0 +1,57 @@
load("@fbsource//tools/build_defs/apple:flag_defs.bzl", "get_preprocessor_flags_for_build_mode")
load(
"//tools/build_defs/oss:rn_defs.bzl",
"ANDROID",
"APPLE",
"CXX",
"get_apple_compiler_flags",
"get_apple_inspector_flags",
"rn_xplat_cxx_library",
"subdir_glob",
)
APPLE_COMPILER_FLAGS = get_apple_compiler_flags()
rn_xplat_cxx_library(
name = "better",
srcs = glob(
["**/*.cpp"],
exclude = glob(["tests/**/*.cpp"]),
),
headers = glob(
["**/*.h"],
exclude = glob(["tests/**/*.h"]),
),
header_namespace = "",
exported_headers = subdir_glob(
[
("", "*.h"),
],
prefix = "better",
),
compiler_flags = [
"-fexceptions",
"-frtti",
"-std=c++14",
"-Wall",
],
fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"],
fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(),
force_static = True,
macosx_tests_override = [],
platforms = (ANDROID, APPLE, CXX),
preprocessor_flags = [
"-DLOG_TAG=\"ReactNative\"",
"-DWITH_FBSYSTRACE=1",
],
tests = [],
visibility = ["PUBLIC"],
deps = [
"//xplat/fbsystrace:fbsystrace",
"//xplat/folly:headers_only",
"//xplat/folly:memory",
"//xplat/folly:molly",
"//xplat/third-party/glog:glog",
],
)

62
node_modules/react-native/ReactCommon/better/better.h generated vendored Normal file
View File

@ -0,0 +1,62 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
namespace facebook {
namespace better {
/*
* `Better` is a trivial collection of basic tools borrowed from other low-level
* general purpose libraries (like Folly, Abseil or Boost). The main goals of
* Better:
* - Make the codebase more portable;
* - Make the dependency list explicit (by decoupling it as a dependency list of
* Better);
* - Make relying on modern C++ patterns and tools in code simple and easy.
* - Make executing experiments with different dependencies easier.
*
* What should be part of Better and what should not? Should I add some piece of
* functionality in the Better? Here is a quick checklist.
*
* If one of the following is true, yes, go for it:
* - If some feature is already in some future C++ standard (possibly in draft
* stage) and it's already implemented in some 3rd party library.
* - If some standardized feature of C++ is implemented in the standard not in
* the most efficient way (because the standard enforces some tricky constraints
* (like always-valid iterators) which nobody uses and should use), but you have
* a library that does it right providing exact same interface.
*
* If one of the following is true, please do *NOT* do it (at least as part of
* the library):
* - You want to use some very fancy pattern that your favorite library (but
* nothing else) provides, and You want to make this pattern very command in the
* code base. Your hope is that this pattern will conquer the world and be
* a part of the C++ standard eventually.
* - You favorite library provides some general purpose container that 10x times
* faster than the standard one, so You want to use that in the code base. That
* container does not have compatible API though (because it's a clear trade-off
* with efficiency, of course).
*/
/*
* Configuration
*/
/*
* Enables using Folly containers instead of standard ones (such as map, vector,
* small_vector, optional and etc.)
* Custom containers are only enabled in release mode. Using custom stuff
* complicates debugging process because it breaks embedded into IDE
* introspections mechanisms.
*/
#ifndef DEBUG
#define BETTER_USE_FOLLY_CONTAINERS
#endif
} // namespace better
} // namespace facebook

45
node_modules/react-native/ReactCommon/better/map.h generated vendored Normal file
View File

@ -0,0 +1,45 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <better/better.h>
#ifdef BETTER_USE_FOLLY_CONTAINERS
#include <folly/container/F14Map.h>
#else
#include <unordered_map>
#endif
namespace facebook {
namespace better {
/*
* Note: In Better, `map` aliases to `unorderd_map` because everyone agrees that
* an *ordered* map is nonsense and was a huge mistake for standardization. If
* you need an *ordered* map, feel free to introduce that as
* `better::ordered_map`.
*/
#ifdef BETTER_USE_FOLLY_CONTAINERS
template <typename... Ts>
using map = folly::F14FastMap<Ts...>;
#else
template <typename... Ts>
using map = std::unordered_map<Ts...>;
#endif
} // namespace better
} // namespace facebook

20
node_modules/react-native/ReactCommon/better/mutex.h generated vendored Normal file
View File

@ -0,0 +1,20 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <folly/SharedMutex.h>
#include <mutex>
#include <shared_mutex>
namespace facebook {
namespace better {
using shared_mutex = folly::SharedMutex;
} // namespace better
} // namespace facebook

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <better/better.h>
#if defined(BETTER_USE_FOLLY_CONTAINERS) || __cplusplus < 202000L
#include <folly/Optional.h>
#else
#include <optional>
#endif
namespace facebook {
namespace better {
#if defined(BETTER_USE_FOLLY_CONTAINERS) || __cplusplus < 202000L
template <typename Value>
using optional = folly::Optional<Value>;
#else
template <typename Value>
using optional = std::optional<Value>;
#endif
} // namespace better
} // namespace facebook

38
node_modules/react-native/ReactCommon/better/set.h generated vendored Normal file
View File

@ -0,0 +1,38 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <better/better.h>
#ifdef BETTER_USE_FOLLY_CONTAINERS
#include <folly/container/F14Set.h>
#else
#include <unordered_set>
#endif
namespace facebook {
namespace better {
#ifdef BETTER_USE_FOLLY_CONTAINERS
template <typename... Ts>
using set = folly::F14FastSet<Ts...>;
#else
template <typename... Ts>
using set = std::unordered_set<Ts...>;
#endif
} // namespace better
} // namespace facebook

View File

@ -0,0 +1,39 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <better/better.h>
// `folly::small_vector` is broken on some versions of Android.
#if defined(BETTER_USE_FOLLY_CONTAINERS) && !defined(ANDROID)
#include <folly/small_vector.h>
#else
#include <vector>
#endif
namespace facebook {
namespace better {
#if defined(BETTER_USE_FOLLY_CONTAINERS) && !defined(ANDROID)
template <typename T, std::size_t Size, typename... Ts>
using small_vector = folly::small_vector<T, Size, Ts...>;
#else
template <typename T, std::size_t Size, typename... Ts>
using small_vector = std::vector<T, Ts...>;
#endif
} // namespace better
} // namespace facebook