/core/externals/google-toolbox-for-mac/Foundation/GTMExceptionalInlines.m

http://macfuse.googlecode.com/ · Objective C · 56 lines · 27 code · 11 blank · 18 comment · 0 complexity · 094d4ebc143a69a79be54b2fc747a479 MD5 · raw file

  1. //
  2. // GTMExceptionalInlines.m
  3. //
  4. // Copyright 2008 Google Inc.
  5. //
  6. // Licensed under the Apache License, Version 2.0 (the "License"); you may not
  7. // use this file except in compliance with the License. You may obtain a copy
  8. // of the License at
  9. //
  10. // http://www.apache.org/licenses/LICENSE-2.0
  11. //
  12. // Unless required by applicable law or agreed to in writing, software
  13. // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  14. // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  15. // License for the specific language governing permissions and limitations under
  16. // the License.
  17. //
  18. #import "GTMExceptionalInlines.h"
  19. NSRange GTMNSMakeRange(NSUInteger loc, NSUInteger len) {
  20. return NSMakeRange(loc, len);
  21. }
  22. CFRange GTMCFRangeMake(NSUInteger loc, NSUInteger len) {
  23. return CFRangeMake(loc, len);
  24. }
  25. CGPoint GTMCGPointMake(CGFloat x, CGFloat y) {
  26. return CGPointMake(x, y);
  27. }
  28. CGSize GTMCGSizeMake(CGFloat width, CGFloat height) {
  29. return CGSizeMake(width, height);
  30. }
  31. CGRect GTMCGRectMake(CGFloat x, CGFloat y, CGFloat width, CGFloat height) {
  32. return CGRectMake(x, y, width, height);
  33. }
  34. #if !GTM_IPHONE_SDK
  35. // iPhone does not have NSTypes defined, only CGTypes. So no NSRect, NSPoint etc.
  36. NSPoint GTMNSMakePoint(CGFloat x, CGFloat y) {
  37. return NSMakePoint(x, y);
  38. }
  39. NSSize GTMNSMakeSize(CGFloat w, CGFloat h) {
  40. return NSMakeSize(w, h);
  41. }
  42. NSRect GTMNSMakeRect(CGFloat x, CGFloat y, CGFloat w, CGFloat h) {
  43. return NSMakeRect(x, y, w, h);
  44. }
  45. #endif