Re: Replace static initializers with a proper #define in .h files
On Sat, 14 Sep 2002, Dmitry Timoshkov wrote:
Hello.
Changelog: Dmitry Timoshkov <dmitry(a)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(a)free.fr http://fgouget.free.fr/ Cahn's Axiom: When all else fails, read the instructions.
Francois Gouget <fgouget(a)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(a)winehq.com
"Alexandre Julliard" <julliard(a)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.
"Dmitry Timoshkov" <dmitry(a)baikal.ru> writes:
Is it acceptable to protect defines by #ifdef __GNUC__ and use an old scheme otherwise?
Yes that sounds reasonable. -- Alexandre Julliard julliard(a)winehq.com
On 15 Sep 2002, Alexandre Julliard wrote:
"Dmitry Timoshkov" <dmitry(a)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(a)free.fr http://fgouget.free.fr/ A particle is an irreducible representation of the Poincaré Group - Eugene Wigner
"Francois Gouget" <fgouget(a)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. -- Dmitry.
participants (3)
-
Alexandre Julliard -
Dmitry Timoshkov -
Francois Gouget