MYErrorUtils.m
changeset 27 256370e8935a
parent 25 47d10ac2d04e
child 29 8874aff14cc9
     1.1 --- a/MYErrorUtils.m	Sun Apr 12 22:00:36 2009 -0700
     1.2 +++ b/MYErrorUtils.m	Sun May 03 10:13:31 2009 -0700
     1.3 @@ -10,7 +10,10 @@
     1.4  #import "Test.h"
     1.5  #import "CollectionUtils.h"
     1.6  #import <Foundation/Foundation.h>
     1.7 +
     1.8 +#if USE_SECURITY_API
     1.9  #import <Security/SecBase.h>
    1.10 +#endif
    1.11  
    1.12  
    1.13  NSString* const MYErrorDomain = @"MYErrorDomain";
    1.14 @@ -134,12 +137,14 @@
    1.15          if (name && *name)
    1.16              result = [NSString stringWithCString: name encoding: NSMacOSRomanStringEncoding];
    1.17          else {
    1.18 +#if USE_SECURITY_API
    1.19              result = (id) SecCopyErrorMessageString(code,NULL);
    1.20              if (result) {
    1.21                  [(id)CFMakeCollectable(result) autorelease];
    1.22                  if ([result hasPrefix: @"OSStatus "])
    1.23                      result = nil; // just a generic message
    1.24              }
    1.25 +#endif
    1.26          }
    1.27      }
    1.28  #endif