Backout changeset 310e29c26ea3 (bug 798564) for breaking Windows builds
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 11 Oct 2012 12:12:09 -0400
changeset 110092 a27a41c7d7e31a6ee0fcff77f2052e5fe4b6b85d
parent 110091 9bebe479b5ba2907285ebf4faa87a8cedea4bbff
child 110093 e1d8fe98998083eadf2546ed049b648fc2a5133a
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
bugs798564
milestone19.0a1
backs out310e29c26ea3e6ec89770c2ae5428b67c0412467
Backout changeset 310e29c26ea3 (bug 798564) for breaking Windows builds
modules/libmar/src/mar.h
modules/libmar/src/mar_cmdline.h
modules/libmar/src/mar_private.h
--- a/modules/libmar/src/mar.h
+++ b/modules/libmar/src/mar.h
@@ -3,16 +3,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/. */
 
 #ifndef MAR_H__
 #define MAR_H__
 
 /* We use NSPR here just to import the definition of uint32_t */
+#include "prtypes.h"
 #include "mozilla/StandardInteger.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 struct ProductInformationBlock {
   const char *MARChannelID;
--- a/modules/libmar/src/mar_cmdline.h
+++ b/modules/libmar/src/mar_cmdline.h
@@ -1,16 +1,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/. */
 
 #ifndef MAR_CMDLINE_H__
 #define MAR_CMDLINE_H__
 
 /* We use NSPR here just to import the definition of uint32_t */
+#include "prtypes.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 struct ProductInformationBlock;
 
 /**
--- a/modules/libmar/src/mar_private.h
+++ b/modules/libmar/src/mar_private.h
@@ -2,20 +2,25 @@
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* 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 MAR_PRIVATE_H__
 #define MAR_PRIVATE_H__
 
+#include "prtypes.h"
 #include "limits.h"
-#include "mozilla/Assertions.h"
 #include "mozilla/StandardInteger.h"
 
+/* Code in this module requires a guarantee that the size
+   of uint32_t and uint64_t are 4 and 8 bytes respectively. */
+PR_STATIC_ASSERT(sizeof(uint32_t) == 4);
+PR_STATIC_ASSERT(sizeof(uint64_t) == 8);
+
 #define BLOCKSIZE 4096
 #define ROUND_UP(n, incr) (((n) / (incr) + 1) * (incr))
 
 #define MAR_ID "MAR1"
 #define MAR_ID_SIZE 4
 
 /* The signature block comes directly after the header block 
    which is 16 bytes */
@@ -26,24 +31,22 @@
 #define MAX_SIGNATURES 8
 
 /* Make sure the file is less than 500MB.  We do this to protect against
    invalid MAR files. */
 #define MAX_SIZE_OF_MAR_FILE ((int64_t)524288000)
 
 /* Existing code makes assumptions that the file size is
    smaller than LONG_MAX. */
-MOZ_STATIC_ASSERT(MAX_SIZE_OF_MAR_FILE < ((int64_t)LONG_MAX),
-                  "max mar file size is too big");
+PR_STATIC_ASSERT(MAX_SIZE_OF_MAR_FILE < ((int64_t)LONG_MAX));
 
 /* We store at most the size up to the signature block + 4 
    bytes per BLOCKSIZE bytes */
-MOZ_STATIC_ASSERT(sizeof(BLOCKSIZE) < \
-                  (SIGNATURE_BLOCK_OFFSET + sizeof(uint32_t)),
-                  "BLOCKSIZE is too big");
+PR_STATIC_ASSERT(sizeof(BLOCKSIZE) < \
+  (SIGNATURE_BLOCK_OFFSET + sizeof(uint32_t)));
 
 /* The maximum size of any signature supported by current and future
    implementations of the signmar program. */
 #define MAX_SIGNATURE_LENGTH 2048
 
 /* Each additional block has a unique ID.  
    The product information block has an ID of 1. */
 #define PRODUCT_INFO_BLOCK_ID 1