Fix _FORTIFY_SOURCE redefine error

If the _FORTIFY_SOURCE has been already defined, we shouldn't redefine
it, or it will raise a build error as below:

In file included from agent-msg-filter.c:21:0:
../config.h:17:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
agent-msg-filter.c:1:0: note: this is the location of the previous definition

Suggested-by: Christophe Fergeau <cfergeau@redhat.com>
Signed-off-by: Dunrong Huang <riegamaths@gmail.com>
This commit is contained in:
Dunrong Huang 2013-09-07 03:57:59 +08:00 committed by Christophe Fergeau
parent 7989644092
commit 6f4d2c8afb

View File

@ -113,7 +113,7 @@ AC_DEFUN([SPICE_COMPILE_WARNINGS],[
# Use improved glibc headers
AH_VERBATIM([FORTIFY_SOURCE],
[/* Enable compile-time and run-time bounds-checking, and some warnings. */
#if __OPTIMIZE__
#if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
# define _FORTIFY_SOURCE 2
#endif
])