Bug 794510: Part 3 - create NSPRFormatTime.h with temporarily undef'd NO_NSPR_10_SUPPORT for compatibility; r=ehsan
authorIsaac Aggrey <isaac.aggrey@gmail.com>
Thu, 11 Oct 2012 13:16:29 -0500
changeset 110683 93dc400ae049812e01e13e54144f64e8edcacc45
parent 110682 80fffd499dca98186393793a74836147683958b5
child 110684 01e26f56f07862129f9ec10ac1027b274bc4a8e2
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersehsan
bugs794510
milestone19.0a1
Bug 794510: Part 3 - create NSPRFormatTime.h with temporarily undef'd NO_NSPR_10_SUPPORT for compatibility; r=ehsan
extensions/gio/nsGIOProtocolHandler.cpp
modules/libjar/nsJARInputStream.cpp
netwerk/base/src/nsDirectoryIndexStream.cpp
netwerk/cookie/nsCookieService.cpp
netwerk/protocol/about/nsAboutBloat.cpp
netwerk/protocol/about/nsAboutCache.cpp
netwerk/protocol/about/nsAboutCacheEntry.cpp
netwerk/streamconv/converters/nsFTPDirListingConv.cpp
netwerk/test/TestProtocols.cpp
rdf/base/src/rdfutil.cpp
toolkit/xre/nsConsoleWriter.cpp
xpcom/base/Makefile.in
xpcom/base/NSPRFormatTime.h
--- a/extensions/gio/nsGIOProtocolHandler.cpp
+++ b/extensions/gio/nsGIOProtocolHandler.cpp
@@ -2,16 +2,17 @@
 /* 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/. */
 
 /*
  * This code is based on original Mozilla gnome-vfs extension. It implements
  * input stream provided by GVFS/GIO.
 */
+#include "NSPRFormatTime.h" // must include before any headers that include prtime.h
 #include "mozilla/ModuleUtils.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsIObserver.h"
 #include "nsThreadUtils.h"
 #include "nsProxyRelease.h"
 #include "nsIStringBundle.h"
 #include "nsIStandardURL.h"
--- a/modules/libjar/nsJARInputStream.cpp
+++ b/modules/libjar/nsJARInputStream.cpp
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* nsJARInputStream.cpp
  * 
  * 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 "NSPRFormatTime.h" // must include before any headers that include prtime.h
 #include "nsJARInputStream.h"
 #include "zipstruct.h"         // defines ZIP compression codes
 #include "nsZipArchive.h"
 
 #include "nsNetUtil.h"
 #include "nsEscape.h"
 #include "nsIFile.h"
 #include "nsDebug.h"
--- a/netwerk/base/src/nsDirectoryIndexStream.cpp
+++ b/netwerk/base/src/nsDirectoryIndexStream.cpp
@@ -9,16 +9,17 @@
 
   The converts a filesystem directory into an "HTTP index" stream per
   Lou Montulli's original spec:
 
   http://www.mozilla.org/projects/netlib/dirindexformat.html
 
  */
 
+#include "NSPRFormatTime.h" // must include before any headers that include prtime.h
 #include "nsEscape.h"
 #include "nsDirectoryIndexStream.h"
 #include "nsXPIDLString.h"
 #include "prio.h"
 #include "prlog.h"
 #include "prlong.h"
 #ifdef PR_LOGGING
 static PRLogModuleInfo* gLog;
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #ifdef MOZ_LOGGING
 // this next define has to appear before the include of prlog.h
 #define FORCE_PR_LOG // Allow logging in the release build
 #endif
 
+#include "NSPRFormatTime.h" // must include before any headers that include prtime.h
 #include "mozilla/net/CookieServiceChild.h"
 #include "mozilla/net/NeckoCommon.h"
 
 #include "nsCookieService.h"
 #include "nsIServiceManager.h"
 
 #include "nsIIOService.h"
 #include "nsIPrefBranch.h"
