[RFA/commit] #include language.h in expression.h

Joel Brobecker brobecker@adacore.com
Mon Dec 17 07:19:00 GMT 2007


Hello,

Also while working on using "struct parse_context", I found that
expression.h is using some declarations made in language.h. As of
now, the only declaration that it is using is "struct language_defn *".
So we could possible add an advance stub declaration to fix the problem.

But in "[RFC/RFA] Introduce new struct parse_context"
(http://www.sourceware.org/ml/gdb-patches/2007-12/msg00255.html),
I am introducing the use of current_language through the
current_parse_context macro too.

I think we are better off including "language.h" from "expression.h"
rather than not, because we will then be certain that any file including
expression.h can use our macro without needing another include. This is
what the attached patch does.

2007-12-17  Joel Brobecker  <brobecker@adacore.com>

        * expression.h: Add #include "language.h".
        * Makefile.in (expression_h): Add dependency on language.h.

Any objections?

-- 
Joel
-------------- next part --------------
Index: expression.h
===================================================================
RCS file: /cvs/src/src/gdb/expression.h,v
retrieving revision 1.25
diff -u -p -r1.25 expression.h
--- expression.h	16 Dec 2007 13:31:46 -0000	1.25
+++ expression.h	17 Dec 2007 07:07:10 -0000
@@ -24,6 +24,7 @@
 
 #include "symtab.h"		/* Needed for "struct block" type. */
 #include "doublest.h"		/* Needed for DOUBLEST.  */
+#include "language.h"
 
 
 /* Definitions for saved C expressions.  */
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.965
diff -u -p -r1.965 Makefile.in
--- Makefile.in	6 Dec 2007 11:17:03 -0000	1.965
+++ Makefile.in	17 Dec 2007 07:07:19 -0000
@@ -765,7 +765,7 @@ event_loop_h = event-loop.h
 event_top_h = event-top.h
 exceptions_h = exceptions.h $(ui_out_h)
 exec_h = exec.h $(target_h)
-expression_h = expression.h $(symtab_h) $(doublest_h)
+expression_h = expression.h $(symtab_h) $(doublest_h) $(language_h)
 fbsd_nat_h = fbsd-nat.h
 f_lang_h = f-lang.h
 frame_base_h = frame-base.h


More information about the Gdb-patches mailing list