iOS clock_gettime() 에러 해결
iOS에서는 리눅스의 clock_gettime()함수가 존재하지 않는다. 따라서 리눅스 코드를 포팅할때는 아래와 같은 대체함수를 사용하여야 한다. #include #include #ifdef __MACH__ #include #include #endif struct timespec ts; #ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time clock_serv_t cclock; mach_timespec_t mts; host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock); clock_get_time(cclock, &mts); mach_port_deallocate(mach_..
모바일 프로그래밍
2016. 4. 24. 20:40
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday