[GCC16][COMMITTED 17/29] a68: use INCLUDE_FOO before system.h for standard C++ headers
Jose E. Marchesi
jemarch@gnu.org
Tue Jul 21 11:03:01 GMT 2026
Define INCLUDE_* preprocessor symbols rather than including some
standard C++ headers directly.
Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
gcc/algol68/ChangeLog
* a68-parser-brackets.cc (INCLUDE_STRING): Define.
Do not include <string.
* a68-parser-bottom-up.cc (INCLUDE_STRING): Define.
Do not include <string>.
* a68-moids-diagnostics.cc (INCLUDE_STRING): Define.
Do not include <string>.
* a68-imports.cc (INCLUDE_STRING): Define.
Do not include <string>.
* a68-imports-archive.cc (INCLUDE_MAP): Define.
(INCLUDE_STRING): Likewise.
Do not include <string> nor <map>.
(cherry picked from commit b3fe970c2431feb8e7dc0148dafcc7dcb15b4920)
---
gcc/algol68/a68-imports-archive.cc | 5 ++---
gcc/algol68/a68-imports.cc | 3 +--
gcc/algol68/a68-moids-diagnostics.cc | 3 +--
gcc/algol68/a68-parser-bottom-up.cc | 3 +--
gcc/algol68/a68-parser-brackets.cc | 3 +--
5 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/gcc/algol68/a68-imports-archive.cc b/gcc/algol68/a68-imports-archive.cc
index bd6b8a82b4d..ac0c1d728bf 100644
--- a/gcc/algol68/a68-imports-archive.cc
+++ b/gcc/algol68/a68-imports-archive.cc
@@ -19,14 +19,13 @@
<http://www.gnu.org/licenses/>. */
#define INCLUDE_MEMORY
+#define INCLUDE_MAP
+#define INCLUDE_STRING
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "vec.h"
-#include <map>
-#include <string>
-
#include "a68.h"
diff --git a/gcc/algol68/a68-imports.cc b/gcc/algol68/a68-imports.cc
index 5200d4ba71b..394c0543ec9 100644
--- a/gcc/algol68/a68-imports.cc
+++ b/gcc/algol68/a68-imports.cc
@@ -28,6 +28,7 @@
<http://www.gnu.org/licenses/>. */
#define INCLUDE_MEMORY
+#define INCLUDE_STRING
#include "config.h"
#include "system.h"
#include "coretypes.h"
@@ -41,8 +42,6 @@
#include "common/common-target.h"
#include "dwarf2asm.h"
-#include <string>
-
#include "a68.h"
/* A few macros to aid parsing of module map strings below. */
diff --git a/gcc/algol68/a68-moids-diagnostics.cc b/gcc/algol68/a68-moids-diagnostics.cc
index 10ee4a77415..8fffac07065 100644
--- a/gcc/algol68/a68-moids-diagnostics.cc
+++ b/gcc/algol68/a68-moids-diagnostics.cc
@@ -19,6 +19,7 @@
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#define INCLUDE_STRING
#include "config.h"
#include "system.h"
#include "coretypes.h"
@@ -27,8 +28,6 @@
#include "a68.h"
#include "a68-pretty-print.h"
-#include <string>
-
/* Give accurate error message. */
const char *
diff --git a/gcc/algol68/a68-parser-bottom-up.cc b/gcc/algol68/a68-parser-bottom-up.cc
index f3e5793283e..ccbcba93211 100644
--- a/gcc/algol68/a68-parser-bottom-up.cc
+++ b/gcc/algol68/a68-parser-bottom-up.cc
@@ -95,13 +95,12 @@
- reduce a sub-phrase starting at a branch, implemented by 'reduce_branch'.
*/
+#define INCLUDE_STRING
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "options.h"
-#include <string>
-
#include "a68.h"
#include "a68-pretty-print.h"
diff --git a/gcc/algol68/a68-parser-brackets.cc b/gcc/algol68/a68-parser-brackets.cc
index 38aa9f3c820..b2358fd0ebe 100644
--- a/gcc/algol68/a68-parser-brackets.cc
+++ b/gcc/algol68/a68-parser-brackets.cc
@@ -20,12 +20,11 @@
<http://www.gnu.org/licenses/>. */
+#define INCLUDE_STRING
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include <string>
-
#include "a68.h"
#include "a68-pretty-print.h"
--
2.39.5
More information about the Algol68
mailing list