Bug 1426898 - Stop including Char16.h everywhere. r=Waldo
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Sat, 23 Dec 2017 00:53:12 +0900
changeset 449168 e9c5541886e8b7cb9960751e25e3b05f0780f6b4
parent 449167 6e072dd8d48f359d1de328bb66595a17b0d9c6a4
child 449169 b602cfc6491aeeb647f82b00a25f2e087de222c6
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs1426898
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1426898 - Stop including Char16.h everywhere. r=Waldo We had to force-include Char16.h to simulate char16_t on older MSVC versions. But it is no longer the case. We should not rebuild the world whenever we touch this file. MozReview-Commit-ID: 1XY7tQD8LoK
ipc/glue/FileDescriptor.h
media/gmp-clearkey/0.1/WMFUtils.h
mozilla-config.h.in
toolkit/xre/nsWindowsWMain.cpp
xpcom/base/nsVersionComparator.h
xpcom/string/nsCharTraits.h
xpcom/string/nsTDependentSubstring.cpp
xpcom/string/nsTStringRepr.h
--- a/ipc/glue/FileDescriptor.h
+++ b/ipc/glue/FileDescriptor.h
@@ -9,16 +9,17 @@
 
 #include "base/basictypes.h"
 #include "base/process.h"
 #include "mozilla/UniquePtr.h"
 
 #ifdef XP_WIN
 // Need the HANDLE typedef.
 #include <winnt.h>
+#include <cstdint>
 #else
 #include "base/file_descriptor_posix.h"
 #endif
 
 namespace mozilla {
 namespace ipc {
 
 // This class is used by IPDL to share file descriptors across processes. When
--- a/media/gmp-clearkey/0.1/WMFUtils.h
+++ b/media/gmp-clearkey/0.1/WMFUtils.h
@@ -21,16 +21,17 @@
 #include <string>
 
 #include <assert.h>
 #include <mfapi.h>
 #include <mferror.h>
 #include <mfobjects.h>
 #include <mftransform.h>
 #include <wmcodecdsp.h>
+#include "mozilla/Attributes.h"
 #include "VideoLimits.h"
 
 #include "gmp-platform.h"
 
 void LOG(const char* format, ...);
 
 #ifdef LOG_SAMPLE_DECODE
 #define SAMPLE_LOG LOG
--- a/mozilla-config.h.in
+++ b/mozilla-config.h.in
@@ -33,26 +33,16 @@
 #define __STDC_FORMAT_MACROS
 #endif
 
 #if defined(__clang__)
 #pragma clang diagnostic pop
 #endif
 
 /*
- * Force-include Char16.h in order to define PRUnichar as char16_t everywhere.
- * Note that this should be the first #include to make sure that prtypes.h does
- * not attempt to define PRUnichar.  This includes the following hunspell-specific
- * includes.
- */
-#if !defined(__ASSEMBLER__)
-#include "mozilla/Char16.h"
-#endif
-
-/*
  * Force-include hunspell_alloc_hooks.h and hunspell_fopen_hooks.h for hunspell,
  * so that we don't need to modify them directly.
  *
  * HUNSPELL_STATIC is defined in extensions/spellcheck/hunspell/src/Makefile.in,
  * unless --enable-system-hunspell is defined.
  */
 #if defined(HUNSPELL_STATIC)
 #include "hunspell_alloc_hooks.h"
--- a/toolkit/xre/nsWindowsWMain.cpp
+++ b/toolkit/xre/nsWindowsWMain.cpp
@@ -5,16 +5,17 @@
 // This file is a .cpp file meant to be included in nsBrowserApp.cpp and other
 // similar bootstrap code. It converts wide-character windows wmain into UTF-8
 // narrow-character strings.
 
 #ifndef XP_WIN
 #error This file only makes sense on Windows.
 #endif
 
+#include "mozilla/Char16.h"
 #include "nsUTF8Utils.h"
 #include <intrin.h>
 #include <math.h>
 
 #ifndef XRE_DONT_PROTECT_DLL_LOAD
 #include "nsSetDllDirectory.h"
 #endif
 
--- a/xpcom/base/nsVersionComparator.h
+++ b/xpcom/base/nsVersionComparator.h
@@ -2,16 +2,17 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
 #ifndef nsVersionComparator_h__
 #define nsVersionComparator_h__
 
+#include "mozilla/Char16.h"
 #include "nscore.h"
 #include <stdlib.h>
 #include <string.h>
 #include <assert.h>
 #if defined(XP_WIN) && !defined(UPDATER_NO_STRING_GLUE_STL)
 #include <wchar.h>
 #include "nsString.h"
 #endif
--- a/xpcom/string/nsCharTraits.h
+++ b/xpcom/string/nsCharTraits.h
@@ -5,18 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsCharTraits_h___
 #define nsCharTraits_h___
 
 #include <ctype.h> // for |EOF|, |WEOF|
 #include <string.h> // for |memcpy|, et al
 
-#include "nscore.h" // for |char16_t|
-
 // This file may be used (through nsUTF8Utils.h) from non-XPCOM code, in
 // particular the standalone software updater. In that case stub out
 // the macros provided by nsDebug.h which are only usable when linking XPCOM
 
 #ifdef NS_NO_XPCOM
 #define NS_WARNING(msg)
 #define NS_ASSERTION(cond, msg)
 #define NS_ERROR(msg)
--- a/xpcom/string/nsTDependentSubstring.cpp
+++ b/xpcom/string/nsTDependentSubstring.cpp
@@ -1,14 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
+#include "nsTDependentSubstring.h"
+
 template <typename T>
 void
 nsTDependentSubstring<T>::Rebind(const substring_type& str,
                                     uint32_t startPos, uint32_t length)
 {
   // If we currently own a buffer, release it.
   this->Finalize();
 
--- a/xpcom/string/nsTStringRepr.h
+++ b/xpcom/string/nsTStringRepr.h
@@ -4,16 +4,17 @@
  * 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/. */
 
 #ifndef nsTStringRepr_h
 #define nsTStringRepr_h
 
 #include <type_traits> // std::enable_if
 
+#include "mozilla/Char16.h"
 #include "nsStringFlags.h"
 #include "nsCharTraits.h"
 
 template <typename T> class nsTSubstringTuple;
 template <typename T> class nsTLiteralString;
 
 // The base for string comparators
 template <typename T> class nsTStringComparator