aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib/compiler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/lib/compiler.cc')
-rw-r--r--gdb/testsuite/lib/compiler.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/testsuite/lib/compiler.cc b/gdb/testsuite/lib/compiler.cc
index 0c5eb66..8059e97 100644
--- a/gdb/testsuite/lib/compiler.cc
+++ b/gdb/testsuite/lib/compiler.cc
@@ -25,7 +25,12 @@
set compiler_info ""
#if defined (__GNUC__)
-set compiler_info [join {gcc __GNUC__ __GNUC_MINOR__ } -]
+#if defined (__GNUC_PATCHLEVEL__)
+/* Only GCC versions >= 3.0 define the __GNUC_PATCHLEVEL__ macro. */
+set compiler_info [join {gcc __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__} -]
+#else
+set compiler_info [join {gcc __GNUC__ __GNUC_MINOR__ "unknown"} -]
+#endif
set gcc_compiled __GNUC__
#else
set gcc_compiled 0