Ticket #62061: wireshark3-patch-fix-clock_realtime.diff
File wireshark3-patch-fix-clock_realtime.diff, 976 bytes (added by mascguy (Christopher Nielsen), 4 years ago) |
---|
-
ui/qt/import_text_dialog.cpp
11 11 12 12 #include <time.h> 13 13 14 #ifdef __MACH__ 15 #include <mach/clock.h> 16 #include <mach/mach.h> 17 #endif 18 14 19 #include "import_text_dialog.h" 15 20 16 21 #include "wiretap/wtap.h" … … 384 389 385 390 #ifdef _WIN32 386 391 timespec_get(&timenow, TIME_UTC); /* supported by Linux and Windows */ 392 #elif defined(__MACH__) 393 // OS X does not have clock_gettime, use clock_get_time 394 clock_serv_t cclock; 395 mach_timespec_t mts; 396 host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock); 397 clock_get_time(cclock, &mts); 398 mach_port_deallocate(mach_task_self(), cclock); 399 timenow.tv_sec = mts.tv_sec; 400 timenow.tv_nsec = mts.tv_nsec; 387 401 #else 388 402 clock_gettime(CLOCK_REALTIME, &timenow); /* supported by Linux and MacOS */ 389 403 #endif