fix build using Watcom :
authorOzkan Sezer <sezeroz@gmail.com>
Thu, 01 Nov 2018 20:04:24 +0300
changeset 12383f6430feceeda
parent 12382 03d0bddca61b
child 12384 b1f5162fd621
fix build using Watcom :

./src/render/SDL_render.c(2168): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2168): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2175): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2175): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2322): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2322): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2322): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2322): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2329): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2329): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2329): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2329): Error! E1054: Expression must be constant

./src/render/software/SDL_render_sw.c(602): Error! E1054: Expression must be constant
./src/render/software/SDL_render_sw.c(602): Error! E1054: Expression must be constant
./src/render/software/SDL_render_sw.c(602): Error! E1054: Expression must be constant
./src/render/software/SDL_render_sw.c(602): Error! E1054: Expression must be constant
src/render/SDL_render.c
src/render/software/SDL_render_sw.c
     1.1 --- a/src/render/SDL_render.c	Thu Nov 01 12:31:45 2018 -0400
     1.2 +++ b/src/render/SDL_render.c	Thu Nov 01 20:04:24 2018 +0300
     1.3 @@ -2165,14 +2165,18 @@
     1.4  int
     1.5  SDL_RenderDrawPoint(SDL_Renderer * renderer, int x, int y)
     1.6  {
     1.7 -    const SDL_FPoint fpoint = { (float) x, (float) y };
     1.8 +    SDL_FPoint fpoint;
     1.9 +    fpoint.x = (float) x;
    1.10 +    fpoint.y = (float) y;
    1.11      return SDL_RenderDrawPointsF(renderer, &fpoint, 1);
    1.12  }
    1.13  
    1.14  int
    1.15  SDL_RenderDrawPointF(SDL_Renderer * renderer, float x, float y)
    1.16  {
    1.17 -    const SDL_FPoint fpoint = { x, y };
    1.18 +    SDL_FPoint fpoint;
    1.19 +    fpoint.x = x;
    1.20 +    fpoint.y = y;
    1.21      return SDL_RenderDrawPointsF(renderer, &fpoint, 1);
    1.22  }
    1.23  
    1.24 @@ -2319,14 +2323,22 @@
    1.25  int
    1.26  SDL_RenderDrawLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2)
    1.27  {
    1.28 -    const SDL_FPoint points[2] = { { (float) x1, (float) y1 }, { (float) x2, (float) y2 } };
    1.29 +    SDL_FPoint points[2];
    1.30 +    points[0].x = (float) x1;
    1.31 +    points[0].y = (float) y1;
    1.32 +    points[1].x = (float) x2;
    1.33 +    points[1].y = (float) y2;
    1.34      return SDL_RenderDrawLinesF(renderer, points, 2);
    1.35  }
    1.36  
    1.37  int
    1.38  SDL_RenderDrawLineF(SDL_Renderer * renderer, float x1, float y1, float x2, float y2)
    1.39  {
    1.40 -    const SDL_FPoint points[2] = { { x1, y1 }, { x2, y2 } };
    1.41 +    SDL_FPoint points[2];
    1.42 +    points[0].x = x1;
    1.43 +    points[0].y = y1;
    1.44 +    points[1].x = x2;
    1.45 +    points[1].y = y2;
    1.46      return SDL_RenderDrawLinesF(renderer, points, 2);
    1.47  }
    1.48  
     2.1 --- a/src/render/software/SDL_render_sw.c	Thu Nov 01 12:31:45 2018 -0400
     2.2 +++ b/src/render/software/SDL_render_sw.c	Thu Nov 01 20:04:24 2018 +0300
     2.3 @@ -599,7 +599,11 @@
     2.4                  SDL_assert(viewport != NULL);
     2.5                  cliprect = cmd->data.cliprect.enabled ? &cmd->data.cliprect.rect : NULL;
     2.6                  if (cliprect) {
     2.7 -                    SDL_Rect clip_rect = { cliprect->x + viewport->x, cliprect->y + viewport->y, cliprect->w, cliprect->h };
     2.8 +                    SDL_Rect clip_rect;
     2.9 +                    clip_rect.x = cliprect->x + viewport->x;
    2.10 +                    clip_rect.y = cliprect->y + viewport->y;
    2.11 +                    clip_rect.w = cliprect->w;
    2.12 +                    clip_rect.h = cliprect->h;
    2.13                      SDL_IntersectRect(viewport, &clip_rect, &clip_rect);
    2.14                      SDL_SetClipRect(surface, &clip_rect);
    2.15                  } else {