Changeset 1005 for cpp/common/Convert.cpp
- Timestamp:
- 07/14/20 15:54:43 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/Convert.cpp
r400 r1005 4 4 5 5 #include "Convert.h" 6 7 6 #include <sstream> 8 7 … … 91 90 struct tm ret; 92 91 #if defined LINUX // || android? 93 return *::localtime_r(&timep, &ret);92 return *::localtime_r(&timep, &ret); 94 93 #elif defined _WIN32 && !defined __BORLANDC__ 95 94 ::localtime_s(&ret, &timep); … … 97 96 #else //borland? 98 97 pthread_mutex_lock(&fix_unsafe_mutex); 99 ret =*::localtime(&timep);98 ret = *::localtime(&timep); 100 99 pthread_mutex_unlock(&fix_unsafe_mutex); 101 100 return ret; … … 110 109 #ifndef MULTITHREADED 111 110 112 ret =::asctime(&tm);111 ret = ::asctime(&tm); 113 112 114 113 #else //MULTITHREADED … … 116 115 char buf[26]; 117 116 #if defined LINUX // || android? 118 ret =::asctime_r(&tm,buf);117 ret = ::asctime_r(&tm, buf); 119 118 #elif defined _WIN32 && !defined __BORLANDC__ 120 119 asctime_s(buf, sizeof(buf), &tm); … … 122 121 #else //borland? 123 122 pthread_mutex_lock(&fix_unsafe_mutex); 124 strcpy(buf, ::asctime(&tm));125 ret =buf;123 strcpy(buf, ::asctime(&tm)); 124 ret = buf; 126 125 pthread_mutex_unlock(&fix_unsafe_mutex); 127 126 #endif
Note: See TracChangeset
for help on using the changeset viewer.