c++: Use in-process client when networking is disabled

Message ID 20221025141919.1789727-1-torbjorn.svensson@foss.st.com
State Accepted
Headers
Series c++: Use in-process client when networking is disabled |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Torbjorn SVENSSON Oct. 25, 2022, 2:19 p.m. UTC
  Without the patch, the output for bad-mapper-3.C would be:

/src/gcc/gcc/testsuite/g++.dg/modules/bad-mapper-3.C:2:1: error: unknown Compiled Module Interface: no such module

As this line is unexpected, the test case would fail.
The same problem can also be seen for g++.dg/modules/bad-mapper-2.C.

gcc/cp/ChangeLog:

	* mapper-client.cc: Use in-process client when networking is
	disabled.

Co-Authored-By: Yvan ROUX <yvan.roux@foss.st.com>
Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
---
 gcc/cp/mapper-client.cc | 4 ++++
 1 file changed, 4 insertions(+)
  

Patch

diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
index fe9544b5ba4..4dcb3a03660 100644
--- a/gcc/cp/mapper-client.cc
+++ b/gcc/cp/mapper-client.cc
@@ -227,6 +227,8 @@  module_client::open_module_client (location_t loc, const char *o,
 		int fd = -1;
 #if CODY_NETWORKING
 		fd = Cody::OpenLocal (&errmsg, name.c_str () + 1);
+#else
+		errmsg = "CODY_NETWORKING disabled";
 #endif
 		if (fd >= 0)
 		  c = new module_client (fd, fd);
@@ -254,6 +256,8 @@  module_client::open_module_client (location_t loc, const char *o,
 			int fd = -1;
 #if CODY_NETWORKING
 			fd = Cody::OpenInet6 (&errmsg, name.c_str (), port);
+#else
+			errmsg = "CODY_NETWORKING disabled";
 #endif
 			name[colon] = ':';