Introduce CSSAssertSetFailFunc and CSSAsserFail to throw managed exception
Summary: - Define CSS_ASSERT_FAIL_ENABLED for P/Invoke (Visual Studio project already has it) - Pass managed delegate pointer to unmanaged side via P/Invoke. - CSSAssertFail will call the managed delegate when assert failed. - The delegate will throw managed exception. Reviewed By: emilsjolander Differential Revision: D3982084 fbshipit-source-id: 058a87c10ca89238362be4d8759cc00dd0c9b376
This commit is contained in:
committed by
Facebook Github Bot
parent
90844d62c5
commit
56f6efdecf
@@ -122,6 +122,10 @@ typedef CSSSize (*CSSMeasureFunc)(void *context,
|
||||
CSSMeasureMode heightMode);
|
||||
typedef void (*CSSPrintFunc)(void *context);
|
||||
|
||||
#ifdef CSS_ASSERT_FAIL_ENABLED
|
||||
typedef void (*CSSAssertFailFunc)(const char *message);
|
||||
#endif
|
||||
|
||||
// CSSNode
|
||||
WIN_EXPORT CSSNodeRef CSSNodeNew();
|
||||
WIN_EXPORT void CSSNodeInit(const CSSNodeRef node);
|
||||
@@ -206,4 +210,10 @@ CSS_NODE_LAYOUT_PROPERTY(float, Width);
|
||||
CSS_NODE_LAYOUT_PROPERTY(float, Height);
|
||||
CSS_NODE_LAYOUT_PROPERTY(CSSDirection, Direction);
|
||||
|
||||
#ifdef CSS_ASSERT_FAIL_ENABLED
|
||||
// Assert
|
||||
WIN_EXPORT void CSSAssertSetFailFunc(CSSAssertFailFunc func);
|
||||
WIN_EXPORT void CSSAssertFail(const char *message);
|
||||
#endif
|
||||
|
||||
CSS_EXTERN_C_END
|
||||
|
Reference in New Issue
Block a user