Eliminate Assertions.h's dependency on Types.h, for a narrower interface and minimized dependencies. No bug, r=Ms2ger
Eliminate Assertions.h's dependency on Types.h, for a narrower interface and minimized dependencies. No bug, r=Ms2ger
--- a/mfbt/Assertions.h
+++ b/mfbt/Assertions.h
@@ -4,18 +4,18 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* Implementations of runtime and static assertion macros for C and C++. */
#ifndef mozilla_Assertions_h_
#define mozilla_Assertions_h_
#include "mozilla/Attributes.h"
-#include "mozilla/Types.h"
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef WIN32
/*
* TerminateProcess and GetCurrentProcess are defined in <winbase.h>, which
* further depends on <windef.h>. We hardcode these few definitions manually
* because those headers clutter the global namespace with a significant
* number of undesired macros and symbols.
--- a/mfbt/HashFunctions.cpp
+++ b/mfbt/HashFunctions.cpp
@@ -1,16 +1,17 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* Implementations of hash functions. */
#include "mozilla/HashFunctions.h"
+#include "mozilla/Types.h"
#include <string.h>
namespace mozilla {
MFBT_API(uint32_t)
HashBytes(const void* bytes, size_t length)
{
--- a/mfbt/HashFunctions.h
+++ b/mfbt/HashFunctions.h
@@ -43,16 +43,17 @@
*/
#ifndef mozilla_HashFunctions_h_
#define mozilla_HashFunctions_h_
#include "mozilla/Assertions.h"
#include "mozilla/Attributes.h"
#include "mozilla/StandardInteger.h"
+#include "mozilla/Types.h"
#ifdef __cplusplus
namespace mozilla {
/**
* The golden ratio as a 32-bit fixed-point value.
*/
static const uint32_t GoldenRatioU32 = 0x9E3779B9U;