commit c3bc8e9113b711e1b653b8e41f690706b688ab7e parent 04f6505d983be47cf47d6c04e69bf0002c623650 Author: serge-sans-paille <sguelton@mozilla.com> Date: Wed, 7 Jan 2026 10:13:36 +0000 Bug 2008693 - Remove unused <stddef.h> inclusion and make sure we don't regress on those r=geckoview-reviewers,media-playback-reviewers,webrtc-reviewers,padenot,ng,m_kato Differential Revision: https://phabricator.services.mozilla.com/D277977 Diffstat:
26 files changed, 10 insertions(+), 31 deletions(-)
diff --git a/browser/app/BrowserDefines.h b/browser/app/BrowserDefines.h @@ -7,7 +7,6 @@ #ifndef mozilla_BrowserDefines_h #define mozilla_BrowserDefines_h -#include <cstddef> #include "mozilla/CmdLineAndEnvUtils.h" namespace mozilla { diff --git a/dom/gamepad/GamepadManager.cpp b/dom/gamepad/GamepadManager.cpp @@ -6,8 +6,6 @@ #include "mozilla/dom/GamepadManager.h" -#include <cstddef> - #include "VRManagerChild.h" #include "mozilla/ClearOnShutdown.h" #include "mozilla/Preferences.h" diff --git a/dom/media/eme/clearkey/ClearKeyPersistence.h b/dom/media/eme/clearkey/ClearKeyPersistence.h @@ -19,7 +19,6 @@ // This include is required in order for content_decryption_module to work // on Unix systems. -#include <stddef.h> #include <functional> #include <set> diff --git a/dom/media/eme/clearkey/ClearKeySession.h b/dom/media/eme/clearkey/ClearKeySession.h @@ -19,7 +19,6 @@ // This include is required in order for content_decryption_module to work // on Unix systems. -#include <stddef.h> #include <string> #include <vector> diff --git a/dom/media/eme/clearkey/ClearKeySessionManager.h b/dom/media/eme/clearkey/ClearKeySessionManager.h @@ -19,7 +19,6 @@ // This include is required in order for content_decryption_module to work // on Unix systems. -#include <stddef.h> #include <functional> #include <map> diff --git a/dom/media/eme/clearkey/ClearKeyStorage.cpp b/dom/media/eme/clearkey/ClearKeyStorage.cpp @@ -19,7 +19,6 @@ #include <assert.h> // This include is required in order for content_decryption_module to work // on Unix systems. -#include <stddef.h> #include <vector> diff --git a/dom/media/gmp/widevine-adapter/WidevineFileIO.h b/dom/media/gmp/widevine-adapter/WidevineFileIO.h @@ -6,8 +6,6 @@ #ifndef WidevineFileIO_h_ #define WidevineFileIO_h_ -#include <stddef.h> - #include <string> #include "content_decryption_module.h" diff --git a/dom/media/webrtc/libwebrtc_overrides/modules/desktop_capture/linux/x11/x_error_trap.cc b/dom/media/webrtc/libwebrtc_overrides/modules/desktop_capture/linux/x11/x_error_trap.cc @@ -6,8 +6,6 @@ #include "modules/desktop_capture/linux/x11/x_error_trap.h" -#include <stddef.h> - #include <limits> #include "rtc_base/checks.h" diff --git a/dom/media/webrtc/transportbridge/MediaPipelineFilter.h b/dom/media/webrtc/transportbridge/MediaPipelineFilter.h @@ -12,7 +12,6 @@ #include <stdint.h> -#include <cstddef> #include <set> #include <string> #include <vector> diff --git a/extensions/spellcheck/hunspell/glue/RLBoxHunspellTypes.h b/extensions/spellcheck/hunspell/glue/RLBoxHunspellTypes.h @@ -6,7 +6,6 @@ #ifndef EXTENSIONS_SPELLCHECK_HUNSPELL_GLUE_RLBOXHUNSPELLTYPES_H_ #define EXTENSIONS_SPELLCHECK_HUNSPELL_GLUE_RLBOXHUNSPELLTYPES_H_ -#include <stddef.h> #include "mozilla/rlbox/rlbox_types.hpp" #include "hunspell_csutil.hxx" diff --git a/gfx/gl/GLTypes.h b/gfx/gl/GLTypes.h @@ -5,7 +5,6 @@ #ifndef GLTYPES_H_ #define GLTYPES_H_ -#include <stddef.h> #include <stdint.h> #ifndef GLAPIENTRY diff --git a/gfx/src/Etagere.h b/gfx/src/Etagere.h @@ -5,8 +5,6 @@ #ifndef MOZILLA_GFX_ETAGERE_H #define MOZILLA_GFX_ETAGERE_H -#include <stddef.h> - namespace Etagere { constexpr static const uint32_t FLAGS_VERTICAL_SHELVES = 1; diff --git a/hal/android/AndroidPerformanceHintManager.cpp b/hal/android/AndroidPerformanceHintManager.cpp @@ -10,7 +10,6 @@ #include "AndroidBuild.h" -#include <stddef.h> #include <stdint.h> #include <sys/types.h> diff --git a/intl/components/src/calendar/ISODate.cpp b/intl/components/src/calendar/ISODate.cpp @@ -6,7 +6,6 @@ #include "mozilla/intl/calendar/ISODate.h" #include <array> -#include <stddef.h> #include <stdint.h> namespace mozilla::intl::calendar { diff --git a/ipc/chromium/src/mojo/core/ports/node_delegate.h b/ipc/chromium/src/mojo/core/ports/node_delegate.h @@ -5,8 +5,6 @@ #ifndef MOJO_CORE_PORTS_NODE_DELEGATE_H_ #define MOJO_CORE_PORTS_NODE_DELEGATE_H_ -#include <stddef.h> - #include "mojo/core/ports/event.h" #include "mojo/core/ports/name.h" #include "mojo/core/ports/port_ref.h" diff --git a/js/src/builtin/temporal/Era.h b/js/src/builtin/temporal/Era.h @@ -11,7 +11,6 @@ #include "mozilla/MathAlgorithms.h" #include <initializer_list> -#include <stddef.h> #include <stdint.h> #include <string_view> diff --git a/js/src/builtin/temporal/Int96.cpp b/js/src/builtin/temporal/Int96.cpp @@ -12,7 +12,6 @@ #include "mozilla/Maybe.h" #include <cmath> -#include <stddef.h> #include <stdint.h> #include "jsnum.h" diff --git a/js/src/gc/GCProbes.h b/js/src/gc/GCProbes.h @@ -14,8 +14,6 @@ * from JIT code. */ -#include <stddef.h> - #include "gc/AllocKind.h" #include "js/TraceKind.h" diff --git a/js/src/jit/BaselineCacheIRCompiler.h b/js/src/jit/BaselineCacheIRCompiler.h @@ -10,7 +10,6 @@ #include "mozilla/Attributes.h" #include "mozilla/Maybe.h" -#include <stddef.h> #include <stdint.h> #include "jstypes.h" diff --git a/media/gmp-clearkey/0.1/ClearKeyCDM.h b/media/gmp-clearkey/0.1/ClearKeyCDM.h @@ -9,7 +9,6 @@ // This include is required in order for content_decryption_module to work // on Unix systems. -#include <stddef.h> #include "content_decryption_module.h" diff --git a/media/gmp-clearkey/0.1/VideoDecoder.h b/media/gmp-clearkey/0.1/VideoDecoder.h @@ -19,7 +19,6 @@ // This include is required in order for content_decryption_module to work // on Unix systems. -#include <stddef.h> #include <atomic> #include <queue> diff --git a/mozglue/baseprofiler/core/VTuneProfiler.h b/mozglue/baseprofiler/core/VTuneProfiler.h @@ -31,7 +31,6 @@ // them to the correct DLL. Through libxul these will 'magically' resolve. # include "vtune/ittnotify.h" -# include <stddef.h> # include <unordered_map> # include <string> diff --git a/tools/lint/includes/std.py b/tools/lint/includes/std.py @@ -424,6 +424,16 @@ api["type_traits"].extend( ) capi = { + "stddef.h": [ + "NULL", + "offsetof", + "size_t", + "ptrdiff_t", + "nullptr_t", + "max_align_t", + "byte", + "to_integer", + ], "stdarg.h": [ "va_list", "va_arg", diff --git a/tools/profiler/core/VTuneProfiler.h b/tools/profiler/core/VTuneProfiler.h @@ -31,7 +31,6 @@ // them to the correct DLL. Through libxul these will 'magically' resolve. # include "vtune/ittnotify.h" -# include <stddef.h> # include <unordered_map> # include <string> diff --git a/xpcom/base/nscore.h b/xpcom/base/nscore.h @@ -15,7 +15,6 @@ /** * Incorporate the integer data types which XPCOM uses. */ -#include <stddef.h> // IWYU pragma: export #include <stdint.h> // IWYU pragma: export #include "mozilla/RefCountType.h" diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_ipf64.cpp b/xpcom/reflect/xptcall/md/unix/xptcstubs_ipf64.cpp @@ -8,7 +8,6 @@ #include "xptcprivate.h" -#include <stddef.h> #include <stdint.h> // "This code is for IA64 only"