Log in
Register
Menu
Log in
Register
Home
What's new
Latest activity
Authors
Forums
New posts
Search forums
What's new
New posts
Latest activity
Members
Current visitors
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Satellite TV receivers & systems support forums
Analogue systems
Hacktv: analogue tv transmitter
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="steeviebops" data-source="post: 1096459" data-attributes="member: 414368"><p>I thought I'd post an update regarding the section of mac.c that has been causing issues on Windows. I normally worked around it by removing the section in question but I decided to put a couple of hours into trying to fix it altogether. I had to change three parts to get it to work; seems Windows expects localtime_s and gmtime_s rather than localtime_r and gmtime_r. They accept the same data but with the parameters reversed. Additionally, I replaced tm.tm_gmtoff with _timezone. I'm not 100% that it works as I don't really know what the code does, but I get no compilation errors at all now so it looks promising.</p><p></p><p>Anyway, here is the change I make to mac.c before compiling:</p><p></p><p>[CODE=c]#ifndef WIN32</p><p> /* Get the timezone offset */</p><p> localtime_r(&timestamp, &tm);</p><p> i = tm.tm_gmtoff / 1800;</p><p> if(i < 0) i = -i | (1 << 5);</p><p> </p><p> /* Calculate Modified Julian Date */</p><p> gmtime_r(&timestamp, &tm);</p><p> mjd = 367.0 * (1900 + tm.tm_year)</p><p> - (int) (7.0 * (1900 + tm.tm_year + (int) ((1 + tm.tm_mon + 9.0) / 12.0)) / 4.0)</p><p> + (int) (275.0 * (1 + tm.tm_mon) / 9.0) + tm.tm_mday - 678987.0;</p><p>#else</p><p> /* Get the timezone offset */</p><p> localtime_s(&tm, &timestamp);</p><p> i = _timezone / 1800;</p><p> if(i < 0) i = -i | (1 << 5);</p><p> </p><p> /* Calculate Modified Julian Date */</p><p> gmtime_s(&tm, &timestamp);</p><p> mjd = 367.0 * (1900 + tm.tm_year)</p><p> - (int) (7.0 * (1900 + tm.tm_year + (int) ((1 + tm.tm_mon + 9.0) / 12.0)) / 4.0)</p><p> + (int) (275.0 * (1 + tm.tm_mon) / 9.0) + tm.tm_mday - 678987.0;</p><p>#endif[/CODE]</p></blockquote><p></p>
[QUOTE="steeviebops, post: 1096459, member: 414368"] I thought I'd post an update regarding the section of mac.c that has been causing issues on Windows. I normally worked around it by removing the section in question but I decided to put a couple of hours into trying to fix it altogether. I had to change three parts to get it to work; seems Windows expects localtime_s and gmtime_s rather than localtime_r and gmtime_r. They accept the same data but with the parameters reversed. Additionally, I replaced tm.tm_gmtoff with _timezone. I'm not 100% that it works as I don't really know what the code does, but I get no compilation errors at all now so it looks promising. Anyway, here is the change I make to mac.c before compiling: [CODE=c]#ifndef WIN32 /* Get the timezone offset */ localtime_r(×tamp, &tm); i = tm.tm_gmtoff / 1800; if(i < 0) i = -i | (1 << 5); /* Calculate Modified Julian Date */ gmtime_r(×tamp, &tm); mjd = 367.0 * (1900 + tm.tm_year) - (int) (7.0 * (1900 + tm.tm_year + (int) ((1 + tm.tm_mon + 9.0) / 12.0)) / 4.0) + (int) (275.0 * (1 + tm.tm_mon) / 9.0) + tm.tm_mday - 678987.0; #else /* Get the timezone offset */ localtime_s(&tm, ×tamp); i = _timezone / 1800; if(i < 0) i = -i | (1 << 5); /* Calculate Modified Julian Date */ gmtime_s(&tm, ×tamp); mjd = 367.0 * (1900 + tm.tm_year) - (int) (7.0 * (1900 + tm.tm_year + (int) ((1 + tm.tm_mon + 9.0) / 12.0)) / 4.0) + (int) (275.0 * (1 + tm.tm_mon) / 9.0) + tm.tm_mday - 678987.0; #endif[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Satellite TV receivers & systems support forums
Analogue systems
Hacktv: analogue tv transmitter
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top