X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/59e0d9fe772464b93d835d2a2964457702469a43..70ad1dc8a19d6edd9b97aa81f32cfd65758ae97d:/include/_types.h diff --git a/include/_types.h b/include/_types.h index 731e9c8..83cd510 100644 --- a/include/_types.h +++ b/include/_types.h @@ -1,10 +1,8 @@ /* - * Copyright (c) 1999-2000 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2004, 2008, 2009 Apple Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * - * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. - * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -27,55 +25,45 @@ #define __TYPES_H_ #include -#include +#include /* __uint32_t */ -/* - * XXX - This block will eventually be relocated into sys/_types.h (or - * into a header it calls. It is here temporarily to work can proceed - * on the Libc part - */ -#ifndef __OSX_NULL -#ifdef __GNUG__ -#define __OSX_NULL __null -#else /* ! __GNUG__ */ -#ifndef __cplusplus -#define __OSX_NULL ((void *)0) -#else /* __cplusplus */ -#define __OSX_NULL 0 -#endif /* ! __cplusplus */ -#endif /* __GNUG__ */ +#if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7 +#define __strfmonlike(fmtarg, firstvararg) \ + __attribute__((__format__ (__strfmon__, fmtarg, firstvararg))) +#define __strftimelike(fmtarg) \ + __attribute__((__format__ (__strftime__, fmtarg, 0))) +#else +#define __strfmonlike(fmtarg, firstvararg) +#define __strftimelike(fmtarg) +#endif -// XXX - renaming from sys/_types.h -typedef __mode_t __osx_mode_t; -typedef __off_t __osx_off_t; -typedef __size_t __osx_size_t; -typedef __pid_t __osx_pid_t; -typedef __gid_t __osx_gid_t; -#endif /* XXX - ! __OSX_NULL */ - -typedef _BSD_CT_RUNE_T_ __osx_ct_rune_t; -typedef _BSD_MBSTATE_T_ __osx_mbstate_t; -typedef int __osx_nl_item; -#ifdef _BSD_PTRDIFF_T_ -typedef _BSD_PTRDIFF_T_ __osx_ptrdiff_t; -#endif /* _BSD_PTRDIFF_T_ */ -typedef _BSD_RUNE_T_ __osx_rune_t; -#ifdef __WCHAR_TYPE__ -typedef __WCHAR_TYPE__ __osx_wchar_t; -#else /* ! __WCHAR_TYPE__ */ -typedef _BSD_WCHAR_T_ __osx_wchar_t; -#endif /* __WCHAR_TYPE__ */ -typedef int __osx_wctrans_t; -typedef unsigned long __osx_wctype_t; -typedef _BSD_WINT_T_ __osx_wint_t; +typedef int __darwin_nl_item; +typedef int __darwin_wctrans_t; +#ifdef __LP64__ +typedef __uint32_t __darwin_wctype_t; +#else /* !__LP64__ */ +typedef unsigned long __darwin_wctype_t; +#endif /* __LP64__ */ #ifdef __WCHAR_MAX__ -#define __OSX_WCHAR_MAX __WCHAR_MAX__ +#define __DARWIN_WCHAR_MAX __WCHAR_MAX__ #else /* ! __WCHAR_MAX__ */ -#define __OSX_WCHAR_MAX (sizeof(__osx_wchar_t) == 2 ? 0xffff : 0x7fffffff) +#define __DARWIN_WCHAR_MAX 0x7fffffff #endif /* __WCHAR_MAX__ */ -#define __OSX_WCHAR_MIN (sizeof(__osx_wchar_t) == 2 ? 0 : 0x80000000) -#define __OSX_WEOF ((__osx_wint_t)-1) +#if __DARWIN_WCHAR_MAX > 0xffffU +#define __DARWIN_WCHAR_MIN (-0x7fffffff - 1) +#else +#define __DARWIN_WCHAR_MIN 0 +#endif +#define __DARWIN_WEOF ((__darwin_wint_t)-1) + +#ifndef _FORTIFY_SOURCE +# if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1050) +# define _FORTIFY_SOURCE 0 +# else +# define _FORTIFY_SOURCE 2 /* on by default */ +# endif +#endif #endif /* __TYPES_H_ */