163d1a8abSmrg/* Object size checking support macros.
2*ec02198aSmrg   Copyright (C) 2004-2020 Free Software Foundation, Inc.
363d1a8abSmrg
463d1a8abSmrgThis file is part of GCC.
563d1a8abSmrg
663d1a8abSmrgGCC is free software; you can redistribute it and/or modify it under
763d1a8abSmrgthe terms of the GNU General Public License as published by the Free
863d1a8abSmrgSoftware Foundation; either version 3, or (at your option) any later
963d1a8abSmrgversion.
1063d1a8abSmrg
1163d1a8abSmrgIn addition to the permissions in the GNU General Public License, the
1263d1a8abSmrgFree Software Foundation gives you unlimited permission to link the
1363d1a8abSmrgcompiled version of this file into combinations with other programs,
1463d1a8abSmrgand to distribute those combinations without any restriction coming
1563d1a8abSmrgfrom the use of this file.  (The General Public License restrictions
1663d1a8abSmrgdo apply in other respects; for example, they cover modification of
1763d1a8abSmrgthe file, and distribution when not linked into a combine
1863d1a8abSmrgexecutable.)
1963d1a8abSmrg
2063d1a8abSmrgGCC is distributed in the hope that it will be useful, but WITHOUT ANY
2163d1a8abSmrgWARRANTY; without even the implied warranty of MERCHANTABILITY or
2263d1a8abSmrgFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
2363d1a8abSmrgfor more details.
2463d1a8abSmrg
2563d1a8abSmrgUnder Section 7 of GPL version 3, you are granted additional
2663d1a8abSmrgpermissions described in the GCC Runtime Library Exception, version
2763d1a8abSmrg3.1, as published by the Free Software Foundation.
2863d1a8abSmrg
2963d1a8abSmrgYou should have received a copy of the GNU General Public License and
3063d1a8abSmrga copy of the GCC Runtime Library Exception along with this program;
3163d1a8abSmrgsee the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
3263d1a8abSmrg<http://www.gnu.org/licenses/>.  */
3363d1a8abSmrg
3463d1a8abSmrg
3563d1a8abSmrg#ifndef _SSP_H
3663d1a8abSmrg#define _SSP_H 1
3763d1a8abSmrg
3863d1a8abSmrg#if _FORTIFY_SOURCE > 0 && __OPTIMIZE__ > 0 \
3963d1a8abSmrg    && defined __GNUC__ \
4063d1a8abSmrg    && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) \
4163d1a8abSmrg    && !defined __cplusplus
4263d1a8abSmrg# if _FORTIFY_SOURCE == 1
4363d1a8abSmrg#  define __SSP_FORTIFY_LEVEL 1
4463d1a8abSmrg# elif _FORTIFY_SOURCE > 1
4563d1a8abSmrg#  define __SSP_FORTIFY_LEVEL 2
4663d1a8abSmrg# endif
4763d1a8abSmrg#endif
4863d1a8abSmrg
4963d1a8abSmrg#if __SSP_FORTIFY_LEVEL > 0
5063d1a8abSmrg# include <stddef.h>
5163d1a8abSmrg# define __ssp_bos(ptr) __builtin_object_size (ptr, __SSP_FORTIFY_LEVEL > 1)
5263d1a8abSmrg# define __ssp_bos0(ptr) __builtin_object_size (ptr, 0)
5363d1a8abSmrg
5463d1a8abSmrg# define __SSP_REDIRECT(name, proto, alias) \
5563d1a8abSmrg  name proto __asm__ (__SSP_ASMNAME (#alias))
5663d1a8abSmrg# define __SSP_ASMNAME(cname)  __SSP_ASMNAME2 (__USER_LABEL_PREFIX__, cname)
5763d1a8abSmrg# define __SSP_ASMNAME2(prefix, cname) __SSP_ASMNAME3 (prefix) cname
5863d1a8abSmrg# define __SSP_ASMNAME3(prefix) #prefix
5963d1a8abSmrg
6063d1a8abSmrg# @ssp_have_usable_vsnprintf@ __SSP_HAVE_VSNPRINTF
6163d1a8abSmrg
6263d1a8abSmrgextern void __chk_fail (void) __attribute__((__noreturn__));
6363d1a8abSmrg#endif
6463d1a8abSmrg
6563d1a8abSmrg#endif /* _SSP_H */
66