lemon/graph_to_eps.h
changeset 489 2a136de8e3f2
parent 440 88ed40ad0d4f
parent 484 daddd623ac9a
child 492 b9b3473327e3
     1.1 --- a/lemon/graph_to_eps.h	Fri Feb 13 13:29:28 2009 +0100
     1.2 +++ b/lemon/graph_to_eps.h	Fri Feb 13 16:05:21 2009 +0000
     1.3 @@ -29,8 +29,12 @@
     1.4  #include<sys/time.h>
     1.5  #include<ctime>
     1.6  #else
     1.7 +#ifndef WIN32_LEAN_AND_MEAN
     1.8  #define WIN32_LEAN_AND_MEAN
     1.9 +#endif
    1.10 +#ifndef NOMINMAX
    1.11  #define NOMINMAX
    1.12 +#endif
    1.13  #include<windows.h>
    1.14  #endif
    1.15  
    1.16 @@ -688,18 +692,30 @@
    1.17        os << "%%CreationDate: " << cbuf;
    1.18  #else
    1.19        SYSTEMTIME time;
    1.20 -      char buf1[11], buf2[9], buf3[5];
    1.21 -
    1.22        GetSystemTime(&time);
    1.23 +#if defined(_MSC_VER) && (_MSC_VER < 1500)
    1.24 +      LPWSTR buf1, buf2, buf3;
    1.25        if (GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
    1.26 -                        "ddd MMM dd", buf1, 11) &&
    1.27 +                        L"ddd MMM dd", buf1, 11) &&
    1.28            GetTimeFormat(LOCALE_USER_DEFAULT, 0, &time,
    1.29 -                        "HH':'mm':'ss", buf2, 9) &&
    1.30 +                        L"HH':'mm':'ss", buf2, 9) &&
    1.31            GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
    1.32 -                                "yyyy", buf3, 5)) {
    1.33 +                        L"yyyy", buf3, 5)) {
    1.34          os << "%%CreationDate: " << buf1 << ' '
    1.35             << buf2 << ' ' << buf3 << std::endl;
    1.36        }
    1.37 +#else
    1.38 +        char buf1[11], buf2[9], buf3[5];
    1.39 +        if (GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
    1.40 +                          "ddd MMM dd", buf1, 11) &&
    1.41 +            GetTimeFormat(LOCALE_USER_DEFAULT, 0, &time,
    1.42 +                          "HH':'mm':'ss", buf2, 9) &&
    1.43 +            GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
    1.44 +                          "yyyy", buf3, 5)) {
    1.45 +          os << "%%CreationDate: " << buf1 << ' '
    1.46 +             << buf2 << ' ' << buf3 << std::endl;
    1.47 +        }
    1.48 +#endif
    1.49  #endif
    1.50      }
    1.51