Compilation bug fixed in graph_to_eps.h with VS2005 (#214)
authorJanos Tapolcai <tapolcai@tmit.bme.hu>
Tue, 10 Feb 2009 15:43:39 +0100
changeset 36570aa52d30f13
parent 364 55111a054b2e
child 366 daddd623ac9a
Compilation bug fixed in graph_to_eps.h with VS2005 (#214)
lemon/graph_to_eps.h
     1.1 --- a/lemon/graph_to_eps.h	Sat Feb 07 15:30:04 2009 +0000
     1.2 +++ b/lemon/graph_to_eps.h	Tue Feb 10 15:43:39 2009 +0100
     1.3 @@ -688,18 +688,30 @@
     1.4        os << "%%CreationDate: " << cbuf;
     1.5  #else
     1.6        SYSTEMTIME time;
     1.7 -      char buf1[11], buf2[9], buf3[5];
     1.8 -
     1.9        GetSystemTime(&time);
    1.10 +#if defined(_MSC_VER) && (_MSC_VER < 1500)
    1.11 +      LPWSTR buf1, buf2, buf3;
    1.12        if (GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
    1.13 -                        "ddd MMM dd", buf1, 11) &&
    1.14 +                        L"ddd MMM dd", buf1, 11) &&
    1.15            GetTimeFormat(LOCALE_USER_DEFAULT, 0, &time,
    1.16 -                        "HH':'mm':'ss", buf2, 9) &&
    1.17 +                        L"HH':'mm':'ss", buf2, 9) &&
    1.18            GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
    1.19 -                                "yyyy", buf3, 5)) {
    1.20 +                        L"yyyy", buf3, 5)) {
    1.21          os << "%%CreationDate: " << buf1 << ' '
    1.22             << buf2 << ' ' << buf3 << std::endl;
    1.23        }
    1.24 +#else
    1.25 +        char buf1[11], buf2[9], buf3[5];
    1.26 +        if (GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
    1.27 +                          "ddd MMM dd", buf1, 11) &&
    1.28 +            GetTimeFormat(LOCALE_USER_DEFAULT, 0, &time,
    1.29 +                          "HH':'mm':'ss", buf2, 9) &&
    1.30 +            GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
    1.31 +                          "yyyy", buf3, 5)) {
    1.32 +          os << "%%CreationDate: " << buf1 << ' '
    1.33 +             << buf2 << ' ' << buf3 << std::endl;
    1.34 +        }
    1.35 +#endif
    1.36  #endif
    1.37      }
    1.38