Re: Compile *.c file as c++

RenĂ© Ferdinand Rivera Morell via Boost-build <[email protected]> Mon, 26 Jul 2021 07:35:07 -0500
Newsgroups gmane.comp.lib.boost.build
Message-ID <CAHEh_Gj0kv-ETa4e=1yzfOeefJiJMRanaV1y=Z_673BSLJA-7A@mail.gmail.com>
--===============2750370682022393874==
Content-Type: multipart/alternative; boundary="00000000000060b50105c805fcbe"

--00000000000060b50105c805fcbe
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Jul 26, 2021 at 4:20 AM Roman Matsybora via Boost-build <
[email protected]> wrote:

> Hello,
> Some part of c files need to be compiled as c++ but another part of *.c
> files stay with c.
> Is there some general solution or may be tool dependent?
> Currently using Visual Studio 2017-2019.
> _______________________________________________
> Unsubscribe & other changes:
> https://lists.boost.org/mailman/listinfo.cgi/boost-build
>

#ifdef __cplusplus__
// C++ code
#else
/* C code */
#endif

And build the source twice.

--=20
-- Ren=C3=A9 Ferdinand Rivera Morell
-- Don't Assume Anything  -- No Supone Nada
-- Robot Dreams - http://robot-dreams.net

--00000000000060b50105c805fcbe
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Mon, Jul 26, 2021 at 4:20 AM Roman=
 Matsybora via Boost-build &lt;<a href=3D"mailto:[email protected]=
g">[email protected]</a>&gt; wrote:<br></div><blockquote class=3D=
"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(2=
04,204,204);padding-left:1ex"><div><span style=3D"display:block"><div><span=
 style=3D"font-size:12pt;line-height:14pt;font-family:Arial">Hello,</span><=
/div>
<div><span style=3D"font-size:12pt;line-height:14pt;font-family:Arial">Some=
 part of c files need to be compiled as c++ but another part of *.c files s=
tay with c.<br>Is there some general solution or may be tool dependent?</sp=
an></div>
<div><span style=3D"font-size:12pt;line-height:14pt;font-family:Arial">Curr=
ently using Visual Studio 2017-2019.</span></div></span></div>
_______________________________________________<br>
Unsubscribe &amp; other changes: <a href=3D"https://lists.boost.org/mailman=
/listinfo.cgi/boost-build" rel=3D"noreferrer" target=3D"_blank">https://lis=
ts.boost.org/mailman/listinfo.cgi/boost-build</a><br>
</blockquote></div><div><br></div><div>#ifdef __cplusplus__</div><div>// C+=
+ code<br></div><div>#else</div><div>/* C code */<br></div><div>#endif</div=
><div><br></div><div>And build the source twice.<br></div><br>-- <br><div d=
ir=3D"ltr" class=3D"gmail_signature"><div dir=3D"ltr"><div><div dir=3D"ltr"=
>-- Ren=C3=A9 Ferdinand Rivera Morell<br>-- Don&#39;t Assume Anything=C2=A0=
 -- No Supone Nada<br>-- Robot Dreams -=C2=A0<a href=3D"http://robot-dreams=
.net/" target=3D"_blank">http://robot-dreams.net</a><br><br></div></div></d=
iv></div></div>

--00000000000060b50105c805fcbe--

--===============2750370682022393874==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build

--===============2750370682022393874==--