Bug 1426898 - Stop including Char16.h everywhere. r?froydnj draft
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Sat, 23 Dec 2017 00:53:12 +0900
changeset 714426 94f6e56fa729f45051ff76c9f7147ea596a71b41
parent 714423 9e5a0ad5f7da24420ab54bb4cf1099c03c41dd77
child 744587 7efaf321b78014f41bfe8186d574ee8c9152bb19
push id93920
push userVYV03354@nifty.ne.jp
push dateSat, 23 Dec 2017 01:29:44 +0000
reviewersfroydnj
bugs1426898
milestone59.0a1
Bug 1426898 - Stop including Char16.h everywhere. r?froydnj 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