[gcc r16-9344] a68: use INCLUDE_FOO before system.h for standard C++ headers

"Jose E. Marchesi via Gcc-cvs" <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:9341b5cc76a1252f829d0a3950fc68a06ce84607

commit r16-9344-g9341b5cc76a1252f829d0a3950fc68a06ce84607
Author: Jose E. Marchesi <[email protected]>
Date:   Sun Jun 14 17:31:16 2026 +0200

    a68: use INCLUDE_FOO before system.h for standard C++ headers
    
    Define INCLUDE_* preprocessor symbols rather than including some
    standard C++ headers directly.
    
    Signed-off-by: Jose E. Marchesi <[email protected]>
    
    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)

Diff:
---
 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 bd6b8a82b4dc..ac0c1d728bf6 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 5200d4ba71b1..394c0543ec92 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 10ee4a774159..8fffac070659 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 f3e5793283ef..ccbcba93211d 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 38aa9f3c8202..b2358fd0ebe0 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"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.