[Mesa-dev] [PATCH] glsl: try again to fix PRIx64 / MinGW build problem

Ian Romanick ian.d.romanick at intel.com
Fri Nov 11 16:00:27 UTC 2016


Does using stdint.h help?

On 11/11/2016 07:48 AM, Brian Paul wrote:
> inttypes.h doesn't always define the PRIx64 macro when compiling C++
> code with MinGW.  For that case, simply define PRIx64 to be "lx".
> This generates a format/argument type mismatch warning.  And using
> "llx" generates other warnings.  Just live with it.
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=98681
> ---
>  src/compiler/glsl/ir_builder_print_visitor.cpp | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/src/compiler/glsl/ir_builder_print_visitor.cpp b/src/compiler/glsl/ir_builder_print_visitor.cpp
> index 529466c..9b9169c 100644
> --- a/src/compiler/glsl/ir_builder_print_visitor.cpp
> +++ b/src/compiler/glsl/ir_builder_print_visitor.cpp
> @@ -30,6 +30,15 @@
>  #include "main/macros.h"
>  #include "util/hash_table.h"
>  
> +/* This work-around is needed for MinGW.
> + * Note that there's still a warning about the format string and argument
> + * type not agreeing.  And "llx" just generates a different warning.  Oh well.
> + */
> +#ifndef PRIx64
> +#define PRIx64 "lx"
> +#endif
> +
> +
>  class ir_builder_print_visitor : public ir_hierarchical_visitor {
>  public:
>     ir_builder_print_visitor(FILE *f);
> 



More information about the mesa-dev mailing list