Fix ENABLE_INSPECTOR ifdef not found during dev

Reviewed By: bnham

Differential Revision: D5680963

fbshipit-source-id: d38c4575387ba58e3819f5aa5c35078ed8ed3e87
This commit is contained in:
Paco Estevez Garcia 2017-08-24 10:39:13 -07:00 committed by Facebook Github Bot
parent 0b17524134
commit edf60ce640
3 changed files with 11 additions and 5 deletions

View File

@ -14,7 +14,7 @@
#import "RCTConvert.h" #import "RCTConvert.h"
#import "RCTEventDispatcher.h" #import "RCTEventDispatcher.h"
#if ENABLE_INSPECTOR #if RCT_ENABLE_INSPECTOR
#import "RCTInspectorDevServerHelper.h" #import "RCTInspectorDevServerHelper.h"
#endif #endif
#import "RCTJSEnvironment.h" #import "RCTJSEnvironment.h"
@ -258,7 +258,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
- (void)reload - (void)reload
{ {
#if ENABLE_INSPECTOR #if RCT_ENABLE_INSPECTOR
// Disable debugger to resume the JsVM & avoid thread locks while reloading // Disable debugger to resume the JsVM & avoid thread locks while reloading
[RCTInspectorDevServerHelper disableDebugger]; [RCTInspectorDevServerHelper disableDebugger];
#endif #endif

View File

@ -48,6 +48,14 @@
#endif #endif
#endif #endif
#ifndef RCT_ENABLE_INSPECTOR
#if RCT_DEV && __has_include(<React/RCTInspectorDevServerHelper.h>)
#define RCT_ENABLE_INSPECTOR 1
#else
#define RCT_ENABLE_INSPECTOR 0
#endif
#endif
#if RCT_DEV #if RCT_DEV
#define RCT_IF_DEV(...) __VA_ARGS__ #define RCT_IF_DEV(...) __VA_ARGS__
#else #else

View File

@ -42,9 +42,7 @@ static NSString *const kRCTDevSettingsUserDefaultsKey = @"RCTDevMenu";
#import "RCTPackagerConnection.h" #import "RCTPackagerConnection.h"
#endif #endif
#define ENABLE_INSPECTOR RCT_DEV && __has_include("RCTInspectorDevServerHelper.h") #if RCT_ENABLE_INSPECTOR
#if ENABLE_INSPECTOR
#import "RCTInspectorDevServerHelper.h" #import "RCTInspectorDevServerHelper.h"
#endif #endif