]>
git.saurik.com Git - apple/libc.git/blob - include/secure/_strings.h
2 * Copyright (c) 2017 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
25 # error "Never use <secure/_strings.h> directly; include <strings.h> instead."
28 #ifndef _SECURE__STRINGS_H_
29 #define _SECURE__STRINGS_H_
31 #include <sys/cdefs.h>
32 #include <Availability.h>
33 #include <secure/_common.h>
35 #if _USE_FORTIFY_LEVEL > 0
39 /* Removed in Issue 7 */
40 #if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200809L
42 #if __has_builtin(__builtin___memmove_chk) || defined(__GNUC__)
44 /* void bcopy(const void *src, void *dst, size_t len) */
45 #define bcopy(src, dest, ...) \
46 __builtin___memmove_chk (dest, src, __VA_ARGS__, __darwin_obsz0 (dest))
49 #if __has_builtin(__builtin___memset_chk) || defined(__GNUC__)
51 /* void bzero(void *s, size_t n) */
52 #define bzero(dest, ...) \
53 __builtin___memset_chk (dest, 0, __VA_ARGS__, __darwin_obsz0 (dest))
58 #endif /* _USE_FORTIFY_LEVEL > 0 */
59 #endif /* _SECURE__STRINGS_H_ */