Skip to content

Commit b73b362

Browse files
committed
Attempt to fix the build on gcc 4.6
1 parent 08ce1c4 commit b73b362

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

generate-casts-c.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,11 @@ def write_c(registry, c_out):
6868

6969
c_out.write('#include "cp/cp-tree.h" /* for TFF_* for use by PyGccFunctionDecl_get_fullname */\n')
7070

71-
# op_symbol_code moved to tree-pretty-print.h in gcc 4.9
71+
c_out.write('/* op_symbol_code moved to tree-pretty-print.h in gcc 4.9\n')
72+
c_out.write(' but tree-pretty-print.h is only available from 4.7 onwards. */\n')
73+
c_out.write('#if (GCC_VERSION >= 4009)\n')
7274
c_out.write('#include "tree-pretty-print.h"\n')
75+
c_out.write('#endif\n')
7376

7477
c_out.write('#include "gcc-c-api/gcc-tree.h"\n')
7578
c_out.write('#include "gcc-c-api/gcc-type.h"\n')

0 commit comments

Comments
 (0)