_FORTIFY_SOURCE: add memset / bzero support

Add _FORTIFY_SOURCE support for the following functions:

* memset
* bzero

Move the __BIONIC_FORTIFY_INLINE definition to cdefs.h so it
can be used from multiple header files.

Change-Id: Iead4d5e35de6ec97786d58ee12573f9b11135bb7
This commit is contained in:
Nick Kralevich
2012-06-07 14:01:26 -07:00
parent 7d11009a97
commit 71a18dd435
5 changed files with 81 additions and 13 deletions

View File

@@ -501,4 +501,12 @@
#define __BIONIC__ 1
#include <android/api-level.h>
#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
#define __BIONIC_FORTIFY_INLINE \
extern inline \
__attribute__ ((always_inline)) \
__attribute__ ((gnu_inline)) \
__attribute__ ((artificial))
#endif
#endif /* !_SYS_CDEFS_H_ */