[Mesa-dev] [PATCH] nouveau: Fix build, invalid extern "C" around header inclusion.

Ilia Mirkin imirkin at alum.mit.edu
Fri Mar 6 13:19:04 PST 2015


Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

However you should probably split off the r300_public.h change into a
separate commit -- a little awkward to have 'nouveau:' as the subject
of a change to r300.

  -ilia

On Fri, Mar 6, 2015 at 4:16 PM, Mark Janes <mark.a.janes at intel.com> wrote:
> The previous patch to fix header inclusion within extern "C" neglected
> to fix the occurences of this pattern in nouveau files.
>
> When the helper to detect this issue was pushed to master, it broke
> the build for the nouveau driver.  This patch fixes the nouveau build.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89477
> ---
>  src/gallium/auxiliary/tgsi/tgsi_scan.h                    | 7 +++++++
>  src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp | 2 --
>  src/gallium/drivers/r300/r300_public.h                    | 8 ++++++++
>  3 files changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.h b/src/gallium/auxiliary/tgsi/tgsi_scan.h
> index 5dc9267..0ea0e88 100644
> --- a/src/gallium/auxiliary/tgsi/tgsi_scan.h
> +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.h
> @@ -33,6 +33,10 @@
>  #include "pipe/p_state.h"
>  #include "pipe/p_shader_tokens.h"
>
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
>  /**
>   * Shader summary info
>   */
> @@ -114,5 +118,8 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
>  extern boolean
>  tgsi_is_passthrough_shader(const struct tgsi_token *tokens);
>
> +#ifdef __cplusplus
> +} // extern "C"
> +#endif
>
>  #endif /* TGSI_SCAN_H */
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
> index 6e75730..1e0a695 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
> @@ -20,11 +20,9 @@
>   * OTHER DEALINGS IN THE SOFTWARE.
>   */
>
> -extern "C" {
>  #include "tgsi/tgsi_dump.h"
>  #include "tgsi/tgsi_scan.h"
>  #include "tgsi/tgsi_util.h"
> -}
>
>  #include <set>
>
> diff --git a/src/gallium/drivers/r300/r300_public.h b/src/gallium/drivers/r300/r300_public.h
> index b605920..57a69cb 100644
> --- a/src/gallium/drivers/r300/r300_public.h
> +++ b/src/gallium/drivers/r300/r300_public.h
> @@ -2,8 +2,16 @@
>  #ifndef R300_PUBLIC_H
>  #define R300_PUBLIC_H
>
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
>  struct radeon_winsys;
>
>  struct pipe_screen* r300_screen_create(struct radeon_winsys *rws);
>
> +#ifdef __cplusplus
> +} // extern "C"
> +#endif
> +
>  #endif
> --
> 2.1.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list