# HG changeset patch
# User Balazs Dezso <deba@inf.elte.hu>
# Date 1208194056 -7200
# Node ID 028218c1fd0665c1ced36ba49bb375a1fc6aac3e
# Parent 145b7e96e2108de7176e75ada42704a688545b9d
MinGW compatibility for graph_to_eps.h
diff -r 145b7e96e210 -r 028218c1fd06 lemon/graph_to_eps.h
a
|
b
|
|
19 | 19 | #ifndef LEMON_GRAPH_TO_EPS_H |
20 | 20 | #define LEMON_GRAPH_TO_EPS_H |
21 | 21 | |
22 | | #include <sys/time.h> |
23 | | |
24 | | #ifdef WIN32 |
25 | | #include <lemon/bits/mingw32_time.h> |
26 | | #endif |
27 | | |
28 | 22 | #include<iostream> |
29 | 23 | #include<fstream> |
30 | 24 | #include<sstream> |
31 | 25 | #include<algorithm> |
32 | 26 | #include<vector> |
33 | 27 | |
| 28 | #ifndef WIN32 |
| 29 | #include<sys/time.h> |
34 | 30 | #include<ctime> |
| 31 | #else |
| 32 | #include<windows.h> |
| 33 | #endif |
35 | 34 | |
36 | 35 | #include<lemon/math.h> |
37 | 36 | #include<lemon/bits/invalid.h> |
… |
… |
public: |
707 | 706 | if(_copyright.size()>0) os << "%%Copyright: " << _copyright << '\n'; |
708 | 707 | // << "%%Copyright: XXXX\n" |
709 | 708 | os << "%%Creator: LEMON, graphToEps()\n"; |
710 | | |
711 | | { |
712 | | char cbuf[50]; |
| 709 | |
| 710 | { |
| 711 | #ifndef WIN32 |
713 | 712 | timeval tv; |
714 | 713 | gettimeofday(&tv, 0); |
| 714 | |
| 715 | char cbuf[26]; |
715 | 716 | ctime_r(&tv.tv_sec,cbuf); |
716 | 717 | os << "%%CreationDate: " << cbuf; |
| 718 | #else |
| 719 | SYSTEMTIME time; |
| 720 | char buf1[11], buf2[9], buf3[5]; |
| 721 | |
| 722 | GetSystemTime(&time); |
| 723 | if (GetDateFormat(LOCALE_USER_DEFAULT, 0, &time, |
| 724 | "ddd MMM dd", buf1, 11) && |
| 725 | GetTimeFormat(LOCALE_USER_DEFAULT, 0, &time, |
| 726 | "HH':'mm':'ss", buf2, 9) && |
| 727 | GetDateFormat(LOCALE_USER_DEFAULT, 0, &time, |
| 728 | "yyyy", buf3, 5)) { |
| 729 | os << "%%CreationDate: " << buf1 << ' ' |
| 730 | << buf2 << ' ' << buf3 << std::endl; |
| 731 | } |
| 732 | #endif |
717 | 733 | } |
718 | 734 | |
719 | 735 | if (_autoArcWidthScale) { |