[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/8] c++: fewer #includes in the headers.
From: |
Akim Demaille |
Subject: |
[PATCH 3/8] c++: fewer #includes in the headers. |
Date: |
Wed, 4 Jul 2012 16:52:59 +0200 |
* data/lalr1.cc: Define YY_NULL in the *.cc file, it is not needed
in the header.
* data/location.cc: iosfwd suffices.
---
data/lalr1.cc | 14 +++++++-------
data/location.cc | 4 ++--
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/data/lalr1.cc b/data/lalr1.cc
index afff0a5..5e83ee3 100644
--- a/data/lalr1.cc
+++ b/data/lalr1.cc
@@ -55,8 +55,6 @@ b4_copyright([Skeleton interface for Bison LALR(1) parsers in
C++],
]b4_percent_define_ifdef([[location_type]], [],
[[#include "location.hh"]])[
-]b4_null_define[
-
]b4_YYDEBUG_define[
]b4_namespace_open[
@@ -277,16 +275,18 @@ m4_if(b4_prefix, [yy], [],
#define yylex b4_prefix[]lex])[
/* First part of user declarations. */
-]b4_user_pre_prologue
+]b4_user_pre_prologue[
-b4_defines_if([[
+]b4_defines_if([[
#include "@basename(]b4_spec_defines_file[@)"]])[
/* User implementation prologue. */
-]b4_user_post_prologue
-b4_percent_code_get[]dnl
+]b4_user_post_prologue[
+]b4_percent_code_get[
+
+]b4_null_define[
-[#ifndef YY_
+#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */
diff --git a/data/location.cc b/data/location.cc
index f45f634..b7383d6 100644
--- a/data/location.cc
+++ b/data/location.cc
@@ -29,9 +29,9 @@ b4_copyright([Positions for Bison parsers in C++],
]b4_cpp_guard_open([b4_dir_prefix[]position.hh])[
-# include <iostream>
+# include <algorithm> // std::max
+# include <iosfwd>
# include <string>
-# include <algorithm>
]b4_null_define[
--
1.7.11.1
- [PATCH 0/8] Various improvements prompted by api.prefix, Akim Demaille, 2012/07/04
- [PATCH 3/8] c++: fewer #includes in the headers.,
Akim Demaille <=
- [PATCH 5/8] api.prefix: do not use #define to handle YYSTYPE_IS_TRIVIAL etc., Akim Demaille, 2012/07/04
- [PATCH 7/8] glr.cc: do not override C++ definitions by C macros., Akim Demaille, 2012/07/04
- [PATCH 1/8] tests: more logs., Akim Demaille, 2012/07/04
- [PATCH 6/8] YYLLOC_DEFAULT: factor, and don't export it in headers., Akim Demaille, 2012/07/04
- [PATCH 2/8] glr.cc: formatting changes., Akim Demaille, 2012/07/04
- [PATCH 4/8] tests: portability fixes., Akim Demaille, 2012/07/04
- [PATCH 8/8] tests: headers.at: strengthen., Akim Demaille, 2012/07/04