COIN-OR::LEMON - Graph Library

Changeset 134:0775d2ba2afb in lemon-1.0


Ignore:
Timestamp:
04/14/08 19:27:36 (11 years ago)
Author:
Balazs Dezso <deba@…>
Branch:
default
Phase:
public
Message:

MinGW compatibility for graph_to_eps.h

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/graph_to_eps.h

    r133 r134  
    2020#define LEMON_GRAPH_TO_EPS_H
    2121
    22 #include <sys/time.h>
    23 
    24 #ifdef WIN32
    25 #include <lemon/bits/mingw32_time.h>
    26 #endif
    27 
    2822#include<iostream>
    2923#include<fstream>
     
    3226#include<vector>
    3327
     28#ifndef WIN32
     29#include<sys/time.h>
    3430#include<ctime>
     31#else
     32#include<windows.h>
     33#endif
    3534
    3635#include<lemon/math.h>
     
    718717//        << "%%Copyright: XXXX\n"
    719718    os << "%%Creator: LEMON, graphToEps()\n";
    720    
    721     {
    722       char cbuf[50];
     719
     720    {   
     721#ifndef WIN32
    723722      timeval tv;
    724723      gettimeofday(&tv, 0);
     724
     725      char cbuf[26];
    725726      ctime_r(&tv.tv_sec,cbuf);
    726727      os << "%%CreationDate: " << cbuf;
     728#else
     729      SYSTEMTIME time;
     730      char buf1[11], buf2[9], buf3[5];
     731     
     732      GetSystemTime(&time);
     733      if (GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
     734                        "ddd MMM dd", buf1, 11) &&
     735          GetTimeFormat(LOCALE_USER_DEFAULT, 0, &time,
     736                        "HH':'mm':'ss", buf2, 9) &&
     737          GetDateFormat(LOCALE_USER_DEFAULT, 0, &time,
     738                                "yyyy", buf3, 5)) {
     739        os << "%%CreationDate: " << buf1 << ' '
     740           << buf2 << ' ' << buf3 << std::endl;
     741      }   
     742#endif
    727743    }
    728744
Note: See TracChangeset for help on using the changeset viewer.