Skip to content

Commit 501c0dd

Browse files
committed
Restored __attribute__((deprecated(…))) instead of __deprecated_msg, which is only defined in iOS7 SDK (and not OSX) and made the build (and pod spec lint) fail
1 parent 61e5527 commit 501c0dd

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

OHHTTPStubs/OHHTTPStubs.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ typedef OHHTTPStubsResponse*(^OHHTTPStubsResponseBlock)(NSURLRequest* request);
103103

104104
@interface OHHTTPStubs (Deprecated)
105105

106-
typedef id OHHTTPStubsRequestHandlerID __deprecated_msg("Use OHHTTPStubsDescriptor* instead");
107-
typedef id<OHHTTPStubsDescriptor> OHHTTPStubsID __deprecated_msg("Use id<OHHTTPStubsDescriptor> instead");
106+
typedef id OHHTTPStubsRequestHandlerID __attribute__((deprecated("Use OHHTTPStubsDescriptor* instead")));
107+
typedef id<OHHTTPStubsDescriptor> OHHTTPStubsID __attribute__((deprecated("Use id<OHHTTPStubsDescriptor> instead")));
108108

109109

110110
/*! @warning This method is deprecated
@@ -117,22 +117,22 @@ typedef id<OHHTTPStubsDescriptor> OHHTTPStubsID __deprecated_msg("Use id<OHHTTPS
117117
@return an opaque object that uniquely identifies the handler and can be later used to remove it with `removeRequestHandler:`
118118
*/
119119
+(OHHTTPStubsRequestHandlerID)addRequestHandler:(OHHTTPStubsResponse*(^)(NSURLRequest* request, BOOL onlyCheck))handler
120-
__deprecated_msg("Use stubRequestsPassingTest:withStubResponse: instead");
120+
__attribute__((deprecated("Use stubRequestsPassingTest:withStubResponse: instead")));
121121

122122
/*! Remove a request handler from the list of stubs
123123
@param handlerID the opaque object that has been returned when adding the handler using `stubRequestsPassingTest:withStubResponse:`
124124
or using `addRequestHandler:`
125125
@return `YES` if the request handler has been successfully removed, `NO` if the parameter was not a valid handler identifier
126126
*/
127127
+(BOOL)removeRequestHandler:(OHHTTPStubsRequestHandlerID)handlerID
128-
__deprecated_msg("Use removeStub: instead");
128+
__attribute__((deprecated("Use removeStub: instead")));
129129

130130
/*! Remove the last added request handler from the stubs list */
131131
+(void)removeLastRequestHandler
132-
__deprecated_msg("Use removeLastStub instead");
132+
__attribute__((deprecated("Use removeLastStub instead")));
133133

134134
/*! Remove all the requests handlers from the stubs list. */
135135
+(void)removeAllRequestHandlers
136-
__deprecated_msg("Use removeAllStubs instead");
136+
__attribute__((deprecated("Use removeAllStubs instead")));
137137

138138
@end

OHHTTPStubs/OHHTTPStubsResponse+HTTPMessage.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
*/
5757
+(instancetype)responseWithHTTPMessageData:(NSData*)responseData
5858
responseTime:(NSTimeInterval)responseTime
59-
__deprecated_msg("Use responseWithHTTPMessageData: and requestTime:responseTime: instead");
59+
__attribute__((deprecated("Use responseWithHTTPMessageData: and requestTime:responseTime: instead")));
6060

6161
/*! @warning This method is deprecated
6262
@@ -74,7 +74,7 @@ __deprecated_msg("Use responseWithHTTPMessageData: and requestTime:responseTime:
7474
+(instancetype)responseNamed:(NSString*)responseName
7575
fromBundle:(NSBundle*)bundle
7676
responseTime:(NSTimeInterval)responseTime
77-
__deprecated_msg("Use responseNamed:inBundle: and requestTime:responseTime: instead");
77+
__attribute__((deprecated("Use responseNamed:inBundle: and requestTime:responseTime: instead")));
7878

7979

8080
@end

OHHTTPStubs/OHHTTPStubsResponse+JSON.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@
5454
statusCode:(int)statusCode
5555
responseTime:(NSTimeInterval)responseTime
5656
headers:(NSDictionary*)httpHeaders
57-
__deprecated_msg("Use responseWithJSONObject:statusCode:headers: and requestTime:responseTime: instead");
57+
__attribute__((deprecated("Use responseWithJSONObject:statusCode:headers: and requestTime:responseTime: instead")));
5858

5959
@end

OHHTTPStubs/OHHTTPStubsResponse.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ OHHTTPStubsDownloadSpeedWifi;
5252

5353
@property(nonatomic, strong) NSDictionary* httpHeaders;
5454
@property(nonatomic, assign) int statusCode;
55-
@property(nonatomic, strong) NSData* responseData __deprecated_msg("Will be removed in next version. Use inputSteam property instead.");
55+
@property(nonatomic, strong) NSData* responseData __attribute__((deprecated("Will be removed in next version. Use inputSteam property instead.")));
5656
@property(nonatomic, strong) NSInputStream* inputStream;
5757
@property(nonatomic, assign) unsigned long long dataSize;
5858
@property(nonatomic, assign) NSTimeInterval requestTime; //!< Defaults to 0.0
@@ -249,7 +249,7 @@ OHHTTPStubsDownloadSpeedWifi;
249249
statusCode:(int)statusCode
250250
responseTime:(NSTimeInterval)responseTime
251251
headers:(NSDictionary*)httpHeaders
252-
__deprecated_msg("Use responseWithData:statusCode:headers: + requestTime:responseTime: instead");
252+
__attribute__((deprecated("Use responseWithData:statusCode:headers: + requestTime:responseTime: instead")));
253253

254254
/*! @warning This method is deprecated
255255
@@ -270,7 +270,7 @@ __deprecated_msg("Use responseWithData:statusCode:headers: + requestTime:respons
270270
statusCode:(int)statusCode
271271
responseTime:(NSTimeInterval)responseTime
272272
headers:(NSDictionary*)httpHeaders
273-
__deprecated_msg("Use responseWithFileAtPath:statusCode:headers: + requestTime:responseTime: instead");
273+
__attribute__((deprecated("Use responseWithFileAtPath:statusCode:headers: + requestTime:responseTime: instead")));
274274

275275
/*! @warning This method is deprecated
276276
@@ -289,7 +289,7 @@ __deprecated_msg("Use responseWithFileAtPath:statusCode:headers: + requestTime:r
289289
+(instancetype)responseWithFile:(NSString*)fileName
290290
contentType:(NSString*)contentType
291291
responseTime:(NSTimeInterval)responseTime
292-
__deprecated_msg("Use responseWithFileAtPath:statusCode:headers: + requestTime:responseTime: instead");
292+
__attribute__((deprecated("Use responseWithFileAtPath:statusCode:headers: + requestTime:responseTime: instead")));
293293

294294

295295
/*! @warning This method is deprecated
@@ -310,7 +310,7 @@ __deprecated_msg("Use responseWithFileAtPath:statusCode:headers: + requestTime:r
310310
statusCode:(int)statusCode
311311
responseTime:(NSTimeInterval)responseTime
312312
headers:(NSDictionary*)httpHeaders
313-
__deprecated_msg("Use initWithData:statusCode:headers: + requestTime:responseTime: instead");
313+
__attribute__((deprecated("Use initWithData:statusCode:headers: + requestTime:responseTime: instead")));
314314

315315

316316
@end

0 commit comments

Comments
 (0)