toolchain/gcc: fix build errors on macOS with Xcode 15.3
[openwrt/staging/nbd.git] / toolchain / gcc / patches-13.x / 021-libcc1-fix-vector-include.patch
1 From 5213047b1d50af63dfabb5e5649821a6cb157e33 Mon Sep 17 00:00:00 2001
2 From: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
3 Date: Sat, 16 Mar 2024 09:50:00 +0100
4 Subject: [PATCH] libcc1: fix <vector> include
5
6 Use INCLUDE_VECTOR before including system.h, instead of directly
7 including <vector>, to avoid running into poisoned identifiers.
8
9 Signed-off-by: Dimitry Andric <dimitry@andric.com>
10
11 libcc1/ChangeLog:
12
13 PR middle-end/111632
14 * libcc1plugin.cc: Fix include.
15 * libcp1plugin.cc: Fix include.
16 ---
17 libcc1/libcc1plugin.cc | 3 +--
18 libcc1/libcp1plugin.cc | 3 +--
19 2 files changed, 2 insertions(+), 4 deletions(-)
20
21 diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
22 index 72d17c3b81c..e64847466f4 100644
23 --- a/libcc1/libcc1plugin.cc
24 +++ b/libcc1/libcc1plugin.cc
25 @@ -32,6 +32,7 @@
26 #undef PACKAGE_VERSION
27
28 #define INCLUDE_MEMORY
29 +#define INCLUDE_VECTOR
30 #include "gcc-plugin.h"
31 #include "system.h"
32 #include "coretypes.h"
33 @@ -69,8 +70,6 @@
34 #include "gcc-c-interface.h"
35 #include "context.hh"
36
37 -#include <vector>
38 -
39 using namespace cc1_plugin;
40
41 \f
42 diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
43 index 0eff7c68d29..da68c5d0ac1 100644
44 --- a/libcc1/libcp1plugin.cc
45 +++ b/libcc1/libcp1plugin.cc
46 @@ -33,6 +33,7 @@
47 #undef PACKAGE_VERSION
48
49 #define INCLUDE_MEMORY
50 +#define INCLUDE_VECTOR
51 #include "gcc-plugin.h"
52 #include "system.h"
53 #include "coretypes.h"
54 @@ -71,8 +72,6 @@
55 #include "rpc.hh"
56 #include "context.hh"
57
58 -#include <vector>
59 -
60 using namespace cc1_plugin;
61
62 \f
63 --
64 2.39.3
65