PageRenderTime 22ms CodeModel.GetById 14ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/core/externals/update-engine/externals/google-toolbox-for-mac/Foundation/GTMExceptionalInlines.h

http://macfuse.googlecode.com/
C++ Header | 56 lines | 17 code | 6 blank | 33 comment | 0 complexity | 8f811ddb05d32b3d1861aa3a0aea6e15 MD5 | raw file
 1//
 2//  GTMExceptionalInlines.h
 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
19#import <Foundation/Foundation.h>
20#import "GTMDefines.h"
21#if GTM_IPHONE_SDK
22#import <CoreGraphics/CoreGraphics.h>
23#endif //  GTM_IPHONE_SDK
24
25// This file exists because when you have full warnings on you can run into
26// troubles with functions that Apple has inlined that have structures or
27// local variables defined in them.
28// You only see this warning if you have -Wuninitialized turned on,
29// and you will only see them in release mode. -Wno-unitialized turns them
30// off, but you also lose all the good warnings that come with -Wuninitialized.
31// If you have the inline versions of any of the functions below in a
32// @syncronized, or @try block, you will get
33// warning: variable 'r' might be clobbered by 'longjmp' or 'vfork'
34// By moving this local vars "out of line" you fix the problem.
35// These functions do nothing more than act as "out of line" calls to the
36// functions they are masking to avoid the warning.
37// If you run into others, feel free to add them.
38
39// Please only use these to avoid the warning above. Use the Apple defined
40// functions where possible.
41
42FOUNDATION_EXPORT NSRange GTMNSMakeRange(NSUInteger loc, NSUInteger len);
43FOUNDATION_EXPORT CFRange GTMCFRangeMake(NSUInteger loc, NSUInteger len);
44
45FOUNDATION_EXPORT CGPoint GTMCGPointMake(CGFloat x, CGFloat y);
46FOUNDATION_EXPORT CGSize GTMCGSizeMake(CGFloat width, CGFloat height);
47FOUNDATION_EXPORT CGRect GTMCGRectMake(CGFloat x, CGFloat y,
48                                       CGFloat width, CGFloat height);
49
50#if !GTM_IPHONE_SDK
51// iPhone does not have NSTypes defined, only CGTypes. So no NSRect, NSPoint etc.
52FOUNDATION_EXPORT NSPoint GTMNSMakePoint(CGFloat x, CGFloat y);
53FOUNDATION_EXPORT NSSize GTMNSMakeSize(CGFloat w, CGFloat h);
54FOUNDATION_EXPORT NSRect GTMNSMakeRect(CGFloat x, CGFloat y,
55                                       CGFloat w, CGFloat h);
56#endif