1 | /*␊ |
2 | * Copyright (c) 2007, 2008 Apple Inc. All rights reserved.␊ |
3 | *␊ |
4 | *␊ |
5 | * This file contains Original Code and/or Modifications of Original Code␊ |
6 | * as defined in and that are subject to the Apple Public Source License␊ |
7 | * Version 2.0 (the 'License'). You may not use this file except in␊ |
8 | * compliance with the License. Please obtain a copy of the License at␊ |
9 | * http://www.opensource.apple.com/apsl/ and read it before using this␊ |
10 | * file.␊ |
11 | *␊ |
12 | * The Original Code and all software distributed under the License are␊ |
13 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER␊ |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,␊ |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,␊ |
16 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.␊ |
17 | * Please see the License for the specific language governing rights and␊ |
18 | * limitations under the License.␊ |
19 | *␊ |
20 | */␊ |
21 | ␊ |
22 | #ifndef _SECURE__COMMON_H_␊ |
23 | #define _SECURE__COMMON_H_␊ |
24 | ␊ |
25 | #undef _USE_FORTIFY_LEVEL␊ |
26 | #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0␊ |
27 | # if _FORTIFY_SOURCE > 1␊ |
28 | # define _USE_FORTIFY_LEVEL 2␊ |
29 | # else␊ |
30 | # define _USE_FORTIFY_LEVEL 1␊ |
31 | # endif␊ |
32 | #else␊ |
33 | # define _USE_FORTIFY_LEVEL 0␊ |
34 | #endif␊ |
35 | ␊ |
36 | #define __darwin_obsz0(object) __builtin_object_size (object, 0)␊ |
37 | #define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1)␊ |
38 | ␊ |
39 | #endif␊ |
40 | |