aboutsummaryrefslogtreecommitdiff
path: root/gdb/common/common-defs.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/common/common-defs.h')
-rw-r--r--gdb/common/common-defs.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/common/common-defs.h b/gdb/common/common-defs.h
index 58445b1..86f7c1a 100644
--- a/gdb/common/common-defs.h
+++ b/gdb/common/common-defs.h
@@ -65,9 +65,10 @@
enable it here in order to try to catch these problems earlier;
plus this seems like a reasonable safety measure. The check for
optimization is required because _FORTIFY_SOURCE only works when
- optimization is enabled. */
+ optimization is enabled. If _FORTIFY_SOURCE is already defined,
+ then we don't do anything. */
-#if defined __OPTIMIZE__ && __OPTIMIZE__ > 0
+#if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
#define _FORTIFY_SOURCE 2
#endif