diff --git a/js/src/js-config.h.in b/js/src/js-config.h.in index 82296887fb..1c0a7ef58a 100644 --- a/js/src/js-config.h.in +++ b/js/src/js-config.h.in @@ -14,16 +14,12 @@ /* Define to 1 if SpiderMonkey is in debug mode. */ #undef JS_DEBUG -/* - * NB: We have a special case for rust-bindgen, which wants to be able to - * generate both debug and release bindings on a single objdir. - */ #ifdef JS_DEBUG -#if !defined(DEBUG) && !defined(RUST_BINDGEN) +# ifndef DEBUG # error "SpiderMonkey was configured with --enable-debug, so DEBUG must be defined when including this header" # endif #else -# if defined(DEBUG) && !defined(RUST_BINDGEN) +# ifdef DEBUG # error "SpiderMonkey was configured with --disable-debug, so DEBUG must be not defined when including this header" # endif #endif diff --git a/layout/style/nsStyleCoord.h b/layout/style/nsStyleCoord.h index 3489a75c8f..bda17bbf50 100644 --- a/layout/style/nsStyleCoord.h +++ b/layout/style/nsStyleCoord.h @@ -72,7 +72,6 @@ typedef union { * the unit is a must before asking for the value in any particular * form. */ - /**
*/ class nsStyleCoord { public: // Non-reference counted calc() value. See nsStyleStruct.h for some uses @@ -263,7 +262,6 @@ private: * This is commonly used to hold the widths of the borders, margins, * or paddings of a box. */ - /**
*/ class nsStyleSides { public: nsStyleSides(); @@ -342,7 +340,6 @@ protected: * nsStyleCoord pairs. This is used to hold the dimensions of the * corners of a box (for, e.g., border-radius and outline-radius). */ - /**
*/ class nsStyleCorners { public: nsStyleCorners(); diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index 5763edfd93..c28f2bca9e 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -3831,100 +3831,4 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleEffects uint8_t mMixBlendMode; // [reset] see nsStyleConsts.h }; -#define STATIC_ASSERT_TYPE_LAYOUTS_MATCH(T1, T2) \ - static_assert(sizeof(T1) == sizeof(T2), \ - "Size mismatch between " #T1 " and " #T2); \ - static_assert(alignof(T1) == alignof(T2), \ - "Align mismatch between " #T1 " and " #T2); \ - -#define STATIC_ASSERT_FIELD_OFFSET_MATCHES(T1, T2, field) \ - static_assert(offsetof(T1, field) == offsetof(T2, field), \ - "Field offset mismatch of " #field " between " #T1 " and " #T2); \ - -/** - * These *_Simple types are used to map Gecko types to layout-equivalent but - * simpler Rust types, to aid Rust binding generation. - * - * If something in this types or the assertions below needs to change, ask - * bholley, heycam or emilio before! - * - *
- */ -struct nsPoint_Simple { - nscoord x, y; -}; - -STATIC_ASSERT_TYPE_LAYOUTS_MATCH(nsPoint, nsPoint_Simple); -STATIC_ASSERT_FIELD_OFFSET_MATCHES(nsPoint, nsPoint_Simple, x); -STATIC_ASSERT_FIELD_OFFSET_MATCHES(nsPoint, nsPoint_Simple, y); - -/** - *
- */ -struct nsMargin_Simple { - nscoord top, right, bottom, left; -}; - -STATIC_ASSERT_TYPE_LAYOUTS_MATCH(nsMargin, nsMargin_Simple); -STATIC_ASSERT_FIELD_OFFSET_MATCHES(nsMargin, nsMargin_Simple, top); -STATIC_ASSERT_FIELD_OFFSET_MATCHES(nsMargin, nsMargin_Simple, right); -STATIC_ASSERT_FIELD_OFFSET_MATCHES(nsMargin, nsMargin_Simple, bottom); -STATIC_ASSERT_FIELD_OFFSET_MATCHES(nsMargin, nsMargin_Simple, left); - -/** - *
- */ -struct nsRect_Simple { - nscoord x, y, width, height; -}; - -STATIC_ASSERT_TYPE_LAYOUTS_MATCH(nsRect, nsRect_Simple); -STATIC_ASSERT_FIELD_OFFSET_MATCHES(nsRect, nsRect_Simple, x); -STATIC_ASSERT_FIELD_OFFSET_MATCHES(nsRect, nsRect_Simple, y); -STATIC_ASSERT_FIELD_OFFSET_MATCHES(nsRect, nsRect_Simple, width); -STATIC_ASSERT_FIELD_OFFSET_MATCHES(nsRect, nsRect_Simple, height); - -/** - *
- */ -struct nsSize_Simple { - nscoord width, height; -}; - -STATIC_ASSERT_TYPE_LAYOUTS_MATCH(nsSize, nsSize_Simple); -STATIC_ASSERT_FIELD_OFFSET_MATCHES(nsSize, nsSize_Simple, width); -STATIC_ASSERT_FIELD_OFFSET_MATCHES(nsSize, nsSize_Simple, height); - -/** - *
- * - * TODO(Emilio): This is a workaround and we should be able to get rid of this - * one. - */ -template> -struct UniquePtr_Simple { - T* mPtr; -}; - -STATIC_ASSERT_TYPE_LAYOUTS_MATCH(mozilla::UniquePtr, UniquePtr_Simple); - -/** - *
- */ -template -class nsTArray_Simple { - T* mBuffer; -public: - // The existence of a destructor here prevents bindgen from deriving the Clone - // trait via a simple memory copy. - ~nsTArray_Simple() {}; -}; - -STATIC_ASSERT_TYPE_LAYOUTS_MATCH(nsTArray, - nsTArray_Simple); -STATIC_ASSERT_TYPE_LAYOUTS_MATCH(nsTArray, - nsTArray_Simple); -STATIC_ASSERT_TYPE_LAYOUTS_MATCH(nsTArray, - nsTArray_Simple); - #endif /* nsStyleStruct_h___ */ diff --git a/xpcom/glue/nsTArray.h b/xpcom/glue/nsTArray.h index 03913a3765..02cfecabd9 100644 --- a/xpcom/glue/nsTArray.h +++ b/xpcom/glue/nsTArray.h @@ -357,14 +357,6 @@ struct nsTArray_SafeElementAtHelper, Derived> } }; -// Servo bindings. -extern "C" void Gecko_EnsureTArrayCapacity(void* aArray, - size_t aCapacity, - size_t aElementSize); -extern "C" void Gecko_ClearPODTArray(void* aArray, - size_t aElementSize, - size_t aElementAlign); - MOZ_NORETURN MOZ_COLD void InvalidArrayIndex_CRASH(size_t aIndex, size_t aLength); @@ -381,10 +373,6 @@ class nsTArray_base // the same free(). template friend class nsTArray_base; - friend void Gecko_EnsureTArrayCapacity(void* aArray, size_t aCapacity, - size_t aElemSize); - friend void Gecko_ClearPODTArray(void* aTArray, size_t aElementSize, - size_t aElementAlign); protected: typedef nsTArrayHeader Header; diff --git a/xpcom/string/nsReadableUtils.cpp b/xpcom/string/nsReadableUtils.cpp index 7bbcbd0c11..518056b621 100644 --- a/xpcom/string/nsReadableUtils.cpp +++ b/xpcom/string/nsReadableUtils.cpp @@ -1366,17 +1366,3 @@ AppendUCS4ToUTF16(const uint32_t aSource, nsAString& aDest) aDest.Append(L_SURROGATE(aSource)); } } - -extern "C" { - -void Gecko_AppendUTF16toCString(nsACString* aThis, const nsAString* aOther) -{ - AppendUTF16toUTF8(*aOther, *aThis); -} - -void Gecko_AppendUTF8toString(nsAString* aThis, const nsACString* aOther) -{ - AppendUTF8toUTF16(*aOther, *aThis); -} - -} diff --git a/xpcom/string/nsSubstring.cpp b/xpcom/string/nsSubstring.cpp index b522d5c97f..8e2abd4a1b 100644 --- a/xpcom/string/nsSubstring.cpp +++ b/xpcom/string/nsSubstring.cpp @@ -350,38 +350,3 @@ nsStringBuffer::SizeOfIncludingThisEvenIfShared(mozilla::MallocSizeOf aMallocSiz static_assert(sizeof(nsStringContainer_base) == sizeof(nsSubstring), "internal and external strings must have the same size"); - -// Provide rust bindings to the nsA[C]String types -extern "C" { - -void Gecko_FinalizeCString(nsACString* aThis) -{ - aThis->~nsACString(); -} - -void Gecko_AssignCString(nsACString* aThis, const nsACString* aOther) -{ - aThis->Assign(*aOther); -} - -void Gecko_AppendCString(nsACString* aThis, const nsACString* aOther) -{ - aThis->Append(*aOther); -} - -void Gecko_FinalizeString(nsAString* aThis) -{ - aThis->~nsAString(); -} - -void Gecko_AssignString(nsAString* aThis, const nsAString* aOther) -{ - aThis->Assign(*aOther); -} - -void Gecko_AppendString(nsAString* aThis, const nsAString* aOther) -{ - aThis->Append(*aOther); -} - -} // extern "C"