COIN-OR::LEMON - Graph Library

Ticket #214: msdev_porting_861a9d5ff283.patch

File msdev_porting_861a9d5ff283.patch, 1.7 KB (added by Tapolcai János, 15 years ago)
  • lemon/graph_to_eps.h

    # HG changeset patch
    # User "Janos Tapolcai <tapolcai@tmit.bme.hu>"
    # Date 1234277019 -3600
    # Node ID 1cdc660f12c42f603c28a2f1795235e5e999f48c
    # Parent  861a9d5ff283ec024491304718018dc4b7ed4b0b
    Bugfix for poritng graph_to_eps for VS2005
    
    diff --git a/lemon/graph_to_eps.h b/lemon/graph_to_eps.h
    a b  
    688688      os << "%%CreationDate: " << cbuf;
    689689#else
    690690      SYSTEMTIME time;
    691       char buf1[11], buf2[9], buf3[5];
    692 
    693       GetSystemTime(&time);
    694       if (GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
    695                         "ddd MMM dd", buf1, 11) &&
     691      #ifdef _MSC_VER
     692        LPWSTR buf1, buf2, buf3;
     693        GetSystemTime(&time);
     694        if (GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
     695          L"ddd MMM dd", buf1, 11) &&
    696696          GetTimeFormat(LOCALE_USER_DEFAULT, 0, &time,
    697                         "HH':'mm':'ss", buf2, 9) &&
     697          L"HH':'mm':'ss", buf2, 9) &&
    698698          GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
    699                                 "yyyy", buf3, 5)) {
     699          L"yyyy", buf3, 5)) {
    700700        os << "%%CreationDate: " << buf1 << ' '
    701701           << buf2 << ' ' << buf3 << std::endl;
    702       }
     702        }
     703      #else
     704        char buf1[11], buf2[9], buf3[5];
     705        GetSystemTime(&time);
     706        if (GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
     707                          "ddd MMM dd", buf1, 11) &&
     708            GetTimeFormat(LOCALE_USER_DEFAULT, 0, &time,
     709                          "HH':'mm':'ss", buf2, 9) &&
     710            GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
     711                                  "yyyy", buf3, 5)) {
     712          os << "%%CreationDate: " << buf1 << ' '
     713             << buf2 << ' ' << buf3 << std::endl;
     714        }
     715      #endif
    703716#endif
    704717    }
    705718