Enforcing semi-colon consistency between dev and release modes when calling RCTLog*
Summary: The various RCTLog macros (`RCTLogWarn`, `RCTLogError`, etc..) are based on the `_RCTLog` macro, which, in its expanded form, has a semi-colon in DEV mode (i.e., when `RCTLOG_ENABLED` is set to 1), and doesn't have one when `RCTLOG_ENABLED` is set to 0. This could lead to a situation where code will compile in DEV but will fail to compile for prod. Fixing this by removing the semicolon from the DEV version (as should). Reviewed By: javache Differential Revision: D4189133 fbshipit-source-id: 54cb4e2c96d1e48d9df88464aa58b13af432c2bd
This commit is contained in:
parent
3b4ac79583
commit
42d14bef04
|
@ -124,7 +124,7 @@ RCT_EXTERN void RCTPerformBlockWithLogPrefix(void (^block)(void), NSString *pref
|
|||
* Private logging function - ignore this.
|
||||
*/
|
||||
#if RCTLOG_ENABLED
|
||||
#define _RCTLog(lvl, ...) _RCTLogNativeInternal(lvl, __FILE__, __LINE__, __VA_ARGS__);
|
||||
#define _RCTLog(lvl, ...) _RCTLogNativeInternal(lvl, __FILE__, __LINE__, __VA_ARGS__)
|
||||
#else
|
||||
#define _RCTLog(lvl, ...) do { } while (0)
|
||||
#endif
|
||||
|
|
|
@ -219,7 +219,7 @@ RCT_EXPORT_MODULE()
|
|||
RCTAssertThread(RCTGetMethodQueue(), @"Must be executed on storage thread");
|
||||
|
||||
#if TARGET_OS_TV
|
||||
RCTLogWarn(@"Persistent storage is not supported on tvOS, your data may be removed at any point.")
|
||||
RCTLogWarn(@"Persistent storage is not supported on tvOS, your data may be removed at any point.");
|
||||
#endif
|
||||
|
||||
NSError *error = nil;
|
||||
|
|
Loading…
Reference in New Issue