@@ -33,17 +34,16 @@
 #include "nsTArray.h"
 #include "nsCOMArray.h"
 #include "nsIMutableArray.h"
 #include "nsArrayEnumerator.h"
 #include "nsEnumeratorUtils.h"
 #include "nsAutoPtr.h"
 #include "nsReadableUtils.h"
 #include "nsCRT.h"
-#include "prtime.h"
 #include "prprf.h"
 #include "nsNetUtil.h"
 #include "nsNetCID.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsIPrivateBrowsingService.h"
 #include "nsNetCID.h"
 #include "mozilla/storage.h"
 #include "mozilla/Util.h" // for DebugOnly
--- a/netwerk/protocol/about/nsAboutBloat.cpp
+++ b/netwerk/protocol/about/nsAboutBloat.cpp
@@ -1,25 +1,25 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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 "NSPRFormatTime.h" // must include before any headers that include prtime.h
 #include "nsTraceRefcntImpl.h"
 
 // if NS_BUILD_REFCNT_LOGGING isn't defined, don't try to build
 #ifdef NS_BUILD_REFCNT_LOGGING
 
 #include "nsAboutBloat.h"
 #include "nsIIOService.h"
 #include "nsIServiceManager.h"
 #include "nsStringStream.h"
 #include "nsXPIDLString.h"
 #include "nsIURI.h"
-#include "prtime.h"
 #include "nsCOMPtr.h"
 #include "nsIFileStreams.h"
 #include "nsNetUtil.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsIFile.h"
 
 static void GC_gcollect() {}
 
--- a/netwerk/protocol/about/nsAboutCache.cpp
+++ b/netwerk/protocol/about/nsAboutCache.cpp
@@ -1,24 +1,24 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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 "NSPRFormatTime.h" // must include before any headers that include prtime.h
 #include "nsAboutCache.h"
 #include "nsIIOService.h"
 #include "nsIServiceManager.h"
 #include "nsIInputStream.h"
 #include "nsIStorageStream.h"
 #include "nsISimpleEnumerator.h"
 #include "nsXPIDLString.h"
 #include "nsIURI.h"
 #include "nsCOMPtr.h"
 #include "nsNetUtil.h"
-#include "prtime.h"
 #include "nsEscape.h"
 
 #include "nsICacheService.h"
 
 static PRTime SecondsToPRTime(uint32_t t_sec)
 {
     PRTime t_usec, usec_per_sec;
     t_usec = t_sec;
--- a/netwerk/protocol/about/nsAboutCacheEntry.cpp
+++ b/netwerk/protocol/about/nsAboutCacheEntry.cpp
@@ -1,23 +1,23 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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 <limits.h>
 
+#include "NSPRFormatTime.h" // must include before any headers that include prtime.h
 #include "nsAboutCacheEntry.h"
 #include "nsICacheService.h"
 #include "nsICacheSession.h"
 #include "nsIStorageStream.h"
 #include "nsNetUtil.h"
 #include "nsAutoPtr.h"
 #include "prprf.h"
-#include "prtime.h"
 #include "nsEscape.h"
 
 #define HEXDUMP_MAX_ROWS 16
 
 static void
 HexDump(uint32_t *state, const char *buf, int32_t n, nsCString &result)
 {
   char temp[16];
--- a/netwerk/streamconv/converters/nsFTPDirListingConv.cpp
+++ b/netwerk/streamconv/converters/nsFTPDirListingConv.cpp
@@ -1,13 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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 "NSPRFormatTime.h" // must include before any headers that include prtime.h
 #include "nsFTPDirListingConv.h"
 #include "nsMemory.h"
 #include "plstr.h"
 #include "prlog.h"
 #include "nsIServiceManager.h"
 #include "nsXPIDLString.h"
 #include "nsReadableUtils.h"
 #include "nsCOMPtr.h"
--- a/netwerk/test/TestProtocols.cpp
+++ b/netwerk/test/TestProtocols.cpp
@@ -7,16 +7,17 @@
 /* 
     The TestProtocols tests the basic protocols architecture and can 
     be used to test individual protocols as well. If this grows too
     big then we should split it to individual protocols. 
 
     -Gagan Saksena 04/29/99
 */
 
+#include "NSPRFormatTime.h" // must include before any headers that include prtime.h
 #include "TestCommon.h"
 
 #define FORCE_PR_LOG
 #include <stdio.h>
 #ifdef WIN32 
 #include <windows.h>
 #endif
 #ifdef XP_UNIX
@@ -51,17 +52,16 @@
 #include "nsChannelProperties.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/unused.h"
 
 #include "nsISimpleEnumerator.h"
 #include "nsStringAPI.h"
 #include "nsNetUtil.h"
 #include "prlog.h"
-#include "prtime.h"
 
 using namespace mozilla;
 
 namespace TestProtocols {
 
 #if defined(PR_LOGGING)
 //
 // set NSPR_LOG_MODULES=Test:5
--- a/rdf/base/src/rdfutil.cpp
+++ b/rdf/base/src/rdfutil.cpp
@@ -14,30 +14,30 @@
   1) Make this so that it doesn't permanently leak the RDF service
      object.
 
   2) Make container functions thread-safe. They currently don't ensure
      that the RDF:nextVal property is maintained safely.
 
  */
 
+#include "NSPRFormatTime.h" // must include before any headers that include prtime.h
 #include "nsCOMPtr.h"
 #include "nsIRDFDataSource.h"
 #include "nsIRDFNode.h"
 #include "nsIRDFService.h"
 #include "nsIServiceManager.h"
 #include "nsIURL.h"
 #include "nsIIOService.h"
 #include "nsIURL.h"
 #include "nsNetUtil.h"
 #include "nsRDFCID.h"
 #include "nsString.h"
 #include "nsXPIDLString.h"
 #include "nsUnicharUtils.h"
-#include "prtime.h"
 #include "rdfutil.h"
 
 ////////////////////////////////////////////////////////////////////////
 
 nsresult
 rdf_MakeRelativeRef(const nsCSubstring& aBaseURI, nsCString& aURI)
 {
     // This implementation is extremely simple: e.g., it can't compute
--- a/toolkit/xre/nsConsoleWriter.cpp
+++ b/toolkit/xre/nsConsoleWriter.cpp
@@ -1,21 +1,21 @@
 /* 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/. */
 
 #ifdef NO_NSPR_10_SUPPORT
 #undef NO_NSPR_10_SUPPORT
 #endif
 
+#include "NSPRFormatTime.h" // must include before any headers that include prtime.h
 #include "nsAppRunner.h"
 
 #include "prio.h"
 #include "prprf.h"
-#include "prtime.h"
 #include "prenv.h"
 
 #include "nsCRT.h"
 #include "nsNativeCharsetUtils.h"
 #include "nsString.h"
 #include "nsXREDirProvider.h"
 #include "nsXULAppAPI.h"
 
--- a/xpcom/base/Makefile.in
+++ b/xpcom/base/Makefile.in
@@ -61,16 +61,17 @@ EXPORTS		= \
 		nsIID.h \
 		nsISizeOf.h \
 		nsISupportsObsolete.h \
 		nsStackWalk.h \
 		nsTraceRefcntImpl.h \
 		nsWeakPtr.h \
 		nsInterfaceRequestorAgg.h \
 		nsGZFileWriter.h \
+		NSPRFormatTime.h \
 		$(NULL)
 
 EXPORTS_NAMESPACES = mozilla
 
 EXPORTS_mozilla = \
 	MapsMemoryReporter.h \
 	MemoryInfoDumper.h \
 	ClearOnShutdown.h \
new file mode 100644
--- /dev/null
+++ b/xpcom/base/NSPRFormatTime.h
@@ -0,0 +1,9 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* 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/. */
+
+// Temporarily undefine to build successfully with NO_NSPR_10_SUPPORT
+#undef NO_NSPR_10_SUPPORT
+#include "prtime.h"
+#define NO_NSPR_10_SUPPORT