Changeset 5458
- Timestamp:
- Oct 13, 2016 4:32:29 AM (8 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/aconfigure
r5445 r5458 5415 5415 5416 5416 5417 ac_fn_c_check_func "$LINENO" "localtime_r" "ac_cv_func_localtime_r" 5418 if test "x$ac_cv_func_localtime_r" = xyes; then : 5419 $as_echo "#define PJ_HAS_LOCALTIME_R 1" >>confdefs.h 5420 5421 fi 5422 5417 5423 { $as_echo "$as_me:${as_lineno-$LINENO}: result: Setting PJ_OS_NAME to $target" >&5 5418 5424 $as_echo "Setting PJ_OS_NAME to $target" >&6; } -
pjproject/trunk/aconfigure.ac
r5445 r5458 266 266 #endif 267 267 ]) 268 269 AC_CHECK_FUNC(localtime_r,[AC_DEFINE(PJ_HAS_LOCALTIME_R,1)]) 270 268 271 AC_MSG_RESULT([Setting PJ_OS_NAME to $target]) 269 272 AC_DEFINE_UNQUOTED(PJ_OS_NAME,["$target"]) -
pjproject/trunk/pjlib/include/pj/compat/os_auto.h.in
r5403 r5458 167 167 #endif 168 168 169 /* Is localtime_r() available? */ 170 #undef PJ_HAS_LOCALTIME_R 171 169 172 /* Unicode? */ 170 173 #undef PJ_NATIVE_STRING_IS_UNICODE -
pjproject/trunk/pjlib/include/pj/compat/os_darwinos.h
r4626 r5458 55 55 #define PJ_HAS_WINSOCK_H 0 56 56 #define PJ_HAS_WINSOCK2_H 0 57 58 #define PJ_HAS_LOCALTIME_R 1 57 59 58 60 /* Is errno a good way to retrieve OS errors? -
pjproject/trunk/pjlib/include/pj/compat/os_linux.h
r3553 r5458 55 55 #define PJ_HAS_WINSOCK_H 0 56 56 #define PJ_HAS_WINSOCK2_H 0 57 58 #define PJ_HAS_LOCALTIME_R 1 57 59 58 60 #define PJ_SOCK_HAS_INET_ATON 1 -
pjproject/trunk/pjlib/src/pj/os_time_common.c
r4784 r5458 29 29 PJ_DEF(pj_status_t) pj_time_decode(const pj_time_val *tv, pj_parsed_time *pt) 30 30 { 31 struct tm *local_time;31 struct tm local_time; 32 32 33 33 PJ_CHECK_STACK(); 34 34 35 local_time = localtime((time_t*)&tv->sec); 35 #if defined(PJ_HAS_LOCALTIME_R) && PJ_HAS_LOCALTIME_R != 0 36 localtime_r((time_t*)&tv->sec, &local_time); 37 #else 38 /* localtime() is NOT thread-safe. */ 39 local_time = *localtime((time_t*)&tv->sec); 40 #endif 36 41 37 pt->year = local_time ->tm_year+1900;38 pt->mon = local_time ->tm_mon;39 pt->day = local_time ->tm_mday;40 pt->hour = local_time ->tm_hour;41 pt->min = local_time ->tm_min;42 pt->sec = local_time ->tm_sec;43 pt->wday = local_time ->tm_wday;42 pt->year = local_time.tm_year+1900; 43 pt->mon = local_time.tm_mon; 44 pt->day = local_time.tm_mday; 45 pt->hour = local_time.tm_hour; 46 pt->min = local_time.tm_min; 47 pt->sec = local_time.tm_sec; 48 pt->wday = local_time.tm_wday; 44 49 pt->msec = tv->msec; 45 50
Note: See TracChangeset
for help on using the changeset viewer.