Ben Copsey

Use #ifndefs to allow overriding the settings in ASIHTTPRequestConfig in preprocessor definitions

Thanks to Duane Fields for this!
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 #import "ASIInputStream.h" 21 #import "ASIInputStream.h"
22 22
23 // Automatically set on build 23 // Automatically set on build
24 -NSString *ASIHTTPRequestVersion = @"v1.5-3 2010-01-19"; 24 +NSString *ASIHTTPRequestVersion = @"v1.5-4 2010-01-19";
25 25
26 NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain"; 26 NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain";
27 27
@@ -12,16 +12,24 @@ @@ -12,16 +12,24 @@
12 // ====== 12 // ======
13 13
14 // When set to 1 ASIHTTPRequests will print information about what a request is doing 14 // When set to 1 ASIHTTPRequests will print information about what a request is doing
15 -#define DEBUG_REQUEST_STATUS 0 15 +#ifndef DEBUG_REQUEST_STATUS
  16 + #define DEBUG_REQUEST_STATUS 0
  17 +#endif
16 18
17 // When set to 1, ASIFormDataRequests will print information about the request body to the console 19 // When set to 1, ASIFormDataRequests will print information about the request body to the console
18 -#define DEBUG_FORM_DATA_REQUEST 0 20 +#ifndef DEBUG_FORM_DATA_REQUEST
  21 + #define DEBUG_FORM_DATA_REQUEST 0
  22 +#endif
19 23
20 // When set to 1, ASIHTTPRequests will print information about bandwidth throttling to the console 24 // When set to 1, ASIHTTPRequests will print information about bandwidth throttling to the console
21 -#define DEBUG_THROTTLING 0 25 +#ifndef DEBUG_THROTTLING
  26 + #define DEBUG_THROTTLING 0
  27 +#endif
22 28
23 // When set to 1, ASIHTTPRequests will print information about persistent connections to the console 29 // When set to 1, ASIHTTPRequests will print information about persistent connections to the console
24 -#define DEBUG_PERSISTENT_CONNECTIONS 0 30 +#ifndef DEBUG_PERSISTENT_CONNECTIONS
  31 + #define DEBUG_PERSISTENT_CONNECTIONS 0
  32 +#endif
25 33
26 // ====== 34 // ======
27 // Reachability API (iPhone only) 35 // Reachability API (iPhone only)
@@ -41,6 +49,7 @@ There are two versions of Apple's Reachability class, both of which are included @@ -41,6 +49,7 @@ There are two versions of Apple's Reachability class, both of which are included
41 This config option is not used for apps targeting Mac OS X 49 This config option is not used for apps targeting Mac OS X
42 */ 50 */
43 51
44 -#define REACHABILITY_20_API 0 52 +#ifndef REACHABILITY_20_API
45 - 53 + #define REACHABILITY_20_API 0
  54 +#endif
46 55