[Mesa-dev] Mesa (master): mesa: fix compilation

Chad Versace chad at chad-versace.us
Wed Jan 26 18:49:56 PST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

What I wrote *isn't* C++. It's valid C99. It compiles without problem
with both GCC 4.5 and Clang 2.8 on Fedora14.

What compiler are you using? And why can't it handle a C dialect over a
decade old?

My patches frequently break VMWare's builds, and a VMWare member "fixes"
my patches every time. I want to find a permanent fix for this.
My suspicion is that autoconf is not setting --std=c99 for whatever
configuration VMware is using; please verify if this is or is not the
case. For reference, here is my configure invocation:

autogen.sh \
  --disable-gallium \
  --enable-egl \
  --enable-debug \
  --enable-gles1 \
  --enable-gles2 \
  --enable-glx \
  --withdri-drivers=swrast,i915,i965

- -- 
Chad Versace
chad at chad-versace.us


On 01/26/2011 06:16 PM, Zack Rusin wrote:
> Module: Mesa
> Branch: master
> Commit: 59dbdbbb7d0ff90dc7561b1bc337bbb918755103
> URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=59dbdbbb7d0ff90dc7561b1bc337bbb918755103
> 
> Author: Zack Rusin <zackr at vmware.com>
> Date:   Wed Jan 26 21:20:53 2011 -0500
> 
> mesa: fix compilation
> 
> this isn't c++ please don't mix declerations with code
> 
> ---
> 
>  src/mesa/main/extensions.c |   15 ++++++++++-----
>  1 files changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
> index 38227e5..aaef337 100644
> --- a/src/mesa/main/extensions.c
> +++ b/src/mesa/main/extensions.c
> @@ -747,6 +747,11 @@ static char *
>  get_extension_override( struct gl_context *ctx )
>  {
>     const char *env_const= _mesa_getenv("MESA_EXTENSION_OVERRIDE");
> +   char *env;
> +   char *ext;
> +   char *extra_exts;
> +   int len;
> +
>     if (env_const == NULL) {
>        /* Return the empty string rather than NULL. This simplifies the logic
>         * of client functions. */
> @@ -754,13 +759,13 @@ get_extension_override( struct gl_context *ctx )
>     }
>  
>     /* extra_exts: List of unrecognized extensions. */
> -   char *extra_exts = calloc(strlen(env_const), sizeof(char));
> +   extra_exts = calloc(strlen(env_const), sizeof(char));
>  
>     /* Copy env_const because strtok() is destructive. */
> -   char *env = strdup(env_const);
> -   char *ext;
> +   env = strdup(env_const);
>     for (ext = strtok(env, " "); ext != NULL; ext = strtok(NULL, " ")) {
>        int enable;
> +      int recognized;
>        switch (ext[0]) {
>        case '+':
>           enable = 1;
> @@ -774,7 +779,7 @@ get_extension_override( struct gl_context *ctx )
>           enable = 1;
>           break;
>        }
> -      int recognized = set_extension(ctx, ext, enable);
> +      recognized = set_extension(ctx, ext, enable);
>        if (!recognized) {
>           strcat(extra_exts, ext);
>           strcat(extra_exts, " ");
> @@ -782,7 +787,7 @@ get_extension_override( struct gl_context *ctx )
>     }
>  
>     /* Remove trailing space. */
> -   int len  = strlen(extra_exts);
> +   len  = strlen(extra_exts);
>     if (extra_exts[len - 1] == ' ')
>        extra_exts[len - 1] = '\0';
>  
> 
> _______________________________________________
> mesa-commit mailing list
> mesa-commit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-commit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJNQN1UAAoJEAIvNt057x8i0jkP/iDV2uR0DZM+LbTHa+H9v0hk
UZzX4ZEsmKTOTICEU8Cv7sGzQKrO7F1/hDtH5GpKW+WqX2ukmE7xuBJB7/xgEUgB
/oIcO9ihh73LoAvYUOFzyIjRXCfZgWIFIunexYICQt/L1Mtu9PCiuREIOSLbLAS1
xjEm1jryc7+Kpj6j/oJbORB/Obq/apJL3x3AlmTUQ5VtC/xE+b5NAhtdH2Q3my7u
xi/U2U6wRb2g1PI7msNV6Ivq4BiLsuZPX2hWmNAtZfwyvNnk9lc3NsYlU4Ehvfb4
kF7e5ebE/4IuL6issChd3IJEPFTcHG36WPU2hHPc72RLTo9sHx6ijEUinh22SWBQ
nPnz6y3aoK9eyNg/AzZz6LPClc86fC6h2j5CU/hWnSzFCBhcZTUYQZw7EUiG+gsH
s3W3/ZXKxEFxfLllLjWHx2gGmJZKqqqLAgaMQlyjX3NUEo6Pk5qbxEwcYgyqT0Zc
qBpmgHgFutUYtx4xiixqClPngcOu6zpwgv1v8oPDR2wR90P3tR1aqXF1kYzfGvFg
AfLOt4e5F0FVn1H1/IxP/6SUJ0J0vTCrYN1CIsROx2/ZdQj+3AZmAYSORsofDIJX
gY2LgybKMdsbRMSbnOb2Lx3wncLhSafKc3L3SRAozfijJXAM1IkrWrRV/na+PthL
yFDctU8ogx6PaPy3WO8x
=yPWm
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list