On Sat, 14 Sep 2002, Dmitry Timoshkov wrote:
Hello.
Changelog: Dmitry Timoshkov dmitry@codeweavers.com Replace static initializers with a proper #define in .h files.
Are defines really better?
It seemed to me that they had at least one disadvantage: the value is duplicated each time the define is used. Hmmm, I just retested and it looks as if I was wrong.
Anyway, what are the pros and cons?
Francois Gouget fgouget@free.fr writes:
Are defines really better?
It seemed to me that they had at least one disadvantage: the value is duplicated each time the define is used. Hmmm, I just retested and it looks as if I was wrong.
Anyway, what are the pros and cons?
Well, the defines would be better if we could use them, the problem is that they are not portable at all.
"Alexandre Julliard" julliard@winehq.com wrote:
Well, the defines would be better if we could use them, the problem is that they are not portable at all.
Is it acceptable to protect defines by #ifdef __GNUC__ and use an old scheme otherwise?
"Dmitry Timoshkov" dmitry@baikal.ru writes:
Is it acceptable to protect defines by #ifdef __GNUC__ and use an old scheme otherwise?
Yes that sounds reasonable.
On 15 Sep 2002, Alexandre Julliard wrote:
"Dmitry Timoshkov" dmitry@baikal.ru writes:
Is it acceptable to protect defines by #ifdef __GNUC__ and use an old scheme otherwise?
Yes that sounds reasonable.
Why bother with ifdefs and duplicating a lot of code if the static initializers work? I must still be missing something.
"Francois Gouget" fgouget@free.fr wrote:
Why bother with ifdefs and duplicating a lot of code if the static initializers work? I must still be missing something.
There is at least one huge disadvantage of a static initializer: it always consumes memory, used it or not. Just do #include <windows.h>, compile and see the result.