Changeset 5574
- Timestamp:
- Mar 29, 2017 5:07:47 AM (8 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/aconfigure
r5549 r5574 756 756 oldincludedir 757 757 includedir 758 runstatedir 758 759 localstatedir 759 760 sharedstatedir … … 878 879 sharedstatedir='${prefix}/com' 879 880 localstatedir='${prefix}/var' 881 runstatedir='${localstatedir}/run' 880 882 includedir='${prefix}/include' 881 883 oldincludedir='/usr/include' … … 1130 1132 silent=yes ;; 1131 1133 1134 -runstatedir | --runstatedir | --runstatedi | --runstated \ 1135 | --runstate | --runstat | --runsta | --runst | --runs \ 1136 | --run | --ru | --r) 1137 ac_prev=runstatedir ;; 1138 -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ 1139 | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ 1140 | --run=* | --ru=* | --r=*) 1141 runstatedir=$ac_optarg ;; 1142 1132 1143 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) 1133 1144 ac_prev=sbindir ;; … … 1267 1278 datadir sysconfdir sharedstatedir localstatedir includedir \ 1268 1279 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ 1269 libdir localedir mandir 1280 libdir localedir mandir runstatedir 1270 1281 do 1271 1282 eval ac_val=\$$ac_var … … 1420 1431 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] 1421 1432 --localstatedir=DIR modifiable single-machine data [PREFIX/var] 1433 --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] 1422 1434 --libdir=DIR object code libraries [EPREFIX/lib] 1423 1435 --includedir=DIR C header files [PREFIX/include] … … 5416 5428 5417 5429 5430 case $target in 5431 *android*) 5432 ac_fn_c_check_header_mongrel "$LINENO" "linux/android_alarm.h" "ac_cv_header_linux_android_alarm_h" "$ac_includes_default" 5433 if test "x$ac_cv_header_linux_android_alarm_h" = xyes; then : 5434 $as_echo "#define PJ_HAS_ANDROID_ALARM_H 1" >>confdefs.h 5435 5436 fi 5437 5438 5439 ;; 5440 esac 5441 5418 5442 ac_fn_c_check_func "$LINENO" "localtime_r" "ac_cv_func_localtime_r" 5419 5443 if test "x$ac_cv_func_localtime_r" = xyes; then : -
pjproject/trunk/aconfigure.ac
r5549 r5574 266 266 #endif 267 267 ]) 268 269 case $target in 270 *android*) 271 AC_CHECK_HEADER(linux/android_alarm.h,[AC_DEFINE(PJ_HAS_ANDROID_ALARM_H,1)]) 272 ;; 273 esac 268 274 269 275 AC_CHECK_FUNC(localtime_r,[AC_DEFINE(PJ_HAS_LOCALTIME_R,1)]) -
pjproject/trunk/pjlib/src/pj/os_timestamp_posix.c
r5501 r5574 164 164 165 165 #include <errno.h> 166 #include <linux/android_alarm.h>167 #include <fcntl.h>168 166 #include <time.h> 169 167 168 #if defined(PJ_HAS_ANDROID_ALARM_H) && PJ_HAS_ANDROID_ALARM_H != 0 169 # include <linux/android_alarm.h> 170 # include <fcntl.h> 171 #endif 172 170 173 #define NSEC_PER_SEC 1000000000 171 174 175 #if defined(ANDROID_ALARM_GET_TIME) 172 176 static int s_alarm_fd = -1; 173 177 … … 178 182 s_alarm_fd = -1; 179 183 } 184 #endif 180 185 181 186 PJ_DEF(pj_status_t) pj_get_timestamp(pj_timestamp *ts) … … 184 189 int err = -1; 185 190 191 #if defined(ANDROID_ALARM_GET_TIME) 186 192 if (s_alarm_fd == -1) { 187 193 int fd = open("/dev/alarm", O_RDONLY); … … 196 202 ANDROID_ALARM_GET_TIME(ANDROID_ALARM_ELAPSED_REALTIME), &tp); 197 203 } 204 #elif defined(CLOCK_BOOTTIME) 205 err = clock_gettime(CLOCK_BOOTTIME, &tp); 206 #endif 198 207 199 208 if (err != 0) { 200 209 /* Fallback to CLOCK_MONOTONIC if /dev/alarm is not found, or 201 * getting ANDROID_ALARM_ELAPSED_REALTIME fails. 210 * getting ANDROID_ALARM_ELAPSED_REALTIME fails, or 211 * CLOCK_BOOTTIME fails. 202 212 */ 203 213 err = clock_gettime(CLOCK_MONOTONIC, &tp);
Note: See TracChangeset
for help on using the changeset viewer.