Коллеги, скажите, есть разумное объяснение, почему код
SK_ViewZoom(skv, SK_VIEW_SCALE_X(skv) +
logf(1.0+SK_VIEW_SCALE_X(skv))/3.0);
выдает ошибки:
...\sk\sk_view.c(136) : error C2143: syntax error : missing ')' before ';'
...\sk\sk_view.c(136) : error C2143: syntax error : missing ';' before '/'
...\sk\sk_view.c(136) : error C2059: syntax error : ')'
а будучи замененным на
{
M_Real l = logf(1.0+SK_VIEW_SCALE_X(skv));
SK_ViewZoom(skv, SK_VIEW_SCALE_X(skv) + l/3.0);
}
нормально компилируется?
MSVC2005
#define SK_VIEW_SCALE_X(skv) (skv)->mView.m[0][0]
Здравствуйте, antirest,
Пиши багрепорт в MS
math.h
#define logf(x) ((float)log((double)(x))) ;
People who are more than casually interested in computers should have at least some idea of what the underlying hardware is like. Otherwise the programs they write will be pretty weird (c) D.Knuth
People who are more than casually interested in computers should have at least some idea of what the underlying hardware is like. Otherwise the programs they write will be pretty weird (c) D.Knuth
GN>Пиши багрепорт в MS
GN>math.h
GN>GN>#define logf(x) ((float)log((double)(x))) ;
GN>
Долго на это втыкал (b для знаков препинания не особо заметен), потом наконец понял. Цензурных слов нет. Спасибо
Здравствуйте, antirest,
Вообще самое смешное тут (если бы не было так грустно) что
Аноним был практически правАвтор:
Дата: 27.02.08
. Такие ошибки всегда последствия кривых макросов.
Но 7.1.3/1 стоит тоже иметь ввиду:
Each identifier with file scope listed in any of the following subclauses (including the
future library directions) is reserved for use as a macro name and as an identifier with
file scope in the same name space if any of its associated headers is included.
Кстати, какой приняли workarround?
People who are more than casually interested in computers should have at least some idea of what the underlying hardware is like. Otherwise the programs they write will be pretty weird (c) D.Knuth
Здравствуйте, gear nuke, Вы писали:
GN>Кстати, какой приняли workarround?
#undef logf(x)
#define logf(x) ((float)log((double)(x)))