Patchwork [gccgo] Define ENABLE_BUILD_WITH_CXX in auto-host.h

login
register
mail settings
Submitter Ian Taylor
Date Nov. 11, 2010, 10:56 p.m.
Message ID <mcrsjz7pizq.fsf@google.com>
Download mbox | patch
Permalink /patch/70887/
State New
Headers show

Comments

Ian Taylor - Nov. 11, 2010, 10:56 p.m.
This patch adds ENABLE_BUILD_WITH_CXX as a preprocessor macro defined in
auto-host.h when configured with --enable-build-with-cxx.  This permits
code which is already written in C++ decide whether it needs to use
extern "C".  Committed to gccgo branch.

Ian

Patch

Index: configure.ac
===================================================================
--- configure.ac	(revision 166591)
+++ configure.ac	(working copy)
@@ -587,6 +587,10 @@  AC_ARG_ENABLE(build-with-cxx,
 ENABLE_BUILD_WITH_CXX=$enableval,
 ENABLE_BUILD_WITH_CXX=no)
 AC_SUBST(ENABLE_BUILD_WITH_CXX)
+if test "$ENABLE_BUILD_WITH_CXX" = "yes"; then
+  AC_DEFINE(ENABLE_BUILD_WITH_CXX, 1,
+	    [Define if building with C++.])
+fi
 
 # With stabs
 AC_ARG_WITH(stabs,