diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /third_party/libwebrtc/style-guide | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/style-guide')
-rw-r--r-- | third_party/libwebrtc/style-guide/OWNERS | 1 | ||||
-rw-r--r-- | third_party/libwebrtc/style-guide/h-cc-pairs.md | 29 |
2 files changed, 30 insertions, 0 deletions
diff --git a/third_party/libwebrtc/style-guide/OWNERS b/third_party/libwebrtc/style-guide/OWNERS new file mode 100644 index 0000000000..a3ecbc9948 --- /dev/null +++ b/third_party/libwebrtc/style-guide/OWNERS @@ -0,0 +1 @@ +danilchap@webrtc.org diff --git a/third_party/libwebrtc/style-guide/h-cc-pairs.md b/third_party/libwebrtc/style-guide/h-cc-pairs.md new file mode 100644 index 0000000000..1a24e49d09 --- /dev/null +++ b/third_party/libwebrtc/style-guide/h-cc-pairs.md @@ -0,0 +1,29 @@ +# `.h` and `.cc` files come in pairs + +This is an overflow page for [this](../style-guide.md#h-cc-pairs) +style rule. + +## Example violations + +Example violations, which should be avoided in new code: + +* Declarations in `path/to/include/foo.h`, definitions in + `path/to/source/foo.cc`. **Fix:** The `.h` and `.cc` files should be + in the same directory. +* Declarations in `foo.h`, definitions in both `foo_bar.cc` and + `foo_baz.cc`. **Fix:** The `.h` and `.cc` files should come in + pairs, so either split `foo.h` into `foo_bar.h` and `foo_baz.h`, or + merge `foo_bar.cc` and `foo_baz.cc` into `foo.cc`. + +## Exception for platform-specific code + +If the functions in a header file need different implementations for +different platforms, we allow the following arrangement: + +* Declarations in `foo.h`. +* A complete set of matching definitions in `foo_win.cc`, another + complete set of matching definitions in `foo_mac.cc`, and so on. +* As per the main rule, these files should all be in the same + directory and in the same build target. The build target should use + platform conditionals to ensure that exactly one of the `.cc` files + are included. |