Skip to content

Instantly share code, notes, and snippets.

@alloy
Created January 10, 2020 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alloy/891e96241e712acaca35f212d0f31a83 to your computer and use it in GitHub Desktop.
Save alloy/891e96241e712acaca35f212d0f31a83 to your computer and use it in GitHub Desktop.
diff --git a/Libraries/Image/RCTImageLoaderWithAttributionProtocol.h b/Libraries/Image/RCTImageLoaderWithAttributionProtocol.h
index 119fb8fb5a..6840cdd57a 100644
--- a/Libraries/Image/RCTImageLoaderWithAttributionProtocol.h
+++ b/Libraries/Image/RCTImageLoaderWithAttributionProtocol.h
@@ -17,6 +17,7 @@ RCT_EXTERN void RCTEnableImageLoadingPerfInstrumentation(BOOL enabled);
@protocol RCTImageLoaderWithAttributionProtocol<RCTImageLoaderProtocol>
+#ifdef __cplusplus
/**
* Same as the variant in RCTImageURLLoaderProtocol, but allows passing attribution
* information that each image URL loader can process.
@@ -30,6 +31,8 @@ RCT_EXTERN void RCTEnableImageLoadingPerfInstrumentation(BOOL enabled);
progressBlock:(RCTImageLoaderProgressBlock)progressBlock
partialLoadBlock:(RCTImageLoaderPartialLoadBlock)partialLoadBlock
completionBlock:(RCTImageLoaderCompletionBlock)completionBlock;
+#endif
+
/**
* Image instrumentation - notify that the image content (UIImage) has been set on the native view.
*/
diff --git a/Libraries/Image/RCTImageURLLoaderWithAttribution.h b/Libraries/Image/RCTImageURLLoaderWithAttribution.h
index 3423f545fd..00e38e048c 100644
--- a/Libraries/Image/RCTImageURLLoaderWithAttribution.h
+++ b/Libraries/Image/RCTImageURLLoaderWithAttribution.h
@@ -7,6 +7,7 @@
#import <React/RCTImageURLLoader.h>
+#ifdef __cplusplus
namespace facebook {
namespace react {
@@ -17,6 +18,7 @@ struct ImageURLLoaderAttribution {
} // namespace react
} // namespace facebook
+#endif
@interface RCTImageURLLoaderRequest : NSObject
@@ -35,6 +37,7 @@ struct ImageURLLoaderAttribution {
*/
@protocol RCTImageURLLoaderWithAttribution <RCTImageURLLoader>
+#ifdef __cplusplus
/**
* Same as the RCTImageURLLoader variant above, but allows optional `attribution` information.
* Caller may also specify a preferred requestId for tracking purpose.
@@ -48,6 +51,7 @@ struct ImageURLLoaderAttribution {
progressHandler:(RCTImageLoaderProgressBlock)progressHandler
partialLoadHandler:(RCTImageLoaderPartialLoadBlock)partialLoadHandler
completionHandler:(RCTImageLoaderCompletionBlock)completionHandler;
+#endif
/**
* Image instrumentation - notify that the image content (UIImage) has been set on the native view.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment