Ticket #1749: compiler-bug.patch

File compiler-bug.patch, 3.2 KB (added by sfionov, 14 years ago)
  • src/wtools.h

    From e08e9aba1039f59abb88528e41feca495c4e6697 Mon Sep 17 00:00:00 2001
    From: Sergey Fionov <fionov@gmail.com>
    Date: Wed, 28 Oct 2009 13:51:14 +0300
    Subject: [PATCH] Avoid Sun Studio compiler bug
    
    Modify designators to avoid bug #6888373
    (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6888373)
    ---
     src/wtools.h |   62 ++++++++++++++++++++++++++++++++++++++++-----------------
     1 files changed, 43 insertions(+), 19 deletions(-)
    
    diff --git a/src/wtools.h b/src/wtools.h
    index 5d06391..d9f7b8b 100644
    a b typedef struct { 
    8686    .relative_y = y,                                                    \ 
    8787    .y_divisions = ydiv,                                                \ 
    8888    .widget = NULL,                                                     \ 
    89     .u.checkbox.text = txt,                                             \ 
    90     .u.checkbox.state = st                                              \ 
     89    .u = {                                                              \ 
     90        .checkbox = {                                                   \ 
     91            .text = txt,                                                \ 
     92            .state = st                                                 \ 
     93        }                                                               \ 
     94    }                                                                   \ 
    9195} 
    9296 
    9397#define QUICK_BUTTON(x, xdiv, y, ydiv, txt, act, cb)                    \ 
    typedef struct { 
    98102    .relative_y = y,                                                    \ 
    99103    .y_divisions = ydiv,                                                \ 
    100104    .widget = NULL,                                                     \ 
    101     .u.button.text = txt,                                               \ 
    102     .u.button.action = act,                                             \ 
    103     .u.button.callback = cb                                             \ 
     105    .u = {                                                              \ 
     106        .button = {                                                     \ 
     107            .text = txt,                                                \ 
     108            .action = act,                                              \ 
     109            .callback = cb                                              \ 
     110        }                                                               \ 
     111    }                                                                   \ 
    104112} 
    105113 
    106114#define QUICK_INPUT(x, xdiv, y, ydiv, txt, len_, flags_, hname, res)    \ 
    typedef struct { 
    111119    .relative_y = y,                                                    \ 
    112120    .y_divisions = ydiv,                                                \ 
    113121    .widget = NULL,                                                     \ 
    114     .u.input.text = txt,                                                \ 
    115     .u.input.len = len_,                                                \ 
    116     .u.input.flags = flags_,                                            \ 
    117     .u.input.histname = hname,                                          \ 
    118     .u.input.result = res                                               \ 
     122    .u = {                                                              \ 
     123        .input = {                                                      \ 
     124            .text = txt,                                                \ 
     125            .len = len_,                                                \ 
     126            .flags = flags_,                                            \ 
     127            .histname = hname,                                          \ 
     128            .result = res                                               \ 
     129        }                                                               \ 
     130    }                                                                   \ 
    119131} 
    120132 
    121133#define QUICK_LABEL(x, xdiv, y, ydiv, txt)                              \ 
    typedef struct { 
    126138    .relative_y = y,                                                    \ 
    127139    .y_divisions = ydiv,                                                \ 
    128140    .widget = NULL,                                                     \ 
    129     .u.label.text = txt                                                 \ 
     141    .u = {                                                              \ 
     142        .label = {                                                      \ 
     143            .text = txt                                                 \ 
     144        }                                                               \ 
     145    }                                                                   \ 
    130146} 
    131147 
    132148#define QUICK_RADIO(x, xdiv, y, ydiv, cnt, items_, val)                 \ 
    typedef struct { 
    137153    .relative_y = y,                                                    \ 
    138154    .y_divisions = ydiv,                                                \ 
    139155    .widget = NULL,                                                     \ 
    140     .u.radio.count = cnt,                                               \ 
    141     .u.radio.items = items_,                                            \ 
    142     .u.radio.value = val,                                               \ 
     156    .u = {                                                              \ 
     157        .radio = {                                                      \ 
     158            .count = cnt,                                               \ 
     159            .items = items_,                                            \ 
     160            .value = val                                                \ 
     161        }                                                               \ 
     162    }                                                                   \ 
    143163} 
    144164 
    145165#define QUICK_END                                                       \ 
    typedef struct { 
    150170    .relative_y = 0,                                                    \ 
    151171    .y_divisions = 0,                                                   \ 
    152172    .widget = NULL,                                                     \ 
    153     .u.input.text = NULL,                                               \ 
    154     .u.input.len = 0,                                                   \ 
    155     .u.input.flags = 0,                                                 \ 
    156     .u.input.histname = NULL,                                           \ 
    157     .u.input.result = NULL                                              \ 
     173    .u = {                                                              \ 
     174        .input = {                                                      \ 
     175            .text = NULL,                                               \ 
     176            .len = 0,                                                   \ 
     177            .flags = 0,                                                 \ 
     178            .histname = NULL,                                           \ 
     179            .result = NULL                                              \ 
     180        }                                                               \ 
     181    }                                                                   \ 
    158182} 
    159183 
    160184typedef struct {