Browse Source

use C++ static_assert when available

Todd Whiteman 10 years ago
parent
commit
86eb5a9f6f
1 changed files with 5 additions and 0 deletions
  1. 5 0
      xpcom/src/VariantUtils.cpp

+ 5 - 0
xpcom/src/VariantUtils.cpp

@@ -2446,8 +2446,13 @@ PyXPCOM_GatewayVariantHelper::~PyXPCOM_GatewayVariantHelper()
 
 PyObject *PyXPCOM_GatewayVariantHelper::MakePyArgs()
 {
+#ifdef __cplusplus
+	static_assert(sizeof(XPTParamDescriptor) == sizeof(nsXPTParamInfo),
+	              "We depend on nsXPTParamInfo being a wrapper over the XPTParamDescriptor struct");
+#else
 	MOZ_STATIC_ASSERT(sizeof(XPTParamDescriptor) == sizeof(nsXPTParamInfo),
 	                  "We depend on nsXPTParamInfo being a wrapper over the XPTParamDescriptor struct");
+#endif
 
 	// Setup our array of Python typedescs, and determine the number of objects we
 	// pass to Python.