bool SetSysTime(Time time) { #ifdef PLATFORM_POSIX struct tm tmp_time; tmp_time.tm_sec = time.second; tmp_time.tm_min = time.minute; tmp_time.tm_hour = time.hour; tmp_time.tm_mday = time.day; tmp_time.tm_mon = time.month-1; tmp_time.tm_year = time.year-1900; time_t raw_time = mktime(&tmp_time); struct timespec sys_time; sys_time.tv_sec = raw_time; sys_time.tv_nsec = 0; #ifdef __MACH__ #include <sys/time.h> localtime(&raw_time); //aris002 BUG TMP!!! HACK to compile! return true; #else int result = clock_settime(CLOCK_REALTIME, &sys_time); return (result == 0); #endif #endif
/* long is 64 bits */ #ifdef __APPLE__ typedef long long int64_t; typedef unsigned long long uint64_t; #else typedef signed long int64_t; typedef unsigned long uint64_t; #endif
//#ifdef __APPLE__ //#define _FORTIFY_SOURCE 0 //aris002 - in the future evaluate how unsafe are the safe funtions and vice versa //#endif
Wow, welcome back!
Mirek
library(LINUX) "pthread dl rt"; library(BSD !OSX11) "pthread rt execinfo"; library(OSX) pthread;
Hi Aris!
happy to "see" you again
It depends by your efforts on porting U++ on MAC if one day I'll buy one.
Luigi
Hi Aris,
Nice to have you back on the Upp forum!
Best regards,
Tom