From eca51eb46a47112c8933d0a3b932f59008cadc78 Mon Sep 17 00:00:00 2001 From: Max Sherman Date: Thu, 14 Dec 2017 14:32:31 -0800 Subject: [PATCH] Type global hooks as function pointers Reviewed By: danzimm Differential Revision: D6568053 fbshipit-source-id: 94fdecaf066a36c9c916bbd7b23c2f0680d91895 --- ReactCommon/cxxreact/Platform.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ReactCommon/cxxreact/Platform.h b/ReactCommon/cxxreact/Platform.h index 6d1ce2561..c8a63c746 100644 --- a/ReactCommon/cxxreact/Platform.h +++ b/ReactCommon/cxxreact/Platform.h @@ -31,7 +31,11 @@ enum ReactMarkerId { NATIVE_MODULE_SETUP_STOP, }; +#ifdef __APPLE__ using LogTaggedMarker = std::function; +#else +typedef void(*LogTaggedMarker)(const ReactMarkerId, const char* tag); +#endif extern RN_EXPORT LogTaggedMarker logTaggedMarker; extern void logMarker(const ReactMarkerId markerId); @@ -50,7 +54,7 @@ using Hook = JSValueRef(*)( extern RN_EXPORT Hook loggingHook; extern RN_EXPORT Hook nowHook; -using ConfigurationHook = std::function; +typedef void(*ConfigurationHook)(JSGlobalContextRef); extern RN_EXPORT ConfigurationHook installPerfHooks; }