Bug 1438257, part 4 - Remove duplicate definition of nsID.h. r=froydnj draft
authorAndrew McCreight <continuation@gmail.com>
Wed, 14 Feb 2018 10:18:36 -0800
changeset 754982 fda6a589a253ddae67773632a44d5ee54c992b98
parent 754981 76c146643e7a0535fcf7716377a7a7f15a28152a
push id99082
push userbmo:continuation@gmail.com
push dateWed, 14 Feb 2018 19:47:59 +0000
reviewersfroydnj
bugs1438257
milestone60.0a1
Bug 1438257, part 4 - Remove duplicate definition of nsID.h. r=froydnj Now that this file is all C++, we don't need to duplicate it. MozReview-Commit-ID: 8nlcGLMnuzV
xpcom/typelib/xpt/xpt_struct.h
--- a/xpcom/typelib/xpt/xpt_struct.h
+++ b/xpcom/typelib/xpt/xpt_struct.h
@@ -7,16 +7,17 @@
  * Structures matching the in-memory representation of typelib structures.
  * http://www.mozilla.org/scriptable/typelib_file.html
  */
 
 #ifndef __xpt_struct_h__
 #define __xpt_struct_h__
 
 #include "xpt_arena.h"
+#include "nsID.h"
 #include <stdint.h>
 
 /*
  * Originally, I was going to have structures that exactly matched the on-disk
  * representation, but that proved difficult: different compilers can pack
  * their structs differently, and that makes overlaying them atop a
  * read-from-disk byte buffer troublesome.  So now I just have some structures
  * that are used in memory, and we're going to write a nice XDR library to
@@ -29,32 +30,16 @@ struct XPTHeader;
 struct XPTInterfaceDirectoryEntry;
 struct XPTInterfaceDescriptor;
 struct XPTConstDescriptor;
 struct XPTMethodDescriptor;
 struct XPTParamDescriptor;
 struct XPTTypeDescriptor;
 struct XPTTypeDescriptorPrefix;
 
-#ifndef nsID_h__
-/*
- * We can't include nsID.h, because it's full of C++ goop and we're not doing
- * C++ here, so we define our own minimal struct.  We protect against multiple
- * definitions of this struct, though, and use the same field naming.
- */
-struct nsID {
-    uint32_t m0;
-    uint16_t m1;
-    uint16_t m2;
-    uint8_t  m3[8];
-};
-
-typedef struct nsID nsID;
-#endif
-
 /*
  * Every XPCOM typelib file begins with a header.
  */
 struct XPTHeader {
     // Some of these fields exists in the on-disk format but don't need to be
     // stored in memory (other than very briefly, which can be done with local
     // variables).