Yeah, just like all the other headers: #ifdef __cplusplus extern "C" { #endif
define api's #ifdef __cplusplus } #endif You can see examples in, e.g., u_bitcast.h (picked one at random). On Wed, Feb 15, 2017 at 5:45 PM, Kyriazis, George <george.kyria...@intel.com> wrote: > You mean use extern "C" (inside a c++ guard) on u_upload_mgr.h and friends? > > Thanks, > > George > >> -----Original Message----- >> From: ibmir...@gmail.com [mailto:ibmir...@gmail.com] On Behalf Of Ilia >> Mirkin >> Sent: Wednesday, February 15, 2017 4:25 PM >> To: Kyriazis, George <george.kyria...@intel.com> >> Cc: mesa-dev@lists.freedesktop.org >> Subject: Re: [Mesa-dev] [PATCH] [swr] fix windows build >> >> I'd rather see the remainder of the headers fixed to be includable from C++ >> contexts. extern "C" { #include } is an anti-pattern... >> >> -ilia >> >> On Wed, Feb 15, 2017 at 5:23 PM, George Kyriazis >> <george.kyria...@intel.com> wrote: >> > move util/u_upload_mgr.h inside extern "C" >> > --- >> > src/gallium/drivers/swr/swr_context.cpp | 2 +- >> > 1 file changed, 1 insertion(+), 1 deletion(-) >> > >> > diff --git a/src/gallium/drivers/swr/swr_context.cpp >> > b/src/gallium/drivers/swr/swr_context.cpp >> > index 2e37bac..04ff146 100644 >> > --- a/src/gallium/drivers/swr/swr_context.cpp >> > +++ b/src/gallium/drivers/swr/swr_context.cpp >> > @@ -33,9 +33,9 @@ >> > #include "util/u_inlines.h" >> > #include "util/u_format.h" >> > #include "util/u_atomic.h" >> > -#include "util/u_upload_mgr.h" >> > >> > extern "C" { >> > +#include "util/u_upload_mgr.h" >> > #include "util/u_transfer.h" >> > #include "util/u_surface.h" >> > } >> > -- >> > 2.7.4 >> > >> > _______________________________________________ >> > mesa-dev mailing list >> > mesa-dev@lists.freedesktop.org >> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev