On 03/24/12 14:39, Nikita Egorov wrote:
> I think VS applies 'static' attribute only to first variable from list
> ('no_fullscreen_x').

        I'm not sure that's the problem, at least not as a general
        case with 'static'. Though perhaps the DLL context is complicating
        things.

        Just for the record, the following compiled with VS2010:

C:\temp>type foo.cxx
#include <stdio.h>
class Bar {
    static int ca,cb,cc;        // static members in a class
public:
    Bar() {
        ++ca; ++cb; ++cc;
        printf("BAR: CA,CB,CC: %d\n", ca,cb,cc);
    }
};
int Bar::ca = 100;
int Bar::cb = 200;
int Bar::cc = 300;

void foo() {
    static int a=1,b=1,c=1,d=1;         // static members in a function
    printf("ABCD: %d %d %d %d\n", a,b,c,d);
    a++; b++; c++; d++;
}
int main() {
    foo(); foo(); foo();
    new Bar();
    new Bar();
    new Bar();
    return(0);
}

C:\temp>cl /TP foo.cxx
Microsoft (R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

foo.cxx
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:foo.exe
foo.obj

C:\temp>foo
ABCD: 1 1 1 1
ABCD: 2 2 2 2           <-- expected static behavior for static function vars
ABCD: 3 3 3 3
BAR: CA,CB,CC: 101
BAR: CA,CB,CC: 102      <-- expected static behavior for static class vars
BAR: CA,CB,CC: 103

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